[Nagiosplug-help] Output of check_http not consistent
Ingo Lantschner
ingo.lists at vum.at
Wed May 23 08:26:06 CEST 2007
Am 23.05.2007 um 07:35 schrieb Thomas Guyot-Sionnest:
> On 23/05/07 12:49 AM, Olivier 'Babar' Raginel wrote:
>>
>> I think he's talking about some external tool, like nagiosgraph,
>> which
>> runs some code when some patterns are matched.
exactly
>>> From what I guess, he's referring about the default map file
>>> which comes
>> with nagiosgraph:
>> http://nagiosgraph.cvs.sourceforge.net/nagiosgraph/nagiosgraph/map?
>> revision=1.10&view=markup&pathrev=HEAD
>>
>> 170 # Service type: unix-www
>> 171 # ouput:HTTP OK HTTP/1.1 200 OK - 1456 bytes in 0.003 seconds
>> 172 /output:HTTP.*?(\d+) byte.*?([.0-9]+) sec/
>> 173 and push @s, [ http,
>> 174 [ bps, GAUGE, $1/$2 ] ];
>
> OUCH!
>
> Why being so complicated?? And more importantly, why using service
> output when everything is in the perfdata part? (and if it's not,
> it's a
> better idea to fix the plugin than write code that will very likely
> break in future release of Nagios-Plugins!).
The plugin is ok, it *does* output its perfdata-part. For probably
historical reasons the map-file from nagiosgraph does not use it and
it expects the output to start with "HTTP". As I have posted before,
this can be changed easily:
# Service type: unix-www
# output:HTTP OK HTTP/1.1 200 OK - 1456 bytes in 0.003 seconds
# or output:OK - HTTP/1.1 302 Found - 0.497 second response time
/output:.*HTTP.+\s*perfdata:time=(\d+\.\d*)s;.+size=(\d+)B.*/
and push @s, [ http,
[ resptime, GAUGE, $1 ],
[ size, GAUGE, $2 ],
];
The above definition seems to work, it recognizes also redirects
(which start for what ever reason with "OK" instead of "HTTP OK") and
uses the perfdata part.
> Also, the bps calculation there is not a very useful thing since it
> takes into account the response time. Many factor other than bandwidth
> can influence that value, so it's totally useless.
agree! So the "[ size, ...],"-line can be removed/commented out if
you do not need this data for something else.
>
> Here's what we do in a perfdata caching daemon we use (Old version at:
> http://control-alt-del.org/code/NPDaemon/ ; I guess now is a good time
> to post the updated version to NagiosExchange... Should be there
> soon.).
Interesting! Thanks for the hint. Just one question: What happens, if
the polling server gets down - does the perfdata get cached on the
Nagios host or is it lost until the polling server gets up again?
Thanks to all for your comments, Ingo
--
Ingo Lantschner
Vienna/Austria
Mob (+43-664) 143 84 18
More information about the Help
mailing list