Service Dependency - Multiple Manage Host

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
acentek
Posts: 123
Joined: Thu Jul 27, 2017 2:00 pm

Service Dependency - Multiple Manage Host

Post by acentek »

We have pbx systems where the phones (sip peers) are in multiple locations. This causes us to have multiple circuits, which translates to multiple Manage Hosts in Service Dependency. We are not able to add multiple Hosts per Service Dependency - we get a Nagios error when we Apply Config. I'm wondering if this is normal behavior, can we have more than 1 Manage Host? Do we have to do a separate Service Dependency per Manage Host, then the Dependent Host and Dependent Service would be the same for each Service Dependency?

Hopefully, I'm making some sense.

Ex: companypbx - PBX system. They have a location in Town A and Town B - would have separate Manage Hosts (circuits) - Circuit12 and Circuit13 - with phones (sip peers) at each location on each circuit. So we can't add both Circuit12 and Circuit13 to the same Service Dependency - we have to add them separately but will Nagios respond as we'd expect having two separate dependencies?

Thanks
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Service Dependency - Multiple Manage Host

Post by lmiltchev »

We are not able to add multiple Hosts per Service Dependency - we get a Nagios error when we Apply Config. I'm wondering if this is normal behavior, can we have more than 1 Manage Host?
You should be able to add multiple hosts just fine, provided your "master" service is present on all hosts. For example, I have a "test" service dependency, defined as such:

Code: Select all

define servicedependency {
    # config_name                    test
    dependent_host_name              localhost
    dependent_service_description    HTTP
    host_name                        CentOS-NCPA,CentOS6-NRPE,CentOS6-SNMP,CentOS6-SSH
    service_description              Ping
    inherits_parent                  1
    execution_failure_criteria       c,o,
    notification_failure_criteria    c,o,
    dependency_period                24x7
}
I have multiple hosts defined, and I have a "Ping" service on all of them. There is no issue with applying configuration. Can you verify if all of your hosts in the "host_name directive have your service added to them?
Be sure to check out our Knowledgebase for helpful articles and solutions!
acentek
Posts: 123
Joined: Thu Jul 27, 2017 2:00 pm

Re: Service Dependency - Multiple Manage Host

Post by acentek »

Thank you for the quick reply, sorry it's been so long on my end.

So I tried adding a new Service Dependencies and sharing what I found. I have included a screenshot of the error I receive.

I'm trying to add Multiple Manage Hosts (host_name) along with the Manage Service (service_description) for each Manage Host. I can add either Manage Host on their own, with their own Manage Service (multiples even). But not more than one Mange Host at a time. That's when I get the error in the screenshot attached.

