Monitoring Services only when the Host is up

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
sgiworks
Posts: 197
Joined: Mon Mar 21, 2016 11:38 am

Monitoring Services only when the Host is up

Post 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
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Monitoring Services only when the Host is up

Post by hsmith »

I believe dependencies are what you are looking for. Check this out and let us know.
Former Nagios Employee.
me.
sgiworks
Posts: 197
Joined: Mon Mar 21, 2016 11:38 am

Re: Monitoring Services only when the Host is up

Post by sgiworks »

Does that mean I can have a Service dependent on the Host status?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Monitoring Services only when the Host is up

Post 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.
Former Nagios employee
sgiworks
Posts: 197
Joined: Mon Mar 21, 2016 11:38 am

Re: Monitoring Services only when the Host is up

Post by sgiworks »

Thanks a lot, it worked :)

We had latest version of CCM.

Cheers,
Swapnil
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Monitoring Services only when the Host is up

Post by tmcdonald »

Glad to hear it! Are we all good to close out this ticket?
Former Nagios employee
sgiworks
Posts: 197
Joined: Mon Mar 21, 2016 11:38 am

Re: Monitoring Services only when the Host is up

Post 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
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: Monitoring Services only when the Host is up

Post 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
Be sure to check out the Knowledgebase for helpful articles and solutions!
sgiworks
Posts: 197
Joined: Mon Mar 21, 2016 11:38 am

Re: Monitoring Services only when the Host is up

Post 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
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: Monitoring Services only when the Host is up

Post 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
You do not have the required permissions to view the files attached to this post.
Be sure to check out the Knowledgebase for helpful articles and solutions!
Locked