Service notification command executed before macros updated?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
johndorm
Posts: 11
Joined: Tue Oct 31, 2017 2:44 pm

Service notification command executed before macros updated?

Post by johndorm »

I have a service notification command for a contact that passes $SERVICEDOWNTIME$ to my script.

$SERVICEDOWNTIME$ is supposed to be
A number indicating the current "downtime depth" for the service. If this service is currently in a period of scheduled downtime, the value will be greater than zero. If the service is not currently in a period of downtime, this value will be zero.
I also have notifications enabled for scheduled downtime, however, when my script executes for the scheduled downtime event, $SERVICEDOWNTIME$ gets passed with a value of 0 still.

It's unclear to me how I would get this service notification command to delay long enough for the macro to be updated. Maybe insert another service notification command (like /bin/sleep 5) prior to my script? Do multiple commands wait for the previous one to complete before executing for notification commands?

Thanks in advance.
johndorm
Posts: 11
Joined: Tue Oct 31, 2017 2:44 pm

Re: Service notification command executed before macros upda

Post by johndorm »

Nevermind.

I found a macro that will work....$NOTIFICATIONTYPE$ will give me a sufficient value on downtime start/stop/cancel.

Thanks!
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Service notification command executed before macros upda

Post by npolovenko »

Hi, @johndorm. Thanks for the update! Are we good to lock this thread as resolved?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
johndorm
Posts: 11
Joined: Tue Oct 31, 2017 2:44 pm

Re: Service notification command executed before macros upda

Post by johndorm »

Absolutely. Thanks.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Service notification command executed before macros upda

Post by benjaminsmith »

Closing. Thank you for using the Nagios Support Forum.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked