Dependency Mapping - Host & Service to all monitors

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
veeravamsi
Posts: 146
Joined: Wed Jan 23, 2019 3:35 am

Dependency Mapping - Host & Service to all monitors

Post by veeravamsi »

Hi Team,

Im trying to build Dependency mapping at Host level to check for NCPA Agent Status so is it possible to Create hierarchical dependency to avoid running monitors based on scenario :

Scenario 1 : Server is not reachable
Host Down : PING fails
Agent Down : Agent API is NOT responding

Scenario 2 : Server is Up but Agent is NOT responding
Host Up: PING Success
Agent Down : Agent API is NOT responding

All underlying monitors should not run in either of the scenarios - Disk , CPU , Memory , etc

How can we create a dependency so that if either Host Down or Agent Down then none of underlying monitors run ?

--Vamsi
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Dependency Mapping - Host & Service to all monitors

Post by benjaminsmith »

Hello Vamsi,

You can use service dependencies in Nagios XI to set this up. So if you create a ping check as a service for the server, and then define service dependencies between this check and the other services, you can configure the execution and notification settings as desired.

Service dependencies can be configured in Nagios XI by going to Configure > CCM > Advanced > Service Dependencies (see screenshot).
service-dependencies.png
You'll find documentation explaining the settings below.
https://support.nagios.com/kb/article.php?id=505
https://assets.nagios.com/downloads/nag ... ncies.html

Let me know if that will work for your environment.
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
veeravamsi
Posts: 146
Joined: Wed Jan 23, 2019 3:35 am

Re: Dependency Mapping - Host & Service to all monitors

Post by veeravamsi »

Perfect . Im trying to Create NCPA Agent Monitor ( using check_http ) to test Agent Availability before running any of the underlying monitors. So this approach of Service Dependency works fine , However two questions :

1. We have to create this dependency for each server ? Meaning we have to manually select the Services ( CPU , Memory , Disk , etc ) and if these are varying ( means some servers have Service check ? ) then its lot of complexity or involves manual work ?
Capture.PNG
2. Also can we include this as part of Template Deployment ? Or is there a way to make this global just like we change host_dependency_check=1 or some variable to say dont run any of the monitors if Host is unreachable ?

Do let us know if there is better way of handling this situation : My goal is not run underlying services if Host or Agent is not working ?

--Vamsi
You do not have the required permissions to view the files attached to this post.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Dependency Mapping - Host & Service to all monitors

Post by benjaminsmith »

Hi Vamsi,

It sounds like this approach will work for you. Below are the answers to your questions.
We have to create this dependency for each server? Meaning we have to manually select the Services ( CPU , Memory , Disk , etc ) and if these are varying ( means some servers have Service check ? ) then its lot of complexity or involves manual work ?
1. There isn't a template for service dependencies, so it would take some manual selection to set this up, but you might be able to save some time organizing the services into groups.
Also can we include this as part of Template Deployment? Or is there a way to make this global just like we change host_dependency_check=1 or some variable to say dont run any of the monitors if Host is unreachable?
2. There is a configuration setting the main Nagios.cfg file that will allow you to disable service checks when the host is down. This is a global setting, but very easy to implement.
See:
Nagios XI - Service Dependencies
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
veeravamsi
Posts: 146
Joined: Wed Jan 23, 2019 3:35 am

Re: Dependency Mapping - Host & Service to all monitors

Post by veeravamsi »

Thanks Benjamin . I cannot access the document referred on the KB link .

So if i want to make 'NCPA Agent' as master Service across all Services , Do we need to have separate Entry for each Server ? or can we logically using Host/Service Groups and make them generic ?

On the second point - Do you have any other option on nagios.cfg ( similar to host_down_disable_service_checks=1 ) which i set for NCPA Agent Service like ncpa_service_down_disable_checks=1
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Dependency Mapping - Host & Service to all monitors

Post by ssax »

We can't either, @benjaminsmith says he's going to try to track that article down.

How many total NCPA services do you think your XI system will have once you have them all in?

See here for examples of some time saving tips/tricks of how it can be setup:

https://assets.nagios.com/downloads/nag ... dependency

The "ncpa_service_down_disable_checks" functionality doesn't exist. You'll only be able to do it with service dependencies.

Thank you
veeravamsi
Posts: 146
Joined: Wed Jan 23, 2019 3:35 am

Re: Dependency Mapping - Host & Service to all monitors

Post by veeravamsi »

Awesome :) . Do you have any sample Rule based on your experience that helps us to create dependency Mapping for

NCPA Agent Status ( Primary or Main Service ) and rest all are dependent services.

As we will have 1000's of Servers having NCPA Agent and writing separate rule for each one is not ideal solution. So i was thinking to have Single Rule that helps us do this Job . Any suggestions ?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Dependency Mapping - Host & Service to all monitors

Post by ssax »

I'm struggling to find a way to do this without you defining them individually for each host.

My recommendation would probably be for you to change your host check from a Ping check to an NCPA agent check (just set it up like the master service), then set host_down_disable_service_checks=1 in your /usr/local/nagios/etc/nagios.cfg, and then restart the nagios service.

That way if the agent is down, the host will still nofify you, but the other NCPA services for the host won't run, which accomplishes what you're trying to do.

Those are really your only options after trying to get this done in a lab environment.
veeravamsi
Posts: 146
Joined: Wed Jan 23, 2019 3:35 am

Re: Dependency Mapping - Host & Service to all monitors

Post by veeravamsi »

Thank you for your suggestion . This is the current configuration we have ( NCPA Check @ Host Level ) but when NCPA is not communicating it triggers Host Down error which is what we are trying to avoid.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Dependency Mapping - Host & Service to all monitors

Post by ssax »

How often do you have it that the agent is down and the host is still pinging? Is this a common problem in your environment?
Locked