Moderator Edit: This thread has been split from another - https://support.nagios.com/forum/viewto ... 20&t=27796
In the future, please create a new thread and link to the old one instead of adding on.
Hi,
I have read that changing check intervals, number of retry nagios will not send notifications for services when host is down. But I wold like to STOP any service check when host is down. I have following scenario. We have a lot computing machines (about 100). But when we do not use them, they go to suspend mode. So when host is down (suspended, do not reply for ping) I do not want to perform any check on that machine. I know that I can check host every minute and services every 5, by this is not a nice solution. I want to check some critical services each minute, but only when host is up.
Do not notify on services if host is down (alert grouping)
-
- Posts: 5
- Joined: Thu Mar 16, 2017 4:41 am
Re: Do not notify on services if host is down (alert groupin
Assuming your host check is a ping, make a service check ping as well and then make all your service checks dependent upon the ping service check returning OK.
-
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Do not notify on services if host is down (alert groupin
@eloyd is correct. Did you have any questions about his suggestion?
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Do not notify on services if host is down (alert groupin
host_down_disable_service_checks=1 is a global version of this.
https://support.nagios.com/kb/article.p ... tegory=164
This works in Nagios Core or Nagios XI.
https://support.nagios.com/kb/article.p ... tegory=164
This works in Nagios Core or Nagios XI.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
- Posts: 5
- Joined: Thu Mar 16, 2017 4:41 am
Re: Do not notify on services if host is down (alert groupin
I'm very sorry for delay. Eloyd's solution is working. But I have a question. I have 3 services that will depend on ping. So I have to create 3 servicedependency definitions. Do I have to repeat this for each host? So 100 host, 3 services and I will finish with 300 servicedependency definitions? Is it possible to create some smart servicedependency that some service will depend on ping on THE SAME host?
Re: Do not notify on services if host is down (alert groupin
Yes, you would need to repeat it for each host, it's best to follow box293's recommendation above so you don't need to change anything else.
Thank you
Thank you
Re: Do not notify on services if host is down (alert groupin
There's another way to approach this. Instead, you could customize the plugin that performs the check for the ping on the host so that it first verifies that the port being checked is available (5666 for NRPE and 12489 for NSClient - defaults.) This would allow you to watch for the host to be down, and disable the service checks (assuming you've made the necessary changes in nagios.cfg to disable service checks if the host is down.)bartek_zgo wrote:I'm very sorry for delay. Eloyd's solution is working. But I have a question. I have 3 services that will depend on ping. So I have to create 3 servicedependency definitions. Do I have to repeat this for each host? So 100 host, 3 services and I will finish with 300 servicedependency definitions? Is it possible to create some smart servicedependency that some service will depend on ping on THE SAME host?
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Do not notify on services if host is down (alert groupin
Also wanted to point out that you can create same host service dependencies as per the documentation:
https://assets.nagios.com/downloads/nag ... ricks.html
https://assets.nagios.com/downloads/nag ... ricks.html
Same Host Dependencies Using Wildcard
When you have an agent like NCPA you can use the agent_version check SERVICE1 as the master service. A wildcard can then be used for the dependent_service_description so that all services on that host depend on the status of SERVICE1. Finally you exlcude SERVICE1 in dependent_service_description as it cannot depend on itself.Code: Select all
define servicedependency host_name HOST1,HOST2,HOST3,...,HOSTN service_description SERVICE1 dependent_service_description *,!SERVICE1 other dependency directives ... }
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.