Page 1 of 1

Re: [Nagios-devel] passive service freshness with nagios restart

Posted: Thu Jun 21, 2007 7:51 am
by Guest

On 19 Jun 2007, at 23:11, Ton Voon wrote:

> Rather than another configuration parameter, can I propose this?
>
> * If check_freshness_interval is defined, Nagios will use that
> value and only check against the last_check_time. No "funny" stuff is
> calculated
> * If check_freshness_interval is not defined, then Nagios does a
> calculation on the best value - currently it does things like using
> check_interval, add latency time, lowers it if in a soft state. I'll
> rework my change so that it raises the time if startup time is more
> recent than last_check_time
>

I've made a patch for this now, which includes documentation updates
and tests.

Yes, tests! I've managed to integrate libtap (which Nagios Plugins
use for testing their C library functions) so now the freshness
threshold value is tested. While setting up the infrastructure was
hard, I've found the tests to be immensely helpful - I've refactored
the logic and found other cases were not necessary. I even found a
bug in my first attempt where the closing bracket for an if statement
was in the wrong place.

What was really helpful was working from the abstract (code) to the
specifics (tests) - I think I gained a better understanding of what
the freshness threshold should be.

Unfortunately, I had to create a separate freshness.c file in base/
because using one of the other files brought in too many un-resolved
symbols. Having a separate file made it much cleaner.

I've blogged about it here: http://altinity.blogs.com/dotorg/2007/06/
tweaking-the-fr.html

Ethan, if you can incorporate this into core Nagios, I'll try and
make sure that any new patches from Altinity will have accompanying
test code.

(There's a limitation in that you may need to export LD_LIBRARY_PATH=/
usr/local/lib to get the libtap library recognised. Nagios Plugins
get round this because we use libtool to link at compile time, but I
thought that's too much to add to the core Nagios code at the moment.)

Ton

http://www.altinity.com
T: +44 (0)870 787 9243
F: +44 (0)845 280 1725
Skype: tonvoon








This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]