Jennifer Zelazny

Random and Opinionated Thoughts

Nagios Dependencies and Parents

Software
Posted by: Jennifer Zelazny | 1 Comment

Nagios 2.2 was released today so I decided to update my Nagios install at home which monitors my company’s server as well as Ken’s company server. I use Nagios, currently, to monitor ping, smtp, imap, pop, httpd, dns, and ftp. Just the basics. Once I get some free time, I am going to set up NPRE so I can monitor disk space, load, swap, etc. Since I had to update my install of Nagios (just run the same ./configure script I ran when installing it, make all, make install, make install-commandmode) I decided to finally figure out how to cut down the number of notifications I receive on a given day where my home internet goes down.

What I wanted: Nagios to send a SMS when any services of my server were unavailable as well as if my server was down.

What I did not want: Nagios to send me a SMS for every service when my local connection was down…after my local connection went back up. Not only was I getting messages that my local connection went down (after it went back up), I was also getting a text message for each service I was monitoring saying it was down, then recovered when really my local connection went down. Not good.

At first I thought I needed to use “host dependencies” in Nagios. The way I looked at it, I figured that my local router was dependent on the Comcast router, and my server was dependent on the my hosting company’s router, etc. While dependencies are helpful for more complicated setups (web servers who are dependent on database servers, etc).

What I really needed-and finally figured out-was to define “parents” for each of my hosts. After doing some research about dependencies and parents, I realized that if I set up parents, I could finally get the outage notifications and reporting I was looking for. For my setup, I have five hosts:

  1. My remote server
  2. Ken’s remote server
  3. Our hosting company’s router
  4. Comcast’s router
  5. My local router
  • My server has a parent: the hosting company’s router
  • Ken’s server has a parent: the hosting company’s router
  • The hosting company’s router has a parent: Comcast’s router
  • Comcast’s router has a parent: my local router
  • My local router does not have any parents because it is on the local network

So far, so good.

Helpful resources