Indirect server checks via NRPE proxy

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Narie
Posts: 57
Joined: Thu Apr 18, 2013 9:36 am

Indirect server checks via NRPE proxy

Post by Narie »

Hi,
I've got an XI installation and a lot of servers behind a Firewall. To limit inbound traffic (and ACE's) I want to use a proxy. So Xi -> NRPE host -> NRPE server. I can do a local check on the Xi server (check_nrpe -H [NRPE host] -c check_ping -H [NRPE server]. This works but how can I add a new NRPE server from the Nagios Xi "Run the Monitoring Wizard"?

Regards,

Narie
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Indirect server checks via NRPE proxy

Post by slansing »

You can add the remote NRPE server via Configure > Monitoring Wizard > NRPE/Linux Monitoring wizard.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Indirect server checks via NRPE proxy

Post by lmiltchev »

If you just want to be able to ping several remote machines "indirectly", you can set up different commands on the remote machine that you use with NRPE, for example:

Code: Select all

command[check_ping_server1]=/usr/local/nagios/libexec/check_ping -H <server1 ip> -w 3000.0,80% -c 5000.0,100% -p 5
command[check_ping_server2]=/usr/local/nagios/libexec/check_ping -H <server2 ip> -w 3000.0,80% -c 5000.0,100% -p 5
...
Restart xinetd:

Code: Select all

service xinetd restart
On the Nagios XI server, you can run:

Code: Select all

./check_nrpe -H <remote box> -c check_ping_server1
./check_nrpe -H <remote box> -c check_ping_server2
...
Yon can use more descriptive names to know what is what... :)

Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Narie
Posts: 57
Joined: Thu Apr 18, 2013 9:36 am

Re: Indirect server checks via NRPE proxy

Post by Narie »

Hi,

Thanks for the support so far.
I have the linux "proxy" host already added. The Xi server can monitor this machine and it;s show it's (default) services via NRPE (users, diskusage, load, total processes) and if it's up via ICMP. Step 2 is adding a new server wich is only reachable by the proxy. It has to bee monitored for at least the services above and it the future probably more. I can image I have to make new commands but how do I add this server in the interface?

Regards,

Matthew
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Indirect server checks via NRPE proxy

Post by slansing »

You could simply hook another command into nrpe like so:

Nagios server:

Code: Select all

check_nrpe -H $proxyNRPEserver$ -c check_prox_server_load
On the second NRPE server "the one that is between nagios and the proxied host" you would define a command as such:

Code: Select all

command[check_proxy_server_load]=/usr/local/nagios/libexec/check_nrpe -H proxy.server.address.here -c check_load -a "-w 15,10,5 -c 30,25,0"
NRPE installed on the final proxy server would then run:

Code: Select all

/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20

Or something based on the above should work. The issue you will see is that your host in nagios will have to be pointed at the address of the proxy NRPE server, you won't have the actual proxy server.
Narie
Posts: 57
Joined: Thu Apr 18, 2013 9:36 am

Re: Indirect server checks via NRPE proxy

Post by Narie »

Hi,
I suppose that difining the command on the proxy server means adding this command in the /etc.nagios/nrpe.cfg? It's a bit confusing now, don't I have to configure these commands on the end node to (nrpe.cfg). The second server (nrpe proxy) only had NRPE and plugins installed.

I added this line in the nrpe.cfg if the proxy
command[check_ping_server1]=/usr/local/nagios/libexec/check_ping -H <server1 ip> -w 3000.0,80% -c 5000.0,100% -p 5

I can run the command /usr/local/nagios/libexec/check_ping -H <server1 ip> -w 3000.0,80% -c 5000.0,100% -p 5 and receive response.

When I run ./check_nrpe -H {Ip proxy] -c check_ping_server1 from the XI server from the commandline I receive a NRPE: Unable to read output


Regards,

Matthew
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Indirect server checks via NRPE proxy

Post by lmiltchev »

Run the following commands and show us the output:

on the proxy server:

Code: Select all

find / -name nrpe
ps axuw | grep nrpe
netstat -at | grep nrpe
on the nagios server:

Code: Select all

./check_nrpe -H <proxy server IP>
Be sure to check out our Knowledgebase for helpful articles and solutions!
Narie
Posts: 57
Joined: Thu Apr 18, 2013 9:36 am

Re: Indirect server checks via NRPE proxy

Post by Narie »

Hi,

Proxy:
find / -name nrpe
/usr/sbin/nrpe
ps axuw | grep nrpe
nagios 2903 0.0 0.2 41280 2248 ? Ss Dec09 0:07 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
netstat -at | grep nrpe
tcp 0 0 *:nrpe *:* LISTEN

Xi
./check_nrpe -H 10.200.12.5
NRPE v2.12

I also installed the NRPE on the server which hasto be hosted.

Matthew
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Indirect server checks via NRPE proxy

Post by lmiltchev »

Have you restarted nrpe after you made the changes in the nrpe.cfg on the proxy server?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Narie
Posts: 57
Joined: Thu Apr 18, 2013 9:36 am

Re: Indirect server checks via NRPE proxy

Post by Narie »

Hi,

Thanks, forgotte and it works!
Great.
Locked