Nagios
Installation on Fedora
Installed nagios and nagios-plugins-all rpms from yum.
Configuration
nagios -v /etc/nagios/nagios.cfg shows error messages on startup, use /etc/rc.d/init.d/nagios after
it starts working.
Fiddled with /etc/httpd/conf.d/nagios.conf so I could access the pages from my computer.
Set up apache authentication in /etc/httpd/conf.d/nagios.conf
Set enable_notifications=0 in /etc/nagios/nagios.cfg
put username/passwd in /etc/nagios/passwd with htpasswd.
in /etc/nagios/
copy *.cfg-sample -> *.cfg
- make sure all .cfg files are readable by web server
edited nagios.cfg to use minimal.cfg only
edited cgi.cfg to authorize myself to view everything
- The blurb in the docs about time saving with templates is really helpful
- check_ntp was a little busted at first
- created two contacts, one is my email and one is my pager. There isn't really a way to give one contact an email and a pager and tell the thing to use them at different times.
ePN
Nagios for Fedora comes default with ePN or Embedded Perl Nagios. That means any plugins written in perl will be interpreted not by perl, but by nagios. There are a lot of wierd caviats that this creates including:
- $0 always equals /usr/sbin/p1.pl - near as I can tell, there is no way to find out what the script was called as
- Calling "exit" from a module causes problems under some circumstances. If possible, use die.
Quieting Down Nagios During Host Service
OK, so you're supposed to use nagios's fancy 'planned downtime' stuff, but that includes letting the CGIs have write access, which I don't like. If you're like me, and you don't want pages when you take a system offline, set up a check host command that always says the host is down, and says the host is being maintained.
This way, you'll get one page when nagios realises the system is offline. You won't get repeated onnline/offline pages from rebooting, and even better, you won't get the 8 pages you get when the system is pingable, but not offering any other services.
Here's a command (in checkcommands.cfg in my setup) that will do just that.
define command{
command_name check-host-planned
command_line $USER1$/check_dummy 2 "Down For Service"
}