check_ping version 2.2.1 Plugin Timeout (v2)

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
virmagnus
Posts: 1
Joined: Mon Mar 04, 2019 10:56 am

check_ping version 2.2.1 Plugin Timeout (v2)

Post by virmagnus »

Afternoon.

Im coming from https://support.nagios.com/forum/viewto ... =7&t=50429
Same version 2.2.1 and OS Debian 8 and 9

where the answer is:
This actually is fixing an issue with the previous version.

If you are sending 5 packets and waiting several seconds for each packet, a timeout of 10 should exit BEFORE it can continue to check all 5 times, which is what it is doing.
I dont fully approved of the answer, i do understand it but i think it should be changed. Let me explain.

If i take the pure ping as an example.

Code: Select all

time /bin/ping  -c 5  8.8.8.1 -W 10
PING 8.8.8.1 (8.8.8.1) 56(84) bytes of data.

--- 8.8.8.1 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4077ms


real	0m14.081s
user	0m0.000s
sys	0m0.000s
This is returning after 14seg, the 4 sec it took to do the pings and then the 10sec it took from the -W variable for timeout.

If i take the check_icmp as an example.
time /opt/wocu/embedded/nagios/libexec/check_icmp -H 8.8.8.1 -w 1000,100% -c 3000,100% -p 5 -t 10
CRITICAL - 8.8.8.1: rta nan, lost 100%|rta=0.000ms;1000.000;3000.000;0; pl=100%;100;100;; rtmax=0.000ms;;;; rtmin=0.000ms;;;;

real 0m10.004s
user 0m0.008s
sys 0m0.008s
It actually returns what is expected. 5 packets in a timeout of 10.

NOW, lets see the check_ping.

Code: Select all

time /opt/wocu/embedded/nagios/libexec/check_ping   -H 8.8.8.1 -w 1000,100% -c 3000,100% -p 5 -t 10
CRITICAL - Plugin timed out

real	0m21.003s
user	0m0.000s
sys	0m0.000s
This is where im lost.
1) Why this behavior ONLY applies when you're using more than 1 packet. If i use -p 1 this is the reply

Code: Select all

PING CRITICAL - Packet loss = 100%|rta=3000.000000ms;1000.000000;3000.000000;0.000000 pl=100%;100;100;0
2) Why is taking 11 seg more to reply after the initial pings. Shouldnt it take similar to the time /bin/ping takes?
3) Since this is a monitoring tool, shouldn't the timeout specify to the entire command not only to the package count, similar to what check_icmp does?

Any clarification is appreciated.
Regards.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_ping version 2.2.1 Plugin Timeout (v2)

Post by scottwilkerson »

This actually is fixing an issue with the previous version.

If you are sending 5 packets and waiting several seconds for each packet, a timeout of 10 should exit BEFORE it can continue to check all 5 times, which is what it is doing.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked