Hello,
For some reason $HOSTNAME$ is passing IP as oppose to host_name parameter from host defintion
Here is is my config
define host{
use stage-app-hosts
host_name StageJQMQ1
alias Stage JQ RabbitMQ 1
address 10.xx.xx.xx
}
define service {
use stage-app-services
hostgroup_name Stage_JQMQ
service_description check_mq_server
check_command check_jqmq!check_rabbitmq_server!HOSTNAME$
}
define hostgroup {
hostgroup_name Stage_JQMQ
alias Stage_JQMQ
members StageJQMQ1
}
I am getting this error:
RABBITMQ_SERVER CRITICAL - Received 500 Can't connect to 10.xx.xx.xx.blah.com:15672 (Bad hostname) for path: nodes/rabbit@10
For some reason it's getting the IP address instead hostname
$HOSTNAME$ macro not working?
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: $HOSTNAME$ macro not working?
I can't explain where your command is getting 10.x.x.x, but I can say thatstecino wrote:check_command check_jqmq!check_rabbitmq_server!HOSTNAME$
Code: Select all
HOSTNAME$ != $HOSTNAME$
Re: $HOSTNAME$ macro not working?
Still it's passing the IP address after I added the missing $
In my script I had to parse the fqdn from the reverse IP lookup
In my script I had to parse the fqdn from the reverse IP lookup
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: $HOSTNAME$ macro not working?
Please post your command definition for:
check_jqmq
check_jqmq
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: $HOSTNAME$ macro not working?
Looks like it wasn't an issue with the Nagios, but an issue with DNS. The entries weren't in the zone file, now $HOSTNAME$ is returning proper value.
Re: $HOSTNAME$ macro not working?
Great. We'll go ahead and close the thread. Thanks.