hi david,

looking a little more closely at the patch:

On Tue, Mar 15, 2005 at 12:04:09PM +0000, David Greaves wrote:
> ! $ zcat /usr/share/doc/nagios-mysql/create_mysql.sql.gz | mysql -u root -p 
> nagios
> ! $ zcat /usr/share/doc/nagios-mysql/create_mysql.gz | mysql -u root -p nagios

whoops, fixed.  thanks.

> + First, how to do it by hand, then there's a sed script that may help:
> + 
>   
> + This sed script assumes you have a local database on a standard port
> + with a database/user/password of nagios/nagios/password
> + 
> + sed -i.orig '
> + s/#x\(.\)ddb_database=somedatabase/x\1ddb_database=nagios/;
> + s/#x\(.\)ddb_username=someuser/x\1ddb_username=nagios/;
> + s/#x\(.\)ddb_password=somepassword/x\1ddb_password=password/;
> + ' /etc/nagios/cgi.cfg /etc/nagios/nagios.cfg

unfortunately, this involves passing credentials on the cmdline which
can be read by anyone, so i would not include such a recommendation.

> + Then you want the cgi-script and the init.d script to correctly know the
> + status of nagios. You need the check_nagios_db file from
> + /usr/doc/nagios-common/, put it where you like but adjust the pathes in
> + the following examples. I REALLY suggest /etc/nagios/check_nagios_db as
> + the init-script now already looks if it is there and will use it
> + automagically.

included, thanks.  

> + If you use PostgreSQL you need to change the line
> + my $driver = "mysql"; in the script to
> + my $driver = "Pg";

kind of moot, since there's already a README.pgsql in nagios-pgsql :)

> + Make it executable:
> + sudo chmod +x /etc/nagios/check_nagios_db
> + 
> + Now edit the /etc/nagios/cgi.cfg and put a # in front of the line
> + nagios_check_command=/usr/lib/nagios/plugins/check_nagios 
> /var/log/nagios/status.log 5 'nagios'
> + 
> + and remove the # in front of the line
> + nagios_check_command=/etc/nagios/check_nagios_db
> + 
> + now start nagios
> + 

included, thanks.


        sean

-- 

Attachment: signature.asc
Description: Digital signature

Reply via email to