[Feature Request] enable check_ping to log ip address

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.
Locked
yinchuan
Posts: 3
Joined: Wed May 07, 2014 8:51 pm

[Feature Request] enable check_ping to log ip address

Post by yinchuan »

Please add a option to check_ping to log the ip address.
When I check a host points to multi-ips, I need to know which ip address can't be reached when Nagios report the host is down.
So, log the ip address got from the DNS in the result will be very helpful.
I googled and can't find anything to do this.

Thanks!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: [Feature Request] enable check_ping to log ip address

Post by abrist »

I will take a look. What is the use case for this? A service cluster? A load balancer? Have you considered creating multiple checks - one to ping each ip, or are these ips dynamic?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
yinchuan
Posts: 3
Joined: Wed May 07, 2014 8:51 pm

Re: [Feature Request] enable check_ping to log ip address

Post by yinchuan »

abrist wrote:I will take a look. What is the use case for this? A service cluster? A load balancer? Have you considered creating multiple checks - one to ping each ip, or are these ips dynamic?
Thanks for reply.
In my case,I montior a external server owned by third party providing a web service, and the host points to many IPs (like 4). I have not to know which IPs they will use, so I can't create multiple checks.
Sometimes one or two of the IPs can't be reached cause the server is down or the network device deny ICMP packet, this will cause Nagios report 'the host is down'. When this happen, I need to know which IP the Nagios use to ping. This is very helpful for debug.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: [Feature Request] enable check_ping to log ip address

Post by tmcdonald »

Are you talking about logging to a file or about displaying this in the status info? Displaying this in the status info would be the preferred option, as we try not to have plugins create or modify files generally. Would this work for you?
Former Nagios employee
yinchuan
Posts: 3
Joined: Wed May 07, 2014 8:51 pm

Re: [Feature Request] enable check_ping to log ip address

Post by yinchuan »

> Displaying this in the status info would be the preferred option
Yes, This is just what I need, and a perfect option. Thank you!
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: [Feature Request] enable check_ping to log ip address

Post by slansing »

We can see if the plugin dev's want to add this in, you could also post on the Github repo regarding this:

https://github.com/nagios-plugins/nagios-plugins

Though, there are some plugins out there that may already do this for you. I'd suggest checking the nagios exchange with keywords such as "ping multiple address." I found this one, that may or may not work. It's worth a look!:

http://exchange.nagios.org/directory/Pl ... dr/details

There are more alternatives on the exchange as well.
Locked