Page 1 of 1

Possible to add a custom variable to the alias line?

Posted: Fri Jun 28, 2013 11:16 am
by JimBass
I have custom variables in several of my hosts. I'm able to pass those to check commands, and that works wonderfully. What I'm looking to do is to get those custom variables added to the alias line, and I haven't found a way to do that.

As an example, I have the custom variable _mac_address defined in the host as:

Code: Select all

_mac_address	aa:bb:cc:11:22:33
And it passes that variable to a check command when its called as:

Code: Select all

command_line    $USER1$/check_example $_HOSTMAC_ADDRESS$ $ARG1$ $ARG2$
What I'm looking to have is something like:

Code: Select all

alias     A bunch of info that ends with MAC: $_HOSTMAC_ADDRESS$
It didn't work for me with $NAGIOS_HOSTMAC_ADDRESS$, $_HOSTMAC_ADDRESS$, nor $_mac_address$. Is it something I'm doing wrong in the name, or can custom variables not be passed in the alias line?

Re: Possible to add a custom variable to the alias line?

Posted: Fri Jun 28, 2013 1:24 pm
by abrist
JimBass wrote:Is it something I'm doing wrong in the name, or can custom variables not be passed in the alias line?
They cannot.

Re: Possible to add a custom variable to the alias line?

Posted: Fri Jun 28, 2013 4:34 pm
by JimBass
Ok, thank you for the clarification.