Hi All,
Just trying something , is it possible to pass a macro argument from the hostdef to my actual check_plugin it works when passed from the service def. Basically need a way to pass the snmp com string for the host instead of defining within each service check def.
Any help would be appreciated.
CHeers
Arnab
Passing Macros from Host definition to check definition
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Passing Macros from Host definition to check definition
Yes.
For example, if you define in the host a variable
You can call that variable in all of the services with
http://nagios.sourceforge.net/docs/3_0/macros.html
http://nagios.sourceforge.net/docs/3_0/ ... tvars.html
For example, if you define in the host a variable
Code: Select all
_COMMUNITYSTRING privateCode: Select all
$_HOSTCOMMUNITYSTRING$http://nagios.sourceforge.net/docs/3_0/macros.html
http://nagios.sourceforge.net/docs/3_0/ ... tvars.html
Re: Passing Macros from Host definition to check definition
Thanks scott, however cant find a way to create a custom variable within nagiosxi /nagiosql CCM ? Sorry if I am being stupid/blind
Re: Passing Macros from Host definition to check definition
Found it sorry for being blind!!!!!!!!!!arghhh
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Passing Macros from Host definition to check definition
Just for completeness for others looking for the solution, you can add the variables to a host in XI at the following location
Configure -> CCM -> Hosts -> Modify -> Misc Settings -> Free variable definitions
Fill in the following
Variable name (_VARIABLE)
Variable value
Click Instert
SAVE
Apply Configuration
Configure -> CCM -> Hosts -> Modify -> Misc Settings -> Free variable definitions
Fill in the following
Variable name (_VARIABLE)
Variable value
Click Instert
SAVE
Apply Configuration