Nagios: Could not resolve hostname
Posted: Tue Jul 21, 2015 5:34 am
Hi.
My setup:
hosts.cfg - contains definitions for each host under monitoring, e.g.:
hosts_groups.cfg - define groups:
services.cfg:
And check_linux_memory in commands.cfg:
Problem is with few new added hosts, like rdss-vpn - Nagios won't get it's IP from hosts (please note - I have few other servers (also in groups) in check_linux_memory - all works).
Instead - I have an error in nagios.log:
It's group:
Can't understand - why Nagios can't resolve IP for all hosts in rdss-service-server group? All other groups are similar, also uses `check_linux_memory`, and works.

My setup:
hosts.cfg - contains definitions for each host under monitoring, e.g.:
Code: Select all
define host{
use linux-server
host_name rdss-vpn
display_name VPN
address 54.***.***.176
}Code: Select all
define hostgroup{
hostgroup_name rdss-service-server
alias RDSS services
members [...], rdss-vpn
}Code: Select all
define service{
use local-service
hostgroup_name rdss-web-server, rdss-service-server
service_description Memory usage
check_command check_linux_memory!50!80
notifications_enabled 1
}Code: Select all
define command{
command_name check_linux_memory
command_line $USER1$/check_nrpe -H $HOSTNAME$ -c check_linux_memory -a '-f -w $ARG1$ -c $ARG2$'
}Instead - I have an error in nagios.log:
Here is example of host, where check_linux_memory works:[1437473407] SERVICE ALERT: rdss-vpn;Memory usage;WARNING;HARD;4;(No output on stdout) stderr: Could not resolve hostname rdss-vpn: Name or service not known
Code: Select all
define host{
use linux-server
host_name www.dev.domain.com
display_name DEV
address 54.***.***.136
}Code: Select all
define hostgroup{
hostgroup_name rdss-web-server
alias RDSS web servers
members www.dev.domain.com, www.qa.domain.com, www.staging.domain.com
}