Page 1 of 1

Service notification command executed before macros updated?

Posted: Fri Dec 14, 2018 4:52 pm
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.

Re: Service notification command executed before macros upda

Posted: Fri Dec 14, 2018 5:41 pm
by johndorm
Nevermind.

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

Thanks!

Re: Service notification command executed before macros upda

Posted: Mon Dec 17, 2018 12:30 pm
by npolovenko
Hi, @johndorm. Thanks for the update! Are we good to lock this thread as resolved?

Re: Service notification command executed before macros upda

Posted: Tue Dec 18, 2018 11:03 am
by johndorm
Absolutely. Thanks.

Re: Service notification command executed before macros upda

Posted: Tue Dec 18, 2018 11:05 am
by benjaminsmith
Closing. Thank you for using the Nagios Support Forum.