Page 1 of 1

Monitoring Services only when the Host is up

Posted: Mon Mar 21, 2016 12:05 pm
by sgiworks
Hello Folks,

Is there a possibility to stop monitoring and alerting on service down, if the host is intentionally brought down. I mean at our environment the servers host are not always up and running, so we don't want the alerts to be generated when the host is down.

All the services should be monitored only when the associated host is up and running.

Thanks in advance.

Regards,
Swapnil

Re: Monitoring Services only when the Host is up

Posted: Mon Mar 21, 2016 1:38 pm
by hsmith
I believe dependencies are what you are looking for. Check this out and let us know.

Re: Monitoring Services only when the Host is up

Posted: Mon Mar 21, 2016 1:44 pm
by sgiworks
Does that mean I can have a Service dependent on the Host status?

Re: Monitoring Services only when the Host is up

Posted: Mon Mar 21, 2016 2:22 pm
by tmcdonald
That would be one way to do it, but depending on your XI version you might have a better option. I added a configuration setting to the Nagios Core engine that will stop all checks and alerts on a service if the host is down. You can read about it here:

https://github.com/NagiosEnterprises/na ... 724930a3e7

Basically, if you are on Core 4.1.1 or later you can add host_down_disable_service_checks=1 to your /usr/local/nagios/etc/nagios.cfg and then run service nagios restart for it to take effect. There will be no status updates if services are skipped in this way, just a log message, so keep that in mind.

Re: Monitoring Services only when the Host is up

Posted: Tue Apr 05, 2016 12:05 pm
by sgiworks
Thanks a lot, it worked :)

We had latest version of CCM.

Cheers,
Swapnil

Re: Monitoring Services only when the Host is up

Posted: Tue Apr 05, 2016 12:10 pm
by tmcdonald
Glad to hear it! Are we all good to close out this ticket?

Re: Monitoring Services only when the Host is up

Posted: Fri Apr 29, 2016 6:47 am
by sgiworks
Hello,

Everything was working perfect with existing hosts and services. However when we added new hosts, the service alerts for these new hosts started to appear even when the hosts are intentionally brought down. Please suggest.

We want to monitor the services only when the hosts are up.

Regards,
Swapnil

Re: Monitoring Services only when the Host is up

Posted: Fri Apr 29, 2016 12:43 pm
by bwallace
You could put the hosts into scheduled downtime before you bring them down - this should suppress all notifications for them (if properly configured).
This doc was written for Core but applies to XI as well:
https://assets.nagios.com/downloads/nag ... ntime.html

If the hosts go down for other reasons, then read this description from Box293 to start with https://support.nagios.com/forum/viewto ... 10#p103689

Re: Monitoring Services only when the Host is up

Posted: Tue Jun 28, 2016 3:18 pm
by sgiworks
Hi,

The setting you provided worked, we have the services monitored only when the hosts are up and running.

However this is now impacting the availability reporting of the servers, because the servers which are supposed to be always ON and goes down by incident doesn't reflect the downtime in the Availability Reporting. I mean even if the server was down for couple of hours in that particular month, it still shows that it was 100% available through ping service, because ping server is checked only when the server is up.

Please provide a workaround for this problem.

Regards,
Swapnil

Re: Monitoring Services only when the Host is up

Posted: Tue Jun 28, 2016 3:35 pm
by bwallace
There is no workaround to that - if the services are checked only when the host is up. Then again it could be a matter of interpretation = knowing that services are only checked when a host is up and you see services are down, then you 'll know they are not unavailable because their host is down, but because they are really down for whatever the reason and this is actually more accurate, when analyzing services.

When running your reports, choose the option "Hide Scheduled Downtime" if you do not want scheduled downtime counted as 'real' downtime.
Hide sched downtime.jpg