Page 1 of 1

Check_ping from one server to another

Posted: Tue Jun 12, 2018 2:54 am
by vusaravi
Hi

I would like to monitor the ping response from one machine to another machine via nagios.

Kindly let me know the possibilities.

Thanks in advance.

Re: Check_ping from one server to another

Posted: Tue Jun 12, 2018 6:57 am
by mcapra
The base Nagios plugins suite includes the check_ping plugin for this use case:
http://nagios-plugins.org/doc/man/check_ping.html

Here's a few examples of the plugin's usage:
https://linux.101hacks.com/unix/check-ping/

As far as how you turn that command execution into something Nagios can understand and regularly monitor, the "quickstart" documentation is a good place to start:
https://assets.nagios.com/downloads/nag ... start.html

And if it's a bit difficult to digest, feel free to ask questions or request examples on the forums.

Re: Check_ping from one server to another

Posted: Tue Jun 12, 2018 11:28 am
by tmcdonald
Thanks for the assist, @mcapra! OP, please let us know if you need further assistance.

Re: Check_ping from one server to another

Posted: Wed Jun 13, 2018 3:21 am
by vusaravi
Hi @mcapra

Thanks for your response.

I have already configured ping check to ping different hosts from my Nagios server.

but, my scenario is different, here it is.

I have 2 hosts A & B already added to Nagios server and check_ping is enabled from Nagios to Host A & B.

Now, i would like to check ping from host A to B i.e Nagios initiate check to host A and host A has to initiate check_ping to host B.

Let me know if this is possible, then how?

Re: Check_ping from one server to another

Posted: Wed Jun 13, 2018 7:01 am
by danjoh
I see two options here (both in shortened form, some extra options might be required):
a) check_by_ssh -H hostA -C '<nagios_plugin_path>/check_ping hostB'
b) check_nrpe -H hostA -c check_ping_hostB

Re: Check_ping from one server to another

Posted: Wed Jun 13, 2018 9:56 am
by scottwilkerson
Yes, install NRPE on host A
https://support.nagios.com/kb/article/n ... rpe-8.html

Then add a new command to the nrpe.cfg that pings host B

Call this with check_nrpe from nagios server