Page 1 of 1

Unique Identifier for Alert Messages

Posted: Wed Mar 04, 2015 2:02 pm
by brudnick
We are sending alert notifications to our Ticketing system via email so that it opens a ticket. I was wondering if there was a unique Identifier that could be use so that multiple tickets aren't created on the same incident. Is there something in the Macros that could be used for this. A number that does not change until the issue is brought back to a OK state.

Re: Unique Identifier for Alert Messages

Posted: Wed Mar 04, 2015 2:35 pm
by cmerchant
I think it would be the $serviceproblemid$ macro described in this doc:
http://nagios.sourceforge.net/docs/nagi ... eproblemid

Re: Unique Identifier for Alert Messages

Posted: Wed Mar 04, 2015 2:36 pm
by jolson
I believe that $SERVICEPROBLEMID$ is what you are looking for.
A globally unique number associated with the service's current problem state. Every time a service (or host) transitions from an OK or UP state to a problem state, a global problem ID number is incremented by one (1). This macro will be non-zero if the service is currently a non-OK state. State transitions between non-OK states (e.g. WARNING to CRITICAL) do not cause this problem id to increase. If the service is currently in an OK state, this macro will be set to zero (0). Combined with event handlers, this macro could be used to automatically open trouble tickets when services first enter a problem state.
http://nagios.sourceforge.net/docs/3_0/macrolist.html

Best,


Jesse

Re: Unique Identifier for Alert Messages

Posted: Wed Mar 04, 2015 3:11 pm
by brudnick
Thanks guys, I will test with these macros and report back if this is what I want.

Re: Unique Identifier for Alert Messages

Posted: Wed Mar 04, 2015 3:41 pm
by cmerchant
Great, let us know if that will work for you when you get a chance to try it out. Thanks.

Re: Unique Identifier for Alert Messages

Posted: Wed Mar 04, 2015 3:49 pm
by brudnick
So, the recovery message comes back with the ID of 0 for each one. What's up with that?

Re: Unique Identifier for Alert Messages

Posted: Wed Mar 04, 2015 4:35 pm
by abrist
jolson wrote: If the service is currently in an OK state, this macro will be set to zero (0).
It might consider the recovery to be an "OK" state . . . .