Monday, September 7, 2015

Display Dnsmasq status on Nagios

This article is an example of adding a custom process status in Nagios here the server (10.10.2.1) is separate from the host (10.10.2.2). In Nagios reference there are lots of option for configurations.

Dnsmasq as a light weight alternative to named, will appear in the linux process. E.g. when issuing the command ps -C dnsmasq

Pre-configuration checklist:

Ensure NRPE is installed and working on the host.

Step 1: Update nrpe.cfg with following;

# vi /etc/nagios/nrpe.cfg

Add the line
command[check_dnsmasq]=/usr/lib64/nagios/plugins/check_procs -C dnsmasq -w 5 -c 10

Save and test the new nrpe command;
# /usr/lib64/nagios/plugins/check_procs -C dnsmasq -w 5 -c 10
PROCS OK: 1 process with command name 'dnsmasq'


Restart nrpe
#service nrpe restart

Step 2: Add this service to the Nagios host

# vi /etc/nagios/servers/server1.cfg

define service{
use generic-service
host_name lbserver2
service_description Dnsmasq
check_command check_nrpe!check_dnsmasq
}

Save and restart Nagios


These 2 step works for any services that the linux ps command can detect.

No comments:

Blog Archive