Page 1 of 1

Unique ID for a Service

Posted: Wed Jul 15, 2015 1:32 am
by rajasegar
Does Nagios have any macros that uniquely identifies a service for a particular host?

Eg:
Host A - CPU Check ID = 100
Host B - CPU Check ID = 200
Host B - Mem Check ID = 500
etc

We need to automate creating of ticket in ITSM software and we are still figuring out what is the best way to avoid creating duplicate tickets for the same event.
Right now looking into these macros below.

$HOSTEVENTID$
$LASTHOSTEVENTID$
$HOSTPROBLEMID$
$LASTHOSTPROBLEMID$
$SERVICEEVENTID$
$LASTSERVICEEVENTID$
$SERVICEPROBLEMID$
$LASTSERVICEPROBLEMID$
$HOSTNOTIFICATIONID$
$SERVICENOTIFICATIONNUMBER$
$SERVICENOTIFICATIONID$

Thanks

Re: Unique ID for a Service

Posted: Wed Jul 15, 2015 3:38 pm
by tmcdonald
How are you generating these tickets? I don't know of anything that adds a unique id directly on the service, but you could potentially MD5 the string "service_description:host_name" and get a unique ID to use.

Re: Unique ID for a Service

Posted: Wed Jul 15, 2015 6:35 pm
by rajasegar
tmcdonald wrote:How are you generating these tickets? I don't know of anything that adds a unique id directly on the service, but you could potentially MD5 the string "service_description:host_name" and get a unique ID to use.
The interface is via email.
That's a good idea on the MD5 usage, we will try it.

Re: Unique ID for a Service

Posted: Thu Jul 16, 2015 9:02 am
by ssax
Great, let us know how it goes and if you have any additional questions.