We have a monitoring server running Nagios and we needed to add checks for Nginx process on a new server. Basically, you only need to install NRPE to monitor services, processes, disk space, load, etc on your remote machine. Check the NRPE docummention for complete reference and here’s a quick NRPE installation guide for Debian.
For my objective i only need to check if Nginx process is running and will use the check_procs. NRPE and Nagios Plugins were installed and i can check the Nginx process locally using the following commands:
1
|
|
wherein:
-c 1:30
<– refers to the Critical range for number of Nginx processes. If there process count is below 1 and above 30 this will send me a Critical notice. If you wan to add a Warning level you can use “-w 1:25” - adjust the number of processes for you needs.
-C nginx
<– this will check for the command name (nginx)
NOTE: For complete reference on this check and other samples please refer to the NagiosWiki page.
Below are my configurations:
NRPE(remote): /etc/nagios/nrpe_local.cfg
1
|
|
Nagios(host): /usr/local/nagios/etc/objects/localhost.cfg
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
Nagios version is 3.0. Nagios monitoring and remote server are running Debian Etch.