Availability report calculations
Andreas Ericsson
ae at op5.se
Sat Nov 27 21:56:15 CET 2004
Ahoy coders in general, and Ethan in particular.
avail.cgi doesn't try very hard to logically calculate actual
availability when things turn out to be indeterminate.
For the examples, we have the host h and its associated service s.
If h or s is 100% indeterminate (not enough archives backtracked to find
an actual log entry), but has a state other than PENDING it would follow
logically that the host has been in its current state the entire time
and it should thus be presented as such (this doesn't hold true if
Nagios goes up and down, but in those cases it's just plain ridiculus to
try to find correct timings for the host).
If h or s has partly indeterminate time the above obviously doesn't hold
true, since it can come from several different statuses. A possible
solution would be to log two entries each time a state-change occurs;
One entry with the timestamp of LAST_STATE_CHANGE and the status it had
then and one with the current state and the current time for timestamp.
This increases the volume of the logs slightly but in a decently healthy
network it shouldn't be so so much as to get unmanageable.
This way, one can also get rid of the then-redundant questions for
"assume initial states" and such in {trends,avail}.cgi which would make
life a lot easier for novice users.
To do things properly, one would ofcourse add logic to only log the
previous state if the log has been rotated since last state change. That
won't be too cumbersome and it will prevent a day of network turmoil to
log tons more than it has to.
Before I get down to business; Does this sound like a good idea? Would
such a patch (assuming it works properly) be committed?
Ethan: Hope to hear from you soon.
--
Andreas Ericsson andreas.ericsson at op5.se
OP5 AB www.op5.se
Lead Developer
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
More information about the Developers
mailing list