new patch included
David
*** /usr/share/doc/nagios-mysql/README.mysql Thu Feb 17 17:39:03 2005 --- /usr/share/doc/nagios-mysql/README.mysql.new Tue Mar 15 12:01:29 2005 *************** *** 16,22 **** $ mysqladmin -u root -p create nagios ! $ zcat /usr/share/doc/nagios-mysql/create_mysql.sql.gz | mysql -u root -p nagios When prompted for a password, please enter the password you choosed when configuring the package at install time... If you did not set a password, --- 16,22 ---- $ mysqladmin -u root -p create nagios ! $ zcat /usr/share/doc/nagios-mysql/create_mysql.gz | mysql -u root -p nagios When prompted for a password, please enter the password you choosed when configuring the package at install time... If you did not set a password, *************** *** 45,50 **** --- 45,52 ---- be sure to make them NOT world readable by issuing something like chmod o= /etc/nagios/resource.cfg. + First, how to do it by hand, then there's a sed script that may help: + 1) /etc/nagios/resource.cfg Uncomment and set the following lines to appropriate values, replacing *************** *** 75,80 **** --- 77,112 ---- At the bottom of this file, you'll find the similar lines commented out as were in the previous one. Do the same here. + 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/resource.cfg + + 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. + If you use PostgreSQL you need to change the line + my $driver = "mysql"; in the script to + my $driver = "Pg"; + + 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 + You should now be up and running enough to get started. You'll still need to edit your /etc/nagios/hosts.cfg and other files, but you'll be able to see that the default machines in there are now on the web