Passing contact macro to external script

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mcitunixops
Posts: 5
Joined: Wed Jan 27, 2016 11:28 am

Passing contact macro to external script

Post 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
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Passing contact macro to external script

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked