What we are trying to do.
We have several situations where we need X_alive checks for all checks that use that protocol.
Examples being an SNMP_Alive check as a dependency for all snmp checks.
JMX_Alive for all JMV checks using JMX.
NRPE_Alive... you get the idea.
We can do service dependancies for each host, with the SNMP Checks on that box, and the SNMP_Alive check as the master service.
But this requires us to set up a service dependency for EVERY box that uses SNMP.
Thus making dependency management unmanageable.
Is there a way to say ANY host with checks SNMP_xxx will depend on SNMP_Alive on the same host.
This would make it so we could define that all checks we select are SNMP based, and thus, would have an SNMP_Alive dependency (which of course would have to exist on the host as well)
POSSIBLE BUG:
When we were testing this. The notes for Dependent hosts(*) states "Leaving this directive blank can be used to create "same host" dependencies." but, we are unable to leave it blank.
It simply errors out saying that a required field is not filled out (and does not say which fields)
We had Hosts, Services, Dependent Services, Period, failure criteria all set.
Any idea would be warmly welcome, as I am not "enthusiastic" about the idea of managing, and needing to remember to add dependancy for any snmp, nrpe, jmx, etc... check that we ever add in the future.
It would be substantially faster to simply add this new JMX check to the list of known JMX checks, and it will have a dependency to JMX_Alive on the same host.
Global Service Dependancies
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Global Service Dependancies
You should be able to place all of these in a hostgroup, then on the service dependencies select the hostgroup (on both sides), select the dependent services on the left, and the Service that they are dependent on the right.
Execution failure criteria specifies when the dependent services shouldn't be checked. so you can specify w,c,u which would indicate the dependent service was not OK
Execution failure criteria specifies when the dependent services shouldn't be checked. so you can specify w,c,u which would indicate the dependent service was not OK
Re: Global Service Dependancies
In trying this, it fails config verification.
Created two hosts (A & B)
Created SNMP_Alive check on both hosts.
Created SNMP_CPU_Usage on host A
Created SNMP_Memory_Usage on host B
Put both of these hosts in a host group "Dependancy_SNMP"
Created a service dependancy with the house group attached
* Master Service - SNMP_Alive
* Dependant Services - SNMP_CPU_Usage, SNMP_Memory_Usage
When I apply the configuration I get:
Created two hosts (A & B)
Created SNMP_Alive check on both hosts.
Created SNMP_CPU_Usage on host A
Created SNMP_Memory_Usage on host B
Put both of these hosts in a host group "Dependancy_SNMP"
Created a service dependancy with the house group attached
* Master Service - SNMP_Alive
* Dependant Services - SNMP_CPU_Usage, SNMP_Memory_Usage
When I apply the configuration I get:
Code: Select all
Error: Could not find a service matching host name 'A' and description 'SNMP_Memory_Usage' (config file '/usr/local/nagios/etc/servicedependencies.cfg', starting on line 14)
Error: Could not expand dependent services specified in service dependency (config file '/usr/local/nagios/etc/servicedependencies.cfg', starting on line 14)
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Global Service Dependancies
If you are going to use the hostgroup as dependent/dependencies, both hosts must have the same matching services
Re: Global Service Dependancies
Then how can we accomplish the need from the original post?
Is it simply not possible?
Is it simply not possible?
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Global Service Dependancies
If your hosts have different services then you would need to create a dependency for each host