Nagios with MySQL - need help with external commands


#1

I’ve setup nagios with MySQL for backend storage iof the details. When an alarm sounds, I can’t acknowledge it, or schedule downtime, or run any other ‘external command’.

I’e looked over the basic Nagios instructions, and lacking information on using MySQL… and there smmes to be no specifics for enable/disable of theexernal commands.


#2

Take a look at nagios.org/faqs/viewfaq.php?faq_id=131

Basicly you take the file check_nagios_db.pl from the contrib dir of the plugins package, copy it to your nagios libexec dir
(probably /usr/local/nagios/libexec), modify the first line of the file, so it matches the location of your perl executeable.
If needed, do a chmod +x /usr/local/nagios/libexec/check_nagios_db.pl.
Now edit your /usr/local/nagios/etc/cgi.cfg
You should have a line like;
nagios_check_command=/usr/local/nagios/libexec/check_nagios /usr/local/nagios/var/status.log 5 ‘/usr/local/nagios/bin/nagios’

Uncomment that line (put a # in front)
and put this line in;
nagios_check_command=/usr/local/nagios/libexec/check_nagios_db.pl
Save the file, and restart nagios - you should be good to go :slight_smile: