Configuration question regarding best practice

I have a number of SSL certificates that I am monitoring for expiry data. Currently I am defining each SSL URL that I am querying as a host, and then monitoring the SSL Expiry via a service.

Here is a template:

*define host{
name generic-host
notifications_enabled 1
notification_interval 180
notification_options d,r,f
event_handler_enabled 1
flap_detection_enabled 1
low_flap_threshold 0
high_flap_threshold 0
failure_prediction_enabled 1
process_perf_data 0
retain_status_information 1
retain_nonstatus_information 1
active_checks_enabled 1
passive_checks_enabled 0
check_period 24x7
notification_period 24x7
check_interval 2
max_check_attempts 3
retry_interval 1
register 0
}

define host{
name host-ssl
use generic-host
contact_groups contact_group
register 0
}

define service{
name generic-service
notifications_enabled 1
notification_interval 180
notification_options w,u,r,f,s
check_freshness 0
event_handler_enabled 1
obsess_over_service 0
flap_detection_enabled 1
low_flap_threshold 0
high_flap_threshold 0
failure_prediction_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
is_volatile 0
active_checks_enabled 1
passive_checks_enabled 0
check_period 24x7
notification_period 24x7
normal_check_interval 2
max_check_attempts 3
retry_check_interval 1
register 0
}

define service{
name service-sslcert
use generic-service
service_description SSL Certificate Services
notification_interval 1440
check_interval 360
contact_groups contact_group
register 0
}

define hostgroup{
hostgroup_name site-sslcert
alias SSL Certificate Monitoring
}

define servicegroup{
servicegroup_name site_name
alias Site_Name Services
}

define host{
use host-ssl
hostgroups site-sslcert
host_name site.domain.com
address site.domain.com
}

define service{
use service-sslcert
servicegroups site_name
hostgroup_name site-sslcert
service_description SSL Certificate Monitoring
check_command check_certexp!46
}*

The problem I am having is that all of the “hosts” are showing as “Pending” in the Nagios dashboard. I don’t want any of the hosts to be monitored for up/down, or any host check at all for that matter. I only want the SSL certificate to be monitored, and alerted on.

I can’t help but think that I’m going above this all wrong, but being fairly new to Nagios I’m not sure if there’s a better way to define -only- services. The objective of monitoring the certificates is working fine, but I still see “Pending” on the dashboard for every SSL cert I am monitoring, even though no host check is enabled for that hostgroup.

Any help would be appreciated.

I also wanted to add, if I specify “active_checks_enabled 0” it still keeps the hosts in the Pending tab, but they all have "Host is not scheduled to be checked… " in the Status field. How can I make these not appear in the Pending dashboard?

You have to define hosts. There is no way service could be checked if it doesn’t know on what IP to search for it’s request. You have to bond service for the host. It is important for you to have check-host-alive for your host because every service check depends on host-alive status. In host/host-template definition you should have the option:
check_command check-host-alive
That way host won’t appear in Pending tab. They will be checked, and in OK status if they’re UP. If you don’t want to see them in your Host Overview page then don’t put them in any of the hostgroups, Just make servicegroup for your SSL checks.

You can leave the option:
active_checks_enabled 0
but it is not advisable because you should know the status of the host if anything goes wrong with the SSL service check.

Well; you don’t want any host checked…
imo, it may not be the best idea, since the host check doesn’t interfere much with your services checks (I mean: why NOT checking them ? as nagios do it “by default”).
So, if you accept that nagios will check your hosts (btw, it’s just a ping check), follow Albin’s reply :slight_smile:

if you really really don’t want your hosts to be checked…which can happen (I know: I do for some hosts :)), here what you could do:
add this command definition in your commands definition file:
define command{
command_name check-host-virtual
command_line $USER1$/check_dummy 0
}

and then, add this option:
check_command check-host-virtual
in your “host-ssl” definition

Thus, Nagios will do a false check, just to put your host in an OK state (avoiding the PENDING state :)).

Hope this helps