17 December, 2014

Performing check_uptime in Nagios through NRPE

Remote host side:
First make sure that the check_uptime plugin is present on the remote host, which is usually located in:
/usr/local/nagios/libexec/

Also you have to configure the remote host to accept the check_host command received.
Edit the file /usr/local/nagios/etc/nrpe.cfg and add the following line after "The following examples use hardcoded command arguments":
command[check_uptime]=/usr/local/nagios/libexec/check_uptime
So that upon receiving the command "check_uptime" plugin check_uptime in libexec is executed.


Nagios server side:
The check_uptime query can only be performed through NRPE plugin. Service "Uptime" executes plugin check_nrpe with an argument check_uptime. The actual check_uptime plugin is executed on the remote host- that is why the check_uptime plugin has to be present on the remote host.

Add following code inside /usr/local/nagios/etc/services.cfg :
define service{
        use                     generic-service
        host_name               remhost1,remhost2,remhost3
        service_description     Uptime
        check_command           check_nrpe!check_uptime
        }

No comments:

Post a Comment