Nagios Dependency failure Issue

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
dmccabe9
Posts: 3
Joined: Wed Sep 16, 2015 9:53 am

Nagios Dependency failure Issue

Post 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 
}


tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios Dependency failure Issue

Post 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.
Former Nagios employee
dmccabe9
Posts: 3
Joined: Wed Sep 16, 2015 9:53 am

Re: Nagios Dependency failure Issue

Post 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!
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Nagios Dependency failure Issue

Post 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
dmccabe9
Posts: 3
Joined: Wed Sep 16, 2015 9:53 am

Re: Nagios Dependency failure Issue

Post 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
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Nagios Dependency failure Issue

Post 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.
Locked