define servicedependency {
# config_name Customer SIP
dependent_host_name cityof____pbx
dependent_service_description SIP peers
host_name ####7CO01
service_description Customer AEONT/1-1-GE6 Status,Customer ONT 6828852/g3 Status
inherits_parent 1
execution_failure_criteria w,u,c,p,
notification_failure_criteria w,u,c,p,

Thanks!
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Service Dependency - Multiple Manage Host

Post by lmiltchev »

Is service 'xxxAEONT/1-1-GE6 Status' added to host 'xxxCO03'?

Go to the CCM > Service Dependencies > Edit, and see what you have around line 284. You should be able to fix the issue under the CCM by removing the offending host/service from your dependency config.
Be sure to check out our Knowledgebase for helpful articles and solutions!
acentek
Posts: 123
Joined: Thu Jul 27, 2017 2:00 pm

Re: Service Dependency - Multiple Manage Host

Post by acentek »

This is from /usr/local/nagios/etc/servicedependencies.cfg line 284

define servicedependency {
# config_name Customer SIP
dependent_host_name cityof____pbx
dependent_service_description SIP peers
host_name ###E7CO01
service_description Customer AEONT/1-1-GE6 Status,Customer ONT 6828852/g3 Status
inherits_parent 1
execution_failure_criteria w,u,c,p,
notification_failure_criteria w,u,c,p,
}

The error attached in the last Reply, only comes up when I try to and another Manage Host and along with it's Manage Service. The Manage Host is an E7 (example) fiber card and the Manage Service is a port from that card. So with multiple Manage Hosts the Manage Service is never going to match. I'm guessing when we do this, Nagios doesn't know how to match the right Manage Host with it's Manage Service (when there are multiples).

Example Config of what ours would look like with Multiple Manage Hosts:
define servicedependency {
# config_name Customer SIP
dependent_host_name cityof___pbx
dependent_service_description SIP peers
host_name ###E7CO01, ###E7CO03
service_description Customer AEONT/1-1-GE6 Status,Customer ONT 6828852/g3 Status,Customer ONT 4746997/g3
inherits_parent 1
execution_failure_criteria w,u,c,p,
notification_failure_criteria w,u,c,p,
}

I'm thinking we'll have to split this up somehow.

Thanks
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Service Dependency - Multiple Manage Host

Post by scottwilkerson »

So does host ###E7CO01 have a service Customer AEONT/1-1-GE6 Status?

Nagios doesn't think so.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Service Dependency - Multiple Manage Host

Post by lmiltchev »

Just to add to what @scottwilkerson said - you could use syntax as one below:

Code: Select all

define servicedependency {
    host_name                         HOST1,HOST2
    service_description               SERVICE1
    dependent_host_name               HOST3,HOST4
    dependent_service_description     SERVICE2
    other dependency directives ...
}
ONLY IF SERVICE2 is actually added to both, HOST3 and HOST4, AND SERVICE1 is added to both, HOST1 and HOST2.

Read more on time saving tricks for objects definitions here:
https://assets.nagios.com/downloads/nag ... dependency

You your services are not actually added to multiple hosts, you would need to define them separately. See more on service dependencies here:

https://assets.nagios.com/downloads/nag ... ncies.html
Be sure to check out our Knowledgebase for helpful articles and solutions!
acentek
Posts: 123
Joined: Thu Jul 27, 2017 2:00 pm

Re: Service Dependency - Multiple Manage Host

Post by acentek »

Thank you for the resources.

define servicedependency {
# config_name Customer SIP
dependent_host_name customer_pbx
dependent_service_description SIP peers
host_name ###E7CO01, ###E7CO03
service_description Customer AEONT/1-1-GE6 Status (##E7CO01),Customer ONT 6828852/g3 Status (###E7CO01),Customer ONT 4746997/g3 (###E7CO03)
inherits_parent 1
execution_failure_criteria w,u,c,p,
notification_failure_criteria w,u,c,p,
}

If things worked, above is what my config would look like.

So we have VoIP phones at multiple locations for the same customer. Each location has different E7 connections (host_name), Then the E7 would have it's own port(s) (service_description). The dependent_host_name is the same as it's a remote hosted PBX and the dependent_service_description is the service on the hosted PBX.

I'm not seeing an example from the provided links that would work for us.
Thanks
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Service Dependency - Multiple Manage Host

Post by lmiltchev »

define servicedependency {
# config_name Customer SIP
dependent_host_name customer_pbx
dependent_service_description SIP peers
host_name ###E7CO01, ###E7CO03
service_description Customer AEONT/1-1-GE6 Status (##E7CO01),Customer ONT 6828852/g3 Status (###E7CO01),Customer ONT 4746997/g3 (###E7CO03)
inherits_parent 1
execution_failure_criteria w,u,c,p,
notification_failure_criteria w,u,c,p,
}
If service Customer ONT 4746997/g3 (###E7CO03) exists only on host ###E7CO03, but not on host ###E7CO01, then the configuration would fail. Again, any service that you have on the "service_description" line should exist on ALL hosts, listed on the "host_name" line.

Since you can't use one service dependency (as the one shown above), you would need to split it.

Example:

Code: Select all

define servicedependency {
# config_name Customer SIP - 1
dependent_host_name customer_pbx
dependent_service_description SIP peers
host_name ###E7CO01
service_description Customer AEONT/1-1-GE6 Status (##E7CO01),Customer ONT 6828852/g3 Status (###E7CO01)
inherits_parent 1
execution_failure_criteria w,u,c,p,
notification_failure_criteria w,u,c,p,
}

Code: Select all

define servicedependency {
# config_name Customer SIP - 2
dependent_host_name customer_pbx
dependent_service_description SIP peers
host_name ###E7CO03
service_description Customer ONT 4746997/g3 (###E7CO03)
inherits_parent 1
execution_failure_criteria w,u,c,p,
notification_failure_criteria w,u,c,p,
}
Be sure to check out our Knowledgebase for helpful articles and solutions!
acentek
Posts: 123
Joined: Thu Jul 27, 2017 2:00 pm

Re: Service Dependency - Multiple Manage Host

Post by acentek »

Thank you lmiltchev, that is the answer I was looking for. Appreciate the input. I configured the 2nd dependency and should work good.

Thanks!
Locked