Re: [Nagios-devel] Error in documentation re: custom object vars

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
Guest

Re: [Nagios-devel] Error in documentation re: custom object vars

Post by Guest »

I thought it would be good to allow custom object macros that don't have
an underscore between HOST/SERVICE and the variable name. For example

_ID = $_HOSTID$ or $_SERVICEID$

That brings the naming convention more in line with the standard macros.
The only difference is the leading undersocre.

You can always force an underscore between the HOST/SERVICE identifier
by using two underscores in the custom variable name. Exmaple:

__ID = $_HOST_ID$ or $_SERVICE_ID$


Hendrik Bäcker wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi Ethan,
> hi list,
>
> I have a small veto...
>
> Wolfgang Barth has opened this topic a few weeks ago... we think that it
> is more read friendly to have:
>
> $_HOST_MAC_ADDRESS$
>
> instead of
>
> $_HOSTMAC_ADDRESS$
>
> The fact that this custom variable is dependent on the 'host' definition
> would be easier to see.
>
> In that case you have an underscore before and behind the dependent from
> as a field seperator.
>
> $_HOST_MAC_ADDRESS$ from host definition _MAC_ADDRESS
> $_SERVICE_SOME_WHAT$ from service def _SOME_WHAT.
>
> Or is the additional underscore getting things in trouble?!
>
> Regards,
> Hendrik
>
> Ethan Galstad schrieb:
>> Niklas Nordebo wrote:
>>> According to http://nagios.sourceforge.net/docs/3_0/macros.html the
>>> custom host variable _MAC_ADDRESS would be available in a macro
>>> called $_HOST_MAC_ADDRESS$, which is incorrect. As
>>> http://nagios.sourceforge.net/docs/3_0/ ... tvars.html states
>>> it will be available as $_HOSTMAC_ADDRESS$ without the extra
>>> underscore.
>>>
>> Thanks - I'll get this updated shortly.
>>
>>


Ethan Galstad,
Nagios Developer
---
Email: [email protected]
Website: http://www.nagios.org





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked