Hi,

I am trying to find the amount of time service that state was not OK, i.e 
critical when the service recovered in event handler so that I can open a 
ticket stating that this service was unavaible for, say, 10 minutes. How can I 
achive this? Do I need to parse the logs or is there a better way of doing 
this? There are useful macros listed here: 
http://docs.icinga.org/latest/en/macrolist.html

Like
$SERVICEDURATION$: A string indicating the amount of time that the service has 
spent in its current state. Format is "XXh YYm ZZs",
            indicating hours, minutes and seconds.

$LASTSERVICEOK$: This is a timestamp in time_t format (seconds since the UNIX 
epoch) indicating the time at which the service was
            last detected as being in an OK state.

$LASTSERVICECRITICAL$: This is a timestamp in time_t format (seconds since the 
UNIX epoch) indicating the time at which the service was
            last detected as being in a CRITICAL state.

But the problem is when the service is recoverd, its state will be OK, so 
serviceduration will not give me the criticatal state duration. last service 
critical and last service ok will not be sufficient if lastserviceok will 
return the timestamp that service recovered because I will need the timestamp 
of the one before the last service OK.

Is there a way to calculate this duration with the macros listed in 
documentaion within the event handler without parsing logs or should I save the 
timestamps like when state goes to critacal save lastserviceok and
when service recovers get lastservicecritical and find the duration?

                                          
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
icinga-users mailing list
icinga-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/icinga-users

Reply via email to