Possible to add a custom variable to the alias line?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
JimBass
Posts: 2
Joined: Fri Jun 28, 2013 10:47 am

Possible to add a custom variable to the alias line?

Post 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?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
JimBass
Posts: 2
Joined: Fri Jun 28, 2013 10:47 am

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

Post by JimBass »

Ok, thank you for the clarification.
Locked