Playing around with Nagios

I have been playing around with Nagios lately. This is the most widely used monitoring tool. I’m not going to write another howto, but clarify some things I found missing in the configuration manuals I used.

First you need the PHP module on the apache server for Nagios to work. Else you will find yourself downloading a phtml file to some directory in your box. This is because of the following files in the nagios directory.

xavi@server:~$ sudo find /nagios/ -type f -name "*.php"
/nagios/share/side.php
/nagios/share/includes/utils.inc.php
/nagios/share/main.php
/nagios/share/config.inc.php
/nagios/share/index.php
xavi@server:~$ 

Another issue I found was the with nrpe plugin. This plugin allows us to run commands on remote hosts. Issue is that default compilation values don’t allow us to pass arguments. To pass arguments from the server to the monitored host it must be compiled with the –enable-command-args argument when compiling the nrpe source. Another thing that must be done is setting the dont_blame_nrpe to 1 in the nrpe.cfg file.

dont_blame_nrpe=1

This changes allows us to run checks with arguments remotely. Example:

server:/nagios/libexec# ./check_nrpe -H 212.34.95.23 -c check_procs -a 100 120
PROCS OK: 96 processes
server:/nagios/libexec#

Questions and suggestions are always welcome. 🙂

Leave a Reply