Use of Variables in Thresholds
Posted: Thu Mar 27, 2014 10:27 am
While migrating from Core to XI I've come across an issue with some old services that are being used to check some temperature monitors. The error that I'm getting is:
And the host that I'm checking is:
It looks like the '$' character is being escaped when the command runs, but I'm not seeing a way to force it to read the variable. This check works fine in our existing install of Core, but I haven't been able to get it to roll into XI. Is there a configuration setting that I've managed to miss, or a special way that I need to escape the '$' in the variable name?
The service contains:COMMAND: /usr/local/nagios/libexec/check_snmp -H cstemp2.servers.local -p 161 -o 1.3.6.1.4.1.16174.1.1.3.3.3.7.0 -C public -P 1 -w \$_HOSTHUM3\$ -c \$_HOSTHUM3\$ -u %
OUTPUT: check_snmp: Invalid warning threshold - $_HOSTHUM3$
Code: Select all
###############################################################################
#
# Service configuration file
#
# Created by: Nagios QL Version 3.0.3
# Date: 2014-03-26 15:30:16
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios QL will overwite all manual settings during the next update
#
###############################################################################
define service {
host_name hvac-cs-2,hvac-cs-3
service_description Sensor 3 humidity
use sensor-service-template
check_command check_snmp!1.3.6.1.4.1.16174.1.1.3.3.3.7.0!$_HOSTHUM3$!$_HOSTHUM3$!%!!!!
register 1
}
###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################Code: Select all
###############################################################################
#
# Host configuration file
#
# Created by: Nagios QL Version 3.0.3
# Date: 2014-03-26 15:30:16
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios QL will overwite all manual settings during the next update
#
###############################################################################
define host {
host_name hvac-cs-2
use sensor-host
alias CS HVAC sensor bank 2
address cstemp2.servers.local
check_command check_ping!40!80!0!60!0!50!!
_hum3 0:60
_hum3h 60
_temp1h 80
_temp1l 40
_temp3h 80
_temp3l 40
register 1
}
###############################################################################
#
# Host configuration file
#
# END OF FILE
#
###############################################################################