I set up a Nagios server on a CentOS 7 VM (Virtual Machine):
sudo yum install epel-release
sudo yum install nrpe
sudo yum install nagios
By default it sets up some basic checks for localhost. When I checked the Nagios site at http://127.0.0.1/nagios/, I found that even PING was critical:
(No output on stdout) stderr: execvp(/usr/lib64/nagios/plugins/check_ping, ...) failed. errno is 2: No such file or directory
I checked the contents of the plugins directory:
# ls /usr/lib64/nagios/plugins
eventhandlers negate urlize utils.sh
Sure enough, the usual suspects are not there. E.g.:
- check_load
- check_ping
- check_disk
- check_http
- check_procs
Eventually I stumbled onto the following document, /usr/share/doc/nagios-plugins-2.0.3/README.Fedora
:
Fedora users
Nagios plugins for Fedora have all been packaged separately. For
example, to isntall the check_http just install nagios-plugins-http.All plugins are installed in the architecture dependent directory
/usr/lib{,64}/nagios/plugins/.
I installed some of the plugins following that convention:
sudo yum install nagios-plugins-load
sudo yum install nagios-plugins-ping
sudo yum install nagios-plugins-disk
sudo yum install nagios-plugins-http
sudo yum install nagios-plugins-procs
Now the the corresponding plugins exist in /usr/lib64/nagios/plugins
, and Nagios reports OK for those checks on localhost.
Thanks a heap! Exactly what I needed.
nagios-plugins-all is available in epel.
Thanks to Noah Birnel for pointing out
nagios-plugins-all
! While I was looking at the various yum packages for Nagios, NRPE, and plugins I also noted this one:What is
nagios-plugins
and how is it different thannagios-plugins-all
?It’s still not really clear what the
nagios-plugins
package provides.Before any Nagios plugins are installed, the plugins directory already exists:
It contains just an empty directory,
eventhandlers
.After installing
nagios-plugins
(no dependent packages):It looks like these are used by Nagios and plugins.
urlize
, for example, turns plugin output into a clickable link. I don’t understand whynegate
exists: given a Nagios plugin and options, it returns the opposite of what the plugin returns. CRITICAL instead of OK. Why does this even exist?After installing
nagios-plugins-all
(along with 103 dependent packages):The 3 files installed by
nagios-plugins
are also present, as it was one of the dependencies.Even installing just
nagios-plugins-ping
includesnagios-plugins
as a dependency, so it looks like the files included in that package (negate
,urlize
, andutils.sh
) are required by most (if not all) of thenagios-plugins-*
packages.In general, I recommend avoiding installing any packages that aren’t strictly necessary. I would avoid installing
nagios-plugins-all
, but it is admittedly convenient.