Possible to get ping status from private ip machines

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Possible to get ping status from private ip machines

Post by mbellerue »

That makes sense. Your Nagios system is outside of the network where your target machine resides. There is a machine that has an external IP address, and has access to your target machine. So we put NCPA on the machine with the external IP address, put the check_ping plugin in NCPA's plugins directory, and then have Nagios use the check_ncpa.py plugin like this.

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H <external_IP> -t <secret_token> -M 'scripts/check_ping' -a '-H <internal_IP> -w <warning_threshold> -c <critical_threshold>'
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
epixelitsupport
Posts: 85
Joined: Fri Nov 08, 2019 2:40 am

Re: Possible to get ping status from private ip machines

Post by epixelitsupport »

I have updated as you said,
I have taken the check_ping plugin from Nagios plugins and put it in remote server ncpa plugin folder, after that i run the command from Nagios Server

Im getting an error UNKNOWN: An error occured connecting to API. (HTTP error: '500 INTERNAL SERVER ERROR')

https://prnt.sc/qigrrx
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Possible to get ping status from private ip machines

Post by mbellerue »

That looks like you're not able to connect to the NCPA API at all. If you put the external IP address into your web browser followed by :5693 do you get a page asking for your token?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
epixelitsupport
Posts: 85
Joined: Fri Nov 08, 2019 2:40 am

Re: Possible to get ping status from private ip machines

Post by epixelitsupport »

No that's not Working working for me, But other Plugins are working which is placed in ncpa/plugins folder

any other option?
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Possible to get ping status from private ip machines

Post by mbellerue »

Alright, let's make sure we have the correct plugin installed. Previously, I saw that check_ping.c was copied over to the server. This is actually the source code for the check_ping plugin. We need the binary copied over. You should have a file called /usr/local/nagios/libexec/check_ping with no .c at the end. That's the one you need to transfer.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
epixelitsupport
Posts: 85
Joined: Fri Nov 08, 2019 2:40 am

Re: Possible to get ping status from private ip machines

Post by epixelitsupport »

Your Right .. And I have changed the check_ping file as you said, but when I'm running those command in Nagios Server still it's not succeeding getting error like
https://prnt.sc/qj73ta

Thanks in advance for your support and help
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Possible to get ping status from private ip machines

Post by mbellerue »

Perfect! We're getting closer. That is the output for check_ping, so we know the request is making it across. I think all you should have to do is encapsulate the command line switches for check_ping in single quotes. So your command will look something like this.

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H <external_IP> -P 5693 -t <secret_token> -M 'plugins/check_ping' -a '-H <internal_IP> -w 70 -c 80'
The 70 and 80 for warning and crit may need a % after them. But let's try it like this first and see if it gets us what we need.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
epixelitsupport
Posts: 85
Joined: Fri Nov 08, 2019 2:40 am

Re: Possible to get ping status from private ip machines

Post by epixelitsupport »

Now its pinging and getting output for the following format , and what does this means in command -w 70,2% -c 80,5%' ?? please make me clear

https://prnt.sc/qk4cvx


So how should I write the service for reflecting the same in Nagios Dashboard GUI
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Possible to get ping status from private ip machines

Post by mbellerue »

Looks good! Here is the threshold information from check_ping.

Code: Select all

THRESHOLD is <rta>,<pl>% where <rta> is the round trip average travel
time (ms) which triggers a WARNING or CRITICAL state, and <pl> is the
percentage of packet loss to trigger an alarm state.
So 70 and 80 are pretty high numbers. That would be 70 and 80 seconds to make the trip. In the screenshot, your round trip was 0.22. So you might want a warning of 0.8 and a critical of 0.9. Then adjust as you get alerts. Or you can leave the round trip average up at 70 and 80, which will pretty much guarantee you will not get an alert unless there is packet loss.

Packet loss is the second part of the pair. Your warning is set to 2% packet loss, and critical is 5% packet loss. The check_ping plugin sends 5 pings to the specified host. So if you lose 1 packet, you have a 20% packet loss.

Does that help clear things up?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
epixelitsupport
Posts: 85
Joined: Fri Nov 08, 2019 2:40 am

Re: Possible to get ping status from private ip machines

Post by epixelitsupport »

Thats Cool, So how should i write the service command in cfg file in nagios server for this server?
in /usr/local/nagios/etc/servers/

for reflecting the same ping command?
Locked