[Nagiosplug-devel] check_icmp bugfixed and enhanced (was: check_ping: Could not interpret output from ping command)
Andreas Ericsson
ae at op5.se
Wed Jan 19 03:07:01 CET 2005
Joe Rhett wrote:
> On Sat, Nov 27, 2004 at 09:21:09PM +0100, Andreas Ericsson wrote:
>
>>Yes. Sometime (soon, hopefully) the check_icmp plugin will be included
>>in the standard distribution, and the check_ping plugin will be gotten
>>rid of.
>
>
> Hopefully sometime after it works on operating systems other than Linux?
>
> ./check_icmp -H bowmore
> OK - bowmore: rta 0.79 ms, lost 0%|rta=0.79ms;200;500;; pl=0%;60;80;;
>
> ./check_icmp -H bowmore -w 3000,80% -c 5000,100%
> check_icmp: select() in recvfrom_wto : Invalid argument
>
> ./check_icmp -H bowmore -c 3000,100%
> check_icmp: select() in recvfrom_wto : Invalid argument
>
What system was that on, and what version of check_icmp?
I've started (and nearly finished) a complete rewrite of the check_icmp
plugin (called check_rta for the time being), which won't ever call
select with a zero timeout, which could happen before.
It's available at http://oss.op5.se/nagios
Download check_rta.c and compile with
gcc check_rta.c -o check_rta -O2
I'll package it properly later, but that's awaiting some testing and
code completion.
New features;
Faster DOWN determination. It can properly interpret icmp messages from
other hosts (routers usually) and foresee when a host will be down
definitely. Try ./check_rta 193.201.96.145 (which doesn't exist).
Faster UP determination. If a host responds promptly to a ping packet
and has no packets in queue, check_rta will pelt it with packets as fast
as it can. Sending of pings won't be delayed as long as the host hasn't
got any packets in en route, but it will wait the packet interval (-i
flag) before sending a new if any previous packet hasn't either come
back or generated an icmp error somewhere along the route.
Sourcequench backoff. Intervals are increased when routers/hosts
advertise they are loosing packets due to high send ratio (currently
hardcoded backoff factor, but I'll fix that later).
check_host mode. ln -s check_rta check_host. check_host will ping all
the resolved IP-addresses for the host (if fed a DNS name, or all given
IP-addresses otherwise) and will return OK on any packet received what
so ever, making it superfast for host checks. This overrides -w and -c.
perfparse output for multiple hosts/addresses.
Bug fixes;
RTA precision is now more accurate. No u_sleep() calls are made, which
would obfuscate rta values in check_icmp, causing them to be higher for
a higher packet interval (since the program sometimes was in u_sleep()
when packets came in).
Code is cleaner and compiles without warnings with stricter rules. It
should never try to do anything that is forbidden on any system (like
call select(2) with bad args) and tries hard to only use portable
functions and system calls (no asprintf() or other gnu extensions here).
Developers, c-coders; Please download a copy and try it out. There is no
documentation what so ever yet (not even --help), but the options are
easy enough to understand in the getopt() switch (w:c:H:t:v do the usual
stuff, i sets packet interval and n sets number of packets).
The get_timevar() and get_timevaldiff() functions might be useful in
utils.c, although they deal in micro-seconds.
Non-coding users; It is not tested very much but should work perfectly
well (assuming you understand the arguments).
--
Andreas Ericsson andreas.ericsson at op5.se
OP5 AB www.op5.se
Lead Developer
More information about the Devel
mailing list