Determining outage duration for service /host

James Ochs james.ochs at greennote.com
Fri May 23 04:12:35 CEST 2008


Hi all,

I'm trying to programmatically determine how long a host was in a  
problem state for our ticketing system by calculating the value when  
the recovery notice was sent.  It seems like this should be pretty  
straight forward, but it isn't ;) I've got the ticket system opening a  
ticket, storing the $SERVICEPROBLEMID$ and the start time.  I don't  
really see an efficient way to get the ticket number back to nagios (I  
am using RT if any has any suggestions), so the recovery notice is  
opening a second ticket which we then have to merge manually (recovery  
stores $LASTSERVICEPROBLEMID$ and thats how we x-ref the ticket.)

I thought I could just subtract $LASTSERVICEOK$ from  
$LASTSERVICESTATECHANGE$ to get the value, however BOTH macros get  
reset when the state changes to ok, and it would also have the problem  
of not counting the time a service was in warning and then  
transitioned to critical.  The docs seem to indicate  
$LASTSERVICECRITICAL$ is only since the last time the host was checked  
and ins't the total duration of the service being in a critical state,  
and it doesn't cover the other types of problems (namely warning and  
critical)

I see the macros for $LASTSERVICEPROBLEMID$ is there a way to get a  
timestamp for that event?

The only other thing I can think of is to use a database and write  
scripts to get the responses from RT that stores the problem id,  
time,  and ticket # in a table and then do lookups on that on a  
recovery event... it just seems a bit rube-goldberg and I feel like  
I'm missing something here ;)

Thanks,
James


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list