How to check ICMP/HTTP from remote NRPE

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

How to check ICMP/HTTP from remote NRPE

Post by dlukinski »

Please advice how to use remote NRPE client (Linux agent) to check on hosts availability via ICMP/HTTP or any other plugins?

modGearman would not work in this case, so we need to know how remote NRPE client could be used as a relay to report on host being inaccessible from the location that NRPE/Linux client resides?
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: How to check ICMP/HTTP from remote NRPE

Post by avandemore »

Does this document help? It walks through installation and setup with some examples:

NRPE Documentation
Previous Nagios employee
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Re: How to check ICMP/HTTP from remote NRPE

Post by dlukinski »

avandemore wrote:Does this document help? It walks through installation and setup with some examples:

NRPE Documentation

This is not what we need

Essentially we want to know how to configure in XI and run check_http (example) on remote host, monitoring another remote host, so that when that other remote host is down or not accessible, we would get an alert
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: How to check ICMP/HTTP from remote NRPE

Post by avandemore »

Assume the following:

XI runs on HostA
There is some NRPE intermediary HostB
Target service(check_http) is HostC

If HostC goes down, HostA will send an alert about HostC with HostB relaying the required info.

Does this describe what you are asking? If not, can you correct it so it explicitly details what you want?
Previous Nagios employee
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Re: How to check ICMP/HTTP from remote NRPE

Post by dlukinski »

avandemore wrote:Assume the following:

XI runs on HostA
There is some NRPE intermediary HostB
Target service(check_http) is HostC

If HostC goes down, HostA will send an alert about HostC with HostB relaying the required info.

Does this describe what you are asking? If not, can you correct it so it explicitly details what you want?
Yes

Host A - Nagios XI

Host B - some remote host running checks based of standard Linux Agent plugins (check_http)

Host C - host under monitoring by those checks
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: How to check ICMP/HTTP from remote NRPE

Post by dwhitfield »

We're running up against our EOD here, so I don't have time to rewrite this for HTTP, but I think this should work as an example:

Here is a generic command that I will use as an example:

Code: Select all

command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
So Host(C) will have this in their nrpe.cfg file.



On Host(B) you will have this in the nrpe.cfg file:

Code: Select all

command[check_remote]=/usr/local/nagios/libexec/check_nrpe -H $ARG1$ -t 30 -c $ARG2$



Then from XI you would execute the following command:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H host_B_address -t 30 -c check_remote host_C_address check_load


XI will request Host(B) to execute a check which in turn requests Host(C) to execute the check check_load
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: How to check ICMP/HTTP from remote NRPE

Post by mcapra »

You could define the following command in /usr/local/nagios/etc/nrpe.cfg:

Code: Select all

command[check_http]=/usr/local/nagios/libexec/check_http $ARG1$
Restart the nrpe/xinetd service, then execute checks from Nagios XI like so (where 192.168.67.97 is the NRPE intermediary):

Code: Select all

[root@localhost ~]# /usr/local/nagios/libexec/check_nrpe -H 192.168.67.97 -c check_http -a "-H www.google.com"
HTTP OK: HTTP/1.1 200 OK - 10922 bytes in 0.137 second response time |time=0.136902s;;;0.000000 size=10922B;;;0
Former Nagios employee
https://www.mcapra.com/
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Re: How to check ICMP/HTTP from remote NRPE

Post by dlukinski »

mcapra wrote:You could define the following command in /usr/local/nagios/etc/nrpe.cfg:

Code: Select all

command[check_http]=/usr/local/nagios/libexec/check_http $ARG1$
Restart the nrpe/xinetd service, then execute checks from Nagios XI like so (where 192.168.67.97 is the NRPE intermediary):

Code: Select all

[root@localhost ~]# /usr/local/nagios/libexec/check_nrpe -H 192.168.67.97 -c check_http -a "-H www.google.com"
HTTP OK: HTTP/1.1 200 OK - 10922 bytes in 0.137 second response time |time=0.136902s;;;0.000000 size=10922B;;;0
Thank you, please close this support thread
Locked