Host Template Variable Inheritance
Posted: Wed Sep 30, 2015 1:15 pm
Hi, I'm following the recommended best practice method of distributing snmp community strings through a host template.
But I'm not getting the results as expected. The community string is not found by a service command.
I'm using the reference pages "Understanding Macros and How they work", "Standard Macros in Nagios" and "Object Inheritance"
Nagios XI 5R1.0 but had the same issue on r2014
In this scenario the snmp string is "12345" which Server1 should be inheriting from template Corp_Community.
It is called in Service TZ -5 as $_HOSTcommunity$. -Which does work if I set the variable on the Server1 host directly.
I appreciate your assistance in troubleshooting this issue.
But I'm not getting the results as expected. The community string is not found by a service command.
I'm using the reference pages "Understanding Macros and How they work", "Standard Macros in Nagios" and "Object Inheritance"
Nagios XI 5R1.0 but had the same issue on r2014
In this scenario the snmp string is "12345" which Server1 should be inheriting from template Corp_Community.
It is called in Service TZ -5 as $_HOSTcommunity$. -Which does work if I set the variable on the Server1 host directly.
I appreciate your assistance in troubleshooting this issue.
Code: Select all
define host {
host_name Server1
use Corp_Community
address Server1.corporation.com
max_check_attempts 1
check_interval 5
retry_interval 1
register 1
}
[b]define host[/b] {
name Corp_Community
_community 12345
register 0
}
define service {
host_name Server1
service_description TZ -5
servicegroups NTP Check
check_command Check_snmp_time!20!"-240"!$_HOSTcommunity$!!!!!
max_check_attempts 1
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
register 1
}