Host Custom Variables problem
Posted: Mon Feb 16, 2015 12:49 am
I'm having problems trying to pass a custom Host variable in a Service Check.
I have defined _AWS_Instance ID in a host entry
(I've removed the hostname/ IP etc. in this listing)
In the Service Check I have tried to reference this variable but all that I get when it's passed to my script is "$"
I have even tried to embed the variable in the command as well as the above - it also returns a '$"
So given the above I would expect the following to be executed
I have added the following line to the start of my check_instance_status.sh script
This is what I see in the log
I've tried different variable names, etc. - but they all produce the same result.
I am using NagiosXI 2014 R2.3
Any ideas ?
regards... Fred
I have defined _AWS_Instance ID in a host entry
(I've removed the hostname/ IP etc. in this listing)
Code: Select all
define host {
host_name ServerA
_AWS_InstanceID i-c58a9a0a
register 1
}Code: Select all
define service {
host_name ServerA
service_description Check Instance Scheduled Events
check_command check_instance_status!asg-txt!$_HOSTAWS_InstanceID$!$HOSTNAME$!!!!!
register 1
}Code: Select all
define command {
command_name check_instance_status
command_line $USER3$/AWS/check_instance_status.sh $ARG1$ $_HOSTAWS_InstanceID$ $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$
}Code: Select all
$USER3$/AWS/check_instance_status.sh asg-txt i-c58a9a0a i-c58a9a0a SERVERACode: Select all
echo $* >> /tmp/event-status.logCode: Select all
asg-txt $ $ ServerAI am using NagiosXI 2014 R2.3
Any ideas ?
regards... Fred