Host and service dependencies

hi everyone, i have a problem with service &host dependencies.I configure these dependencies as per the nagios documentation,but it is not still working.
here is my configuration file:

host that runs nagios:192.168.x.x
client host:202.153.y.y -named as dev
router:192.168.i.i -named as Router
gateway:202.153.q.q -named as Gateway

host_dependencies.cfg:

define hostdependency {
dependent_host_name dev
host_name Router
execution_failure_criteria d,u,p
notification_failure_criteria d,u,p
}

define hostdependency {
dependent_host_name Gateway
host_name Router
execution_failure_criteria d,u,p
notification_failure_criteria d,u,p
}

service_dependency.cfg

define servicedependency {
dependent_service_description DNS
dependent_host_name dev
host_name Router
use generic-dependency
}

define servicedependency {
dependent_service_description FTP
dependent_host_name dev
host_name Router
use generic-dependency
}

define servicedependency {
dependent_service_description MYSQL
dependent_host_name dev
host_name Router
use generic-dependency
}

define servicedependency {
dependent_service_description PING
dependent_host_name dev
host_name Router
use generic-dependency
}

define servicedependency {
dependent_service_description PING
dependent_host_name Gateway
host_name Router
use generic-dependency
}

service_dependency_template.cfg

define servicedependency {
name generic-dependency
service_description PING
execution_failure_criteria w,u,c
notification_failure_criteria w,u,c
register 0
}
here nagios server monitoring services like dns,ftp,mysql etc on dev that is remote host.when the router b/w them goes down,nagios shows dev and Gateway in down state and also services related them in critical state eventhough they are working properly.
please ,help me someone
thanks in advance for any help

If your router that is between nagios and dev goes down, as you said, then you can’t get to dev right? Then of course, those services on dev will FAIL and be shown in the down state. Notifications might be suppressed though, due to your service/host dependancies.
Now, if what you would like, is that when you view service status on the nagios status.cgi webpage, that dev is shown as “unreachable” instead of down, then define a parent host for dev, in the hosts.cfg file, as the router. That way, nagios will see that dev is down. So it looks at the parent defined for dev in hosts.cfg. If router is the parent, then nagios will test “router”. If router is down, then “dev” is marked “unreachable” and "router will be marked “down”. If you then setup your notification criteria properly, you will only get one email about the “down” host, and not any for the “unreachable” ones. By using this parent definition, you can usually do away with the host/service depencies defintions. I find those far to complicated when you have over 1000 services to check.

thanks for ur reply.it is working by defining dev as the child to the Router.but according to the nagios documentation,if host or service on which another host or service depending gets failed,then the execution of that dependent host or service will be stopped for some time.But in this case,its not working like that,can u please give the solution for this

I’m not sure how you have things connected, but if it’s like this…
nagios box then Router then dev
If that is the case, then you have it backwards.
See the docs again and study it carefully.
nagios.sourceforge.net/docs/2_0/ … ncies.html