Page 1 of 1

Nagios Dependency failure Issue

Posted: Wed Sep 16, 2015 9:58 am
by dmccabe9
Hi appreciate if someone can help,

I am having dependency failures, I am trying to achieve the following:


1. Create a ping for AD3 (VPN server)
2. test-app-servers to be dependent on ping for Ad3 (VPN SERVER_
3, IF AD3 (VPN SERVER) ping does not to spam email all servers in test-app-servers


ERROR:
Error: Could not find any host matching 'test-app-servers' (config file '/usr/local/nagios/etc/config/servicedepend/service-dependencies.cfg', starting on line 1)
Error: Could not find a service matching host name 'ad3.corp.globoforce.com' and description 'PING-AD3' (config file '/usr/local/nagios/etc/config/servicedepend/service-dependencies.cfg', starting on line 1)
Error: Could not expand master service(s) (config file '/usr/local/nagios/etc/config/servicedepend/service-dependencies.cfg', starting at line 1)
Error: Could not expand dependent service(s) (at config file '/usr/local/nagios/etc/config/servicedepend/service-dependencies.cfg', starting

CONFIG:

Code: Select all

/usr/local/nagios/etc/config/servicedepend/service-dependencies.cfg
=========================================================

define servicedependency {
       dependent_hostgroup_name         ping-ad3
       dependent_service_description    PING-AD3
       host_name                        test-app-servers
       service_description              TEST-APP-SERVERS
       execution_failure_criteria       w,u,c,p
       notification_failure_criteria    w,u,c
       dependency_period                24x7
}


/usr/local/nagios/etc/objects/windows/ad3.cfg
=======================================


define host
        use generic-host
        host_name ad3.corp.mydomain.com
        hostgroups  ping-ad3
}


/usr/local/nagios/etc/config/services/pingvpn.cfg
=========================================

define service{
        use                     local-service
        hostgroup_name          test-app-servers
        service_description     PING-AD3
        check_command           check_ping!1000.0,33%!1500.0,66%
}



/usr/local/nagios/etc/objects/testservers/test-appservers.cfg
==================================================


define host {
use testenv_generic-vm-host
host_name test-app2-01.corp.mydomain.com
hostgroups test-app-servers 
}



Re: Nagios Dependency failure Issue

Posted: Wed Sep 16, 2015 5:08 pm
by tmcdonald
Do you have a host named test-app-servers? If not and you just have a group, you probably mean to use hostgroup_name in the dependency instead of host_name.

Re: Nagios Dependency failure Issue

Posted: Thu Sep 17, 2015 2:45 am
by dmccabe9
Thanks for the feedback I changed:

Code: Select all

/usr/local/nagios/etc/config/servicedepend/service-dependencies.cfg
====================================================================

define servicedependency {
       dependent_hostgroup_name         ping-ad3
       dependent_service_description    PING-AD3
       hostgroup_name                   test-app-servers
       service_description              TEST-APP-SERVERS
       execution_failure_criteria       w,u,c,p
       notification_failure_criteria    w,u,c
       dependency_period                24x7
}


ERROR:

Error: Could not find a service matching host name 'test-web1-01.corp.mydomain.com' and description 'TEST-APP-SERVERS' (config file '/usr/local/nagios/etc/config/servicedepend/service-dependencies.cfg', starting on line 1)
Error: Could not find a service matching host name 'ad3.corp.mydomain.com' and description 'PING-AD3' (config file '/usr/local/nagios/etc/config/servicedepend/service-dependencies.cfg', starting on line 1)
Error: Could not expand master service(s) (config file '/usr/local/nagios/etc/config/servicedepend/service-dependencies.cfg', starting at line 1)
Error: Could not expand dependent service(s) (at config file '/usr/local/nagios/etc/config/servicedepend/service-dependencies.cfg', starting on line 1)
Error processing object config files!

Re: Nagios Dependency failure Issue

Posted: Thu Sep 17, 2015 10:11 am
by jdalrymple
I think you have this all backwards...

Do the app servers depend on the VPN

or

Does the VPN depend on the app servers? <-- this is what you have

Either way - this would be better troubleshooted if you sent us your service deefinitions. The complaint by Nagios is that the following don't exist:

Code: Select all

define service {
     host_name               test-web1-01.corp.mydomain.com
     service_description     TEST-APP-SERVERS
     ...
}

and

Code: Select all

define service {
     host_name               ad3.corp.mydomain.com
     service_description     PING-AD3
     ...
}
Can you verify if nagios is right/wrong? It's usually right :D

Re: Nagios Dependency failure Issue

Posted: Tue Sep 22, 2015 8:59 am
by dmccabe9
I probably am doing this backwards:(

I need test-app-servers (List of servers) to be dependent on ping-ad3

Basically if the host goes down on ping-ad3 (which is a vpn) then all the servers in test-app-servers usually spams with 100s of texts messages.

At the moment nothing is showing in the Nagios admin service group:
=============================================================

Code: Select all

/etc/nagios/config/servicedepend/service-dependencies.cfg:
==========================================================

define servicedependency {
       dependent_hostgroup_name         test-app-servers
       dependent_service_description    TEST-APP-SERVERS
       hostgroup_name                   ping-ad3
       service_description              PING-AD3
       execution_failure_criteria       w,u,c,p
       notification_failure_criteria    w,u,c
       dependency_period                24x7
}

/etc/nagios/config/hostgroups.cfg
=================================

define hostgroup {
        hostgroup_name  ping-ad3
}

define hostgroup {
        hostgroup_name  test-app-servers
}


/etc/nagios/objects/windows/ad3.cfg
======================================
define host {
        use generic-host
        host_name ad3.corp.mydomain.com
        hostgroups ping-ad3
	    check_command                  check_ping!1000.0,33%!1500.0,66%   
	    check_interval                  10
		max_check_attempts              1
 
} 

/etc/nagios/config/services/pingvpn.cfg
=======================================

define service{
        use                     local-service
		host_name ad3.corp.mydomain.com
        service_description     PING-AD3
        check_command           check_ping!1000.0,33%!1500.0,66%
}



/etc/nagios/objects/testservers/test-appservers.cfg    <== servers to be dependent on ping-ad3
====================================================

define host {
use testenv_generic-vm-host
host_name test-app2-01.corp.mydomain.com
hostgroups test-app-servers
}


define host {
use testenv_generic-vm-host
host_name test-res1-01.corp.mydomain.com
hostgroups test-app-servers
}


Thank you kindly

Re: Nagios Dependency failure Issue

Posted: Tue Sep 22, 2015 11:16 am
by jdalrymple
Again - the service dependency and/or it's proper definition is immaterial to your problem. Your problem is that the services simply don't exist. You cannot create a service dependency on a service or FOR a service that don't exist.

I posted samples of what Nagios is looking for. Can you verify that you have something like what I posted? If not, create it.