Nagios NRPE add Services to Monitor

Scenario / Question:

I followed the Tutorial on installing and configuring NRPE, but now I want to monitor more services on the remote server.

Solution / Answer:

You can add services by configuring nrpe.cfg on the remote host and adding a new service definition on the Nagios monitoring server.

Download Service Plugin on Remote Host Server

1. Download the plugin to folder /usr/local/nagios/libexec/

2. Change permissions on plugin to nagios

# cd /usr/local/nagios/libexec/
# chown nagios.nagios check_something
# chmod 775 check_something

3. Test the plugin works

# /usr/local/nagios/libexec/check_something

Edit nrpe.cfg File on Remote Host Server

Add a new command definition to the nrpe.cfg file on the remote host

# vi /usr/local/nagios/etc/nrpe.cfg

Add a new check_something command definition. (replace “check_something” with the actual plugin file name). Also you must define any arguments. Do a “check_something -h” for a plugins arguments.

command[check_something]=/usr/local/nagios/libexec/check_something -t 20 -c 30

Because we are running xinetd we do not need to restart the NRPE daemon. Otherwise you would have to restart the NRPE daemon for the changes to take effect.

Add Service Definition to Nagios Monitoring Server

On the monitoring host, you need to define a new service for check_something on the remote host. Add
the following entry to one of your object configuration files (linux-server-remote.cfg)
define service{
use                       generic-service
host_name                 remotehost
service_description       Check Something
check_command             check_nrpe!check_something
}

Next, verify your Nagios configuration files and restart Nagios.

# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

# service nagios restart
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
Fabio Milano has written 70 articles for us. Fabio Milano is a certified RHCE, MCP, and CFOI. He runs an IT consulting and services company called RDS Support inc. Website:http://www.rdssupport.com

1 Comment so far

  1. ricky on May 4th, 2010

    I tried it and its not working, i am getting ” (No output returned from plugin) ” from the nagios monitoring host. i checked everything and no error appearing on both remote and monitoring server

Leave a reply