Use of $HOSTADDRESS
Posted: Wed Dec 23, 2015 9:08 am
I am curious when someone uses:
command_line $USER1$/check_snmp_printer -H $HOSTADDRESS
in a command definition, how $HOSTADDRESS is resolved? Being on a unix box I know things do not always resolve physical names on the network.
So in my host definition am I supposed to enter the fully qualified domain name there? I have the IP listed as well as "address" but doesn't seem to be working right. Thought that field was just a display name not necessarily the actual machine name.
Here is what I'm doing.
In the printer.cfg:
In the command.cfg:
Output I get is:
This works manually so thinking the hostaddress isn't being passed as it seems to be using the -C as the device name.
JR
command_line $USER1$/check_snmp_printer -H $HOSTADDRESS
in a command definition, how $HOSTADDRESS is resolved? Being on a unix box I know things do not always resolve physical names on the network.
So in my host definition am I supposed to enter the fully qualified domain name there? I have the IP listed as well as "address" but doesn't seem to be working right. Thought that field was just a display name not necessarily the actual machine name.
Here is what I'm doing.
In the printer.cfg:
Code: Select all
define host{
use generic-printer ; Inherit default values from a template
host_name Dell_2130cn_Color_Laser ; The name we're giving to this printer
alias Dell LaserJet 2130n ; A longer name associated with the printer
address 192.168.0.4 ; IP address of the printer
hostgroups network-printers ; Host groups this printer is associated with
}
define service {
host_name Dell_2130cn_Color_Laser
use generic-service
service_description Yellow2
check_command check_printer!public!"CONSUM yellow"!20!10
Code: Select all
define command{
command_name check_printer
command_line $USER1$/snmp_check_printer -H $HOSTADDRESS -C $ARG1$ -x $ARG2 -w $ARG3$ -c $ARG4$
}
Code: Select all
WARNING: No SNMP response from -C! Make sure host is up and SNMP is configured properlyJR