Run nrpe service on linux host

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
kooshals
Posts: 6
Joined: Mon Sep 15, 2014 6:21 am

Run nrpe service on linux host

Post by kooshals »

Hi

I have couple of linux host to be monitored.
I have installed NagiosXi on the monitoring server and same on linux host as well.

Installation is done properly.

I have nagios installed under /usr/local/nagios.

I just edited my nrpe.cfg file to change allowed_host parameter. Now I need to restart nrpe service.
But service nrpe restart doesnt work saying this command is not found.

HOW TO RUN THIS SERVICE SUCCESFULLY ??

[root@XYZ bin]# ./nrpe

NRPE - Nagios Remote Plugin Executor
Copyright (c) 1999-2008 Ethan Galstad ([email protected])
Version: 2.14
Last Modified: 12-21-2012
License: GPL v2 with exemptions (-l for more info)
SSL/TLS Available: Anonymous DH Mode, OpenSSL 0.9.6 or higher required
TCP Wrappers Available

***************************************************************
** POSSIBLE SECURITY RISK - COMMAND ARGUMENTS ARE SUPPORTED! **
** Read the NRPE SECURITY file for more information **
***************************************************************

Usage: nrpe [-n] -c <config_file> <mode>

Options:
-n = Do not use SSL
<config_file> = Name of config file to use
<mode> = One of the following operating modes:
-i = Run as a service under inetd or xinetd
-d = Run as a standalone daemon
-d -s = Run as a subsystem under AIX

Notes:
This program is designed to process requests from the check_nrpe
plugin on the host(s) running Nagios. It can run as a service
under inetd or xinetd (read the docs for info on this), or as a
standalone daemon. Once a request is received from an authorized
host, NRPE will execute the command/plugin (as defined in the
config file) and return the plugin output and return code to the
check_nrpe plugin.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Run nrpe service on linux host

Post by slansing »

So hold on, you have a main XI server, correct? Then you installed a second XI server on a remote linux host you wish to monitor? You do not need to install Nagios XI, or Nagios Core on a remote host to monitor it, you would use something like NRPE/NCPA for active checks, or use the passive alternatives. Can we just clarify my questions above before going further? Chances are, if you only installed NRPE, and you followed the documents linked in the XI wizard for it, you will want to use xinetd to restart the service:

Code: Select all

service xinetd restart
You will also need to add your allowed hosts in:

Code: Select all

/etc/xinetd.d/nrpe
kooshals
Posts: 6
Joined: Mon Sep 15, 2014 6:21 am

Re: Run nrpe service on linux host

Post by kooshals »

Hi

I have a centralized server running NagiosXI.
Then I have other linux hosts which I need to monitor from this centralized monitoring server.

Now through NagiosXI UI, i have run monitoring wizard and added these linux hosts to be monitored in the UI.
It also gave me nrpe zip file which I downloaded via UI and ran ./full_install on linux hosts to be monitored.

In the end it gave me option to add allowed_hosts IP. Which obviously is centralized monitoring server.
Which I did properly. Now for one of the server I did not add this IP during ./full_install run.

SO I manually edited xinetd/nrpe file and added the Monitoring server IP.

So now I need to restart nrpe service.

So now i Go to /usr/local/nagios/bin and run nrpe. HELP ME OUT..!!!!

[xyz@12345 bin]$ ./nrpe restart

NRPE - Nagios Remote Plugin Executor
Copyright (c) 1999-2008 Ethan Galstad ([email protected])
Version: 2.14
Last Modified: 12-21-2012
License: GPL v2 with exemptions (-l for more info)
SSL/TLS Available: Anonymous DH Mode, OpenSSL 0.9.6 or higher required
TCP Wrappers Available

***************************************************************
** POSSIBLE SECURITY RISK - COMMAND ARGUMENTS ARE SUPPORTED! **
** Read the NRPE SECURITY file for more information **
***************************************************************

Usage: nrpe [-n] -c <config_file> <mode>

Options:
-n = Do not use SSL
<config_file> = Name of config file to use
<mode> = One of the following operating modes:
-i = Run as a service under inetd or xinetd
-d = Run as a standalone daemon
-d -s = Run as a subsystem under AIX

Notes:
This program is designed to process requests from the check_nrpe
plugin on the host(s) running Nagios. It can run as a service
under inetd or xinetd (read the docs for info on this), or as a
standalone daemon. Once a request is received from an authorized
host, NRPE will execute the command/plugin (as defined in the
config file) and return the plugin output and return code to the
check_nrpe plugin.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Run nrpe service on linux host

Post by tmcdonald »

As slansing pointed out in his last post, you have NRPE running as a service under the xinetd service, which means you need to run:

Code: Select all

service xinetd restart
for the changes to take effect.

Can you show us the line in your xinetd NRPE config where you are allowing the Nagios XI IP?
Former Nagios employee
kooshals
Posts: 6
Joined: Mon Sep 15, 2014 6:21 am

Re: Run nrpe service on linux host

Post by kooshals »

Here is the output.

only_from = 127.0.0.1,1.2.3.4
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Run nrpe service on linux host

Post by tmcdonald »

Change the comma to a space and restart xinetd.
Former Nagios employee
kooshals
Posts: 6
Joined: Mon Sep 15, 2014 6:21 am

Re: Run nrpe service on linux host

Post by kooshals »

Thank You so much. It was the small comma I wasted my time on.
Thanks for the help.
Locked