I have my hosts and services set up and working nicely. Now I want to make sure I have dependencies (both kinds) configured properly so when something dies I get the proper message and ONLY the proper message.

There are for Linux boxes involved. I currently have the host/client dependencies configured this way:

Router: All remote systems are children off this.
ping: notification off

vamos-wentworth, this is running Nagios
http: notification on
smtp: notiffication off
imap: notification off
pop3: notification off

Boxes ivy,,; remote, children of router
notifications on

For my host (vamos-wentworth) system, I figured if any of the mail services are down, there’s no reason to bother sending a notification since it won’t work. The host system is also my personal mail server. I did not make it dependent on the router since the local service checks are still possible. I’m thinking of turning on notification for imap and pop3 but make them dependent on smtp. Even though I won’t be able to receive email alerts in my regular account, my cell phone can still receive text message alerts (I use the epager option of for that). One problem with that, however, an epager alert won’t work if the router is down. Basically I need to make a the smtp service dependent on the router host. Is that possible without making the entire box dependent on the router?

The remote boxes have various services running, e.g. http, ftp, smtp, imap, pop3, mysql, etc. The actual services vary by the box, though all of them are running http. I made these three dependent on the router since no tests will be possible if it goes down.

The big question is how do I avoid multiple alerts if a box goes down. Is this handled by the ‘check-host-alive’ option, or should I add a ‘ping’ service check for each of these and make the other services dependent on it?

FYI, I’ve removed the unreachable flag from all the services and contacts.

That’s what I have so far. I have more devices and services to add, but I thought I should make sure I’m setting things up properly before I go too far and discover I need to start over.

Recommendations on my configuration would be appreciated.


"I need to make a the smtp service dependent on the router host. Is that possible without making the entire box dependent on the router?"
yes. I can’t really paraphrase it much, so please read at your leisure. … ncies.html
Keep in mind, that your status map isn’t going to change much, if at all, but with service dependancies, it will accomplish just what you stated.

" The big question is how do I avoid multiple alerts if a box goes down." I’m pretty sure you will be notified that the “host” is down, and not 1 host down and 7 services. Try it and find out. Change the ip in the hosts.cfg file for that host and it will fail and so will the service checks.

You have good logic as far as I can tell. That’s just the way nagios should be used.


I stated one thing incorrectly. The remote systems have ‘router’ as parent, as opposed to being defined has dependent hosts.

Should I change that to hosts dependencies, instead?


No parent is fine in the hosts.cfg. You don’t need dependencies.cfg. If a service check fails, it then checks the host. If the host fails, it checks to see if there are any dependancies, if none, then it looks to see if there are any parents. In your case, there is a parent, so it will then see if the parent is down. If it is, then the host (the child host) is marked as UNREACHABLE. Now depending on how you have it setup, you may be notified about unreachable hosts, but I never do, since I don’t care about unreachable hosts. All I care about is the DOWN host. So that’s about it. Make sure you aren’t configed to get UNREACHABLE notifications and you should be fine. You should be getting ONE email about the router being down and that is all.
Edited Sun Aug 28 2005, 08:07AM ]


Host dependancies can really be a pain. I set this up once and I have hundreds of hosts. Problem with that is this. If I unplug my net cable from my nagios pc, then of course, everything is going to fail. If the nagios proc was in the process of checking, oh let’s say the very last dependant in the tree, it took around 20 minutes or longer before it walked the entire tree from top to bottom. That is far too long.

Parent/Child defintions in the hosts.cfg are just perfect and I see no use for dependancies due to that relationship already being used (for the most part) in the hosts.cfg file.


Ok, I think I have everything configured properly. The one hole in the system was if my nagios host went down, so I slapped nagios on one of the other servers and configured it to only monitor smtp on my primary nagios host.