Nagios doesn’t start / internal service error / PID unfound

Nagios web-interface can fail to connect to process or to display any content at all. There can be different source of the problem, but the key to solving it:

  1. Checking permissions on the cgi-bin, fcgi-bin folders and scripts inside /nagios path.
  2. Checking Suexec log if you use it (`/var/log/apache2/suexec.log` for example).
  3. Checking access mode on statusjson.cgi and status.cgi

In case it doesn’t help, and nagios simply refuses to start, showing only:

Running configuration check...
Starting nagios:.

You have to manually run configuration check with the -v flag:

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

If the check is correct, but nags refuses to run, providing no info in {path}/var/nagios.log and not creating {path}/var/nagios.lock, then the problem might be in the device space.

Setting up Nagios monitoring on Debian-based servers

Nagios is a great tool for server monitoring, providing rich environment to setup different notifications and monitoring scenarios.

It supports hosts and notification service grouping, comes with a GUI out-of-the-box and has really great community and lots of documentation online.

Pretty much all the setup can be done, based on the google’s top search results. Nice place to start is Digital Ocean post about setting up Nagios on Ubuntu 14.04. There is  also another nice post, explaining how configuration is done.

If you fail to install package, or your server is different from Ubuntu, f.e, you run some Debian Stable server, you can address this post (RU) and build Nagios from source.

Configuring client can be done via this post, but check_nrpe command available only on server, not on the client.