Indirect server checks via NRPE proxy
Indirect server checks via NRPE proxy
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
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
You can add the remote NRPE server via Configure > Monitoring Wizard > NRPE/Linux Monitoring wizard.
Re: Indirect server checks via NRPE proxy
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:
Restart xinetd:
On the Nagios XI server, you can run:
Yon can use more descriptive names to know what is what... 
Hope this helps.
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
...Code: Select all
service xinetd restartCode: Select all
./check_nrpe -H <remote box> -c check_ping_server1
./check_nrpe -H <remote box> -c check_ping_server2
...Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Indirect server checks via NRPE proxy
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
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
You could simply hook another command into nrpe like so:
Nagios server:
On the second NRPE server "the one that is between nagios and the proxied host" you would define a command as such:
NRPE installed on the final proxy server would then run:
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.
Nagios server:
Code: Select all
check_nrpe -H $proxyNRPEserver$ -c check_prox_server_loadCode: 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"Code: Select all
/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20Or 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.
Re: Indirect server checks via NRPE proxy
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
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
Re: Indirect server checks via NRPE proxy
Run the following commands and show us the output:
on the proxy server:
on the nagios server:
on the proxy server:
Code: Select all
find / -name nrpe
ps axuw | grep nrpe
netstat -at | grep nrpe
Code: Select all
./check_nrpe -H <proxy server IP>Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Indirect server checks via NRPE proxy
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
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
Re: Indirect server checks via NRPE proxy
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!
Re: Indirect server checks via NRPE proxy
Hi,
Thanks, forgotte and it works!
Great.
Thanks, forgotte and it works!
Great.