Service has status ok but host has status pending

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Hoygen83
Posts: 16
Joined: Mon Oct 28, 2019 10:30 am

Service has status ok but host has status pending

Post by Hoygen83 »

Hello, in nagios core 4.4.5 i have the following definitions:
define hostgroup{
hostgroup_name NAS
alias DRIVE DI RETE
}
define host {
use generic-host ;template
host_name PRIMARYBACKUP ; The name we're giving to this host
alias Sinology su cui salvano i backup ; A longer name associated with the host
address 10.100.0.30 ; IP address of the host
hostgroups NAS ; Host groups this host is associated with
}


define service {
use generic-service
host_name PRIMARYBACKUP
service_description PING
check_command check_ping!3000.0,80%!5000.0,100%
normal_check_interval 10
retry_check_interval 1
}

define host {
use generic-host ;template
host_name RECSERVER ; The name we're giving to this host
alias Qnap su cui salvano le videocamere ; A longer name associated with the host
address 10.100.0.17 ; IP address of the host
hostgroups NAS ; Host groups this host is associated with
}

define service {
use generic-service
host_name RECSERVER
service_description PING
check_command check_ping!3000.0,80%!5000.0,100%
normal_check_interval 10
retry_check_interval 1
}

define host {
use generic-host ;template
host_name SECONDARYBACKUP ; The name we're giving to this host
alias Sinology su cui vengono replicati i backup ; A longer name associated with the host
address 10.100.0.32 ; IP address of the host
hostgroups NAS ; Host groups this host is associated with
}


define service {
use generic-service
host_name SECONDARYBACKUP
service_description PING
check_command check_ping!3000.0,80%!5000.0,100%
normal_check_interval 10
retry_check_interval 1
}

and the generic-host template is defined like this:
define host {

name generic-host ; The name of this host template
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
notification_period 24x7 ; Send host notifications at any time
max_check_attempts 5
check_interval 10
retry_interval 1
register 0 ; DON'T REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}

I don't understand why the three hosts Recserver Primarybackup Secondarybackup are shown as pending but the services are all in ok state.
Image
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Service has status ok but host has status pending

Post by lmiltchev »

I don't see a "check_command" directive for any of the hosts or in the "generic-host" template... Nagios wouldn't know how to check the host status without a check command... You can add one to the template, or to each host definition.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Hoygen83
Posts: 16
Joined: Mon Oct 28, 2019 10:30 am

Re: Service has status ok but host has status pending

Post by Hoygen83 »

Thank you for your kind answer
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Service has status ok but host has status pending

Post by lmiltchev »

@Hoygen83, you are welcome! Let us know if the issue has been resolved, and if it is OK to lock this thread. Thank you!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked