I have several services that are external scripts run on a VM. I also am monitoring this VM as a host.
If this VM goes down, currently all of the services that use external scripts on the VM go into a Critical state. Is there a way of setting up a dependency so only the host goes down and not these services (these services are tied to other hosts btw)
Thanks
Dependencies for external scripts
Re: Dependencies for external scripts
Can you show us some "example" configs? Do you want nagios to stop notifications, active checks or both on a service if the host is down?
You could probably make these checks dependent on a Ping service, attached to this host. For more information on host/service dependencies, please review our Nagios Core documentation here:
https://assets.nagios.com/downloads/nag ... ncies.html
Also, you could disable service checks if the host is down by defining the following directive in the nagios.cfg:
https://support.nagios.com/kb/article/n ... ncies.html
You could probably make these checks dependent on a Ping service, attached to this host. For more information on host/service dependencies, please review our Nagios Core documentation here:
https://assets.nagios.com/downloads/nag ... ncies.html
Also, you could disable service checks if the host is down by defining the following directive in the nagios.cfg:
Code: Select all
host_down_disable_service_checks=1Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Dependencies for external scripts
This is where it's a bit of a pain, whilst the external scripts are running on this particular host - the services don't actually relate to that host, and to completely other hosts - does that make sense?
Re: Dependencies for external scripts
If host A goes down, a service check for Host B should not go down unless you setup Service Dependencies. Have you setup a Service Dependencies for the services / hosts in question?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Dependencies for external scripts
I'll try to explain myself properly:
Host A is a webhost.
Host B is a Windows VM
Host A has 2 services:
Service AA which is a http check
& Service AB which is a powershell script running on Host B which queries a service on Host A and sends the exit code to Nagios.
Service AB is nothing to do with host B in Nagios (it's not associated with host B at all - nor do I want it to be)
My issue is that if there is an issue with host B and the script cannot run, Service AB reports a failure. My preferred behaviour is that if Host B is down then suppress the check until host B is back up.
I've had a bit of a look at dependencies and can't see how to do this at all. Is this possible?
Host A is a webhost.
Host B is a Windows VM
Host A has 2 services:
Service AA which is a http check
& Service AB which is a powershell script running on Host B which queries a service on Host A and sends the exit code to Nagios.
Service AB is nothing to do with host B in Nagios (it's not associated with host B at all - nor do I want it to be)
My issue is that if there is an issue with host B and the script cannot run, Service AB reports a failure. My preferred behaviour is that if Host B is down then suppress the check until host B is back up.
I've had a bit of a look at dependencies and can't see how to do this at all. Is this possible?
Re: Dependencies for external scripts
You can still use service dependencies in this case. Set up a ping service on Host B, which runs more frequently than Service AB. Next, make Service AB dependable on the ping service.
Example:
In the example above, "Ping" is a "master" service" (service that is being depended upon), "Service AB" is the "dependent" service. "Service AB" won't be actively checked, and notifications for it won't be sent if the "master" service (Ping) is in CRITICAL state.
Example:
Code: Select all
define servicedependency {
# config_name test
dependent_host_name Host B
dependent_service_description Service AB
host_name Host B
service_description Ping
inherits_parent 0
execution_failure_criteria c,
notification_failure_criteria c,
dependency_period 24x7
}Be sure to check out our Knowledgebase for helpful articles and solutions!