Hi
We are working on a request where we have two services running on different hosts. We need to set up a dependency monitoring in Nagios.
For example:
HostA ---- ServiceA
HostB ---- ServiceB
If ServiceA is CRITICAL and also ServiceB is CRITICAL then alert notification for ServiceA should be sent.
If ServiceA is CRITICAL and ServiceB is OK then no alert notifications should be sent for both ServiceA and ServiceB.
How can we achieve this in Nagios Xi or in Nagios core.
Thanks
Deek
Parent and child service dependency
Re: Parent and child service dependency
You can see here for dependencies:
https://assets.nagios.com/downloads/nag ... ncies.html
You may want to use the check_cluster plugin to do this as well:
https://assets.nagios.com/downloads/nag ... sters.html
The check cluster plugin checks the status of multiple services and alerts based on the status of both.
1. Make sure that you are monitoring the services (PING in this example) on all servers (you can disable notifications for them, this is important so you don't notifications when they are down), these service checks are what will be used by the check_cluster plugin and need to exist.
2. Create a new command:
- Command Name: check_service_cluster
- Command Line: $USER1$/check_cluster --service -l $ARG1$ -w $ARG2$ -c $ARG3$ -d '$ARG4$'
- Command Type: check command
3. Create the service cluster check:
- Description: PING_Cluster
- Check command: check_service_cluster
- $ARG1$: PING_Cluster
- $ARG2$: 3 <- Set this to one MORE than your total number of services (3 services + 1 = 4) - We don't care about warnings in this example
- $ARG3$: 1 <- Set this to one LESS than your total number of services (3 services - 1 = 2)
- $ARG4$: $SERVICESTATEID:yourhost1:PING$,$SERVICESTATEID:yourhost2:PING$,$SERVICESTATEID:yourhost3:PING$
NOTE: The hostname and the service description in $ARG4$ need to be exact (case sensitive).
The way this would work is that whenever that service is not running on ANY of the nodes it would generate a CRITICAL. So the check_cluster uses the statuses of all of each individual service checks to determine if there is an issue and since you disabled the notifications on the individual services you won't get those notifications, this is the service that will do the notifying.
https://assets.nagios.com/downloads/nag ... ncies.html
You may want to use the check_cluster plugin to do this as well:
https://assets.nagios.com/downloads/nag ... sters.html
The check cluster plugin checks the status of multiple services and alerts based on the status of both.
1. Make sure that you are monitoring the services (PING in this example) on all servers (you can disable notifications for them, this is important so you don't notifications when they are down), these service checks are what will be used by the check_cluster plugin and need to exist.
2. Create a new command:
- Command Name: check_service_cluster
- Command Line: $USER1$/check_cluster --service -l $ARG1$ -w $ARG2$ -c $ARG3$ -d '$ARG4$'
- Command Type: check command
3. Create the service cluster check:
- Description: PING_Cluster
- Check command: check_service_cluster
- $ARG1$: PING_Cluster
- $ARG2$: 3 <- Set this to one MORE than your total number of services (3 services + 1 = 4) - We don't care about warnings in this example
- $ARG3$: 1 <- Set this to one LESS than your total number of services (3 services - 1 = 2)
- $ARG4$: $SERVICESTATEID:yourhost1:PING$,$SERVICESTATEID:yourhost2:PING$,$SERVICESTATEID:yourhost3:PING$
NOTE: The hostname and the service description in $ARG4$ need to be exact (case sensitive).
The way this would work is that whenever that service is not running on ANY of the nodes it would generate a CRITICAL. So the check_cluster uses the statuses of all of each individual service checks to determine if there is an issue and since you disabled the notifications on the individual services you won't get those notifications, this is the service that will do the notifying.
Re: Parent and child service dependency
Ssax -- thanks for your suggestions.
We used service dependency.
https://assets.nagios.com/downloads/nag ... ncies.html
You may now close the case.
We used service dependency.
https://assets.nagios.com/downloads/nag ... ncies.html
You may now close the case.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Parent and child service dependency
Great!deek wrote:Ssax -- thanks for your suggestions.
We used service dependency.
https://assets.nagios.com/downloads/nag ... ncies.html
You may now close the case.
Locking thread