Page 1 of 1

check_fping rta artificially high

Posted: Wed Aug 31, 2016 10:19 am
by nozlaf
so i'm rolling out a new nagios install for a new network and had some strange issues with check_ping so I have switched to check_fping

running the check command manually

Code: Select all

Status Information:
FPING WARNING - 192.168.1.1 (loss=0%, rta=2.590000 ms)

Code: Select all

Performance Data:
loss=0%;20;30;0;100 rta=0.002590s;0.002000;0.005000;0.000000
Manually executed

Code: Select all

/usr/local/nagios/libexec/check_fping 192.168.1.1 -w 20,2% -c 30,5% -n 5
As nagios user

Code: Select all

FPING OK - 172.17.37.30 (loss=0%, rta=5.760000 ms)|loss=0%;2;5;0;100 rta=0.005760s;0.020000;0.030000;0.000000
as root

Code: Select all

FPING OK - 172.17.37.30 (loss=0%, rta=2.050000 ms)|loss=0%;2;5;0;100 rta=0.002050s;0.020000;0.030000;0.000000
so to me the time it takes the command to elevate to root is included in the time calculation which is in my mind not right and its consistent, I could do it all day and running as the nagios user from the shell will always yield a 5ms minimum response and running as root i get 1.5-2ms response


if this has alwasy been discussed I apologise its 1am here

Re: check_fping rta artificially high due

Posted: Wed Aug 31, 2016 3:36 pm
by ssax
Looks like you should be able to specify the -T option:

Code: Select all

 -T, --target-timeout=INTEGER
    Target timeout (ms) (default: fping's default for -t)
From the fping man page:

Code: Select all

       -t n Initial target timeout in milliseconds (default 500). In the default mode, this is the amount of time that fping waits for a response to its first request.  Successive timeouts are multiplied by the
            backoff factor specified with -B.  Note that this option has no effect looping or counting modes (-l, -c, or -C).

Re: check_fping rta artificially high due

Posted: Wed Aug 31, 2016 4:44 pm
by nozlaf
ssax wrote:Looks like you should be able to specify the -T option:
I don't think that has any relevance to this I am not having any issues with the timeout

Re: check_fping rta artificially high

Posted: Wed Aug 31, 2016 4:45 pm
by Box293
You should use check_icmp, its much faster. It's included with nagios plugins.

Re: check_fping rta artificially high

Posted: Wed Aug 31, 2016 4:47 pm
by nozlaf
in the light of day I am now even more confused about what i am seeing

when nagios executes check_fping and gets a 2.5ms response I get a warning but perfdata shows a result which should be OK

but when I execute it manually i am getting an OK (both as nagios and as root despite my complaint about the few ms discrepancy)

Re: check_fping rta artificially high

Posted: Wed Aug 31, 2016 4:53 pm
by Box293
I could be wrong, but your warning of 2% and critical of 5% is the source of your problem.

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.

You are defining 5 packets with -n 5

1 packets is 20% (100/5 = 20)

Hence 2% or 5% are too small of values. Perhaps you need 20% and 40% or 40% and 60%.

As for speed, use check_icmp.