Centreon (Nagios) setting a host macro (variable)
EDIT2: Got it working - There was an unrelated problem that meant even
though I was tinkering with the 'faulty' host definition, the revised
check was not being run so I was always seeing the original error message.
I am trying to add a new variable (macro) to a host template through the
Centreon (2.4.2) GUI so that the value can be picked up when doing a
check, but I am getting an error. Here's what I have so far:
I have a host template with a macro name of INSTANCECODE
I have a check command like this:
RUBYOPT="rubygems" ruby /usr/lib64/nagios/plugins/check_ec2_status.rb -a
$HOSTADDRESS$ -i $_HOSTINSTANCECODE$ -f $ARG1$
I have a host definition that uses the template mentioned above, and has
INSTANCECODE filled in as i-xx4770xx (An Amazon EC2 instance
code/reference)
But the check comes back with an error: "Error occured while trying to
retrieve EC2 instance: $"
If I hard-code the instance value into the check it works fine
Using the Nagios interface, which has a tool for checking I can't see any
variable expansion for $_HOSTINSTANCECODE$ taking place.
Any useful suggestions would be appreciated.
Edit - for Keith: Generated host template:
define host{
name Amazon_Instance
alias Amazon Instance
check_command check_amazon_ec2_status
max_check_attempts 5
check_interval 60
retry_interval 120
check_period 24x7
contact_groups Supervisors
contacts Supervisor
notification_interval 60
first_notification_delay 60
notification_options d,u,r
register 0
_INSTANCECODE
}
No comments:
Post a Comment