Hello, I am trying to create rules with “Inegrate nagios plugins”, I know I can use $HOSTADDRESS$ to get ip of host, is there other varibales like snmp credentials or any ? line $SNMP_CREDENTIAL$
The inline has some examples for available macros but not a full list:
inline help text for integrating nagios plugins
You can use monitoring macros here. The most important are:
$HOSTADDRESS$: The IP address of the host $HOSTNAME$: The name of the host $_HOSTTAGS$: List of host tags $_HOSTADDRESS_4$: The IPv4 address of the host $_HOSTADDRESS_6$: The IPv6 address of the host $_HOSTADDRESS_FAMILY$: The primary address family of the host
All custom attributes defined for the host are available as $_HOST[VARNAME]$. Replace [VARNAME] with the upper case name of your variable. For example, a host attribute named foo with the value bar would result in the macro $_HOSTFOO$ being replaced with bar
@andreas-doehler once shared a link to the full list of nagios macros:
https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/macrolist.html
Thank you, I fear I was not able to find snmp community macro
AFAIK you can use all all nagios macros.
https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/macrolist.html
Beside that you can create custom macros in ~/etc/nagios/resorce.cfg for things like communities or passwords.
Hint:
In a distributed setup create the file ~/local/etc/nagios/resource.cfg and link it to ~/etc/nagios/resource.cfg on each site and the master site.
With help of that you only need to maintain the custom macros on your master site and its updated with activate changes.
BR
MF
thank you , do you know any guide? example? doc ? to create this custom macros?
The “guide” is directly inside the file.
You have some entries that need to be there and also be an example for other macros.
Every macro is only a fixed string nothing else.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.