I have seen plenty on this forum about hosts that remain at a PENDING status, but none of the posted solutions seem to work.
Ive got a pretty standard install, have setup Nagios on more than one occasion, but this has me stumped.
In this particular install I setup a small group of servers to monitor as a test bed before adding more in. I added 16 in last week, and now those 16 all show up as Pending.
I have a check_ping pinging all the hosts, so all hosts have a service associated with them.
define service{
use generic-service ; Name of service template to use
host_name *
hostgroup_name *
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
These 16 hosts are not explicitly defined in my services.cfg file, however if I add another service to one of these hosts using their host name, it still does not bring the host to anything but Pending.
your hosts stay at a pending status because they have no check definition.
If you want the hosts to be checked, you should define a check command for them, as in:
define host {
name a_name
check_command check-host-alive-ping
…
}
then, nagios will be able to check your hosts.
From what I’ve seen on my (really recent) nagios 3.0 (I’m more used to v2.10) install, nagios WILL do the checks for your hosts (don’t forget to check the other options of your host definition, of course :))
And indeed, the Nagios website Service Detail shows the ping service is OK with these hosts. Yest, the Host Status Tools box at the top of the page lists 16 Pending. But on the Hostgroup Overview the hosts’ status is Pending, but the Services box is green and says 1 UP, that one being the ping service.
My hosts are all setup the same way, pretty basic:
define host{
use generic-host
host_name QA
alias QA
address 192.168.190.41
}
They all use generic host, which I havent changed from the default install.
Actually, the way you set up your tests is, in fact, a way to PING each host, but it is not the way nagios is expecting it.
Using Nagios’ way, you should:
define your hosts to be checked using PING
set up other services instead of PING for each host.
With this, Nagios will do a host check (ie: PING) then it will check its services. If a service goes down, Nagios will do a host check to know if it is useful to notify the service.
I hope it is a bit clearer:)
To be a bit more concrete, you should add this definition:
in your host definitions (or in the generic-host definition; in nagios-3.0, the generic-host definition does not include this check_command)
Here is another host definition you could use as a template:
define host{
name generic-host
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 0 ; Host event handler is enabled
flap_detection_enabled 0 ; Flap detection is enabled
process_perf_data 0 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
passive_checks_enabled 0
obsess_over_host 0
active_checks_enabled 1
check_command check-host-alive-ping
notification_interval 10
max_check_attempts 2
notification_period 24x7
notification_options d,u,r
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}
You’ll notice it is a bit more complete
Also, make sure the check-host-alive is defined as: