Page 1 of 1

Passing contact macro to external script

Posted: Wed Jan 31, 2018 7:55 pm
by mcitunixops
Hi,

Is there a way to pass a MACRO to an external script when using event handler?

I see the option "$CONTACTEMAIL:johndoe$". But is since we have assigned a contact for a service or host already, i want it to pass the value that is assigned already instead of me manually enter the user name and passing it to the external script. My command looks like this.

$USER1$/checkSpaceUsage.sh $SERVICESTATE$ $HOSTADDRESS$ $SERVICEDESC$ $CONTACTEMAIL:johndoe$

I am basically calling a command ( then runs a script) on the remote host to run some command and then send a email based on the service or host contact that is predefined already in nagios

Re: Passing contact macro to external script

Posted: Thu Feb 01, 2018 10:08 am
by npolovenko
Hi, @mcitunixops. You could try the $CONTACTEMAIL$ macro. I guess the command would look like this:

Code: Select all

$USER1$/checkSpaceUsage.sh $SERVICESTATE$ $HOSTADDRESS$ $SERVICEDESC$  $CONTACTEMAIL$
Let me know if that works.

https://assets.nagios.com/downloads/nag ... ntactemail