Service Dependencies

Carroll, Jim P [Contractor] jcarro10 at sprintspectrum.com
Thu Sep 26 18:12:54 CEST 2002


I'm not entirely certain what you're asking here.  There appear to be 2
questions:

1. How do I deal with the fun and joy of not having Nagios freak out when a
router between the Nagios host and the several hosts I'm trying to monitor
goes down?

2. How do I save myself from making many many virtually identical entries in
my services.cfg file?

Here's my take on it:

1. Use the 'parents' directive in hosts.cfg, thusly:

define host{
        host_name               www1
        use                     www-template
        alias                   www1 - PROD
        address                 10.11.12.13
        parents                 router1
        }

(My entry might appear to be a little terse, since my templates are rather
detailed.)

2. Create as many templates as you deem fit for your environment.  One
template per service is clearly excessive, but if you're hoping to have one
template period, you might be a wee bit on the optimistic side.  :^)
Personally, I've got a handful of templates which meet most of my needs, and
the few hosts which deviate from those requirements will merely require a
localization in that particular definition.  It's a bit of a balancing act.
If ever you realize, "Hey, I'm defining service XYZ just about everywhere,"
it's probably time to create a template for that service.

Another trick is to properly define your hostgroups, and leverage those in
your services.cfg file.  Use hostgroup_name instead of host_name where it
makes sense to do so.  That's a *major* savings in keystrokes, in my
experience.

Also, I'm not sure if you're doing what I was originally doing (until I
realized the redundancy), but you need not use a ping service if you're
already using check-host-alive in your hosts.cfg, since that's pinging your
host anyway.  The only instance I can see the need for using a ping service,
is if you have no other way of validating that the host is functioning as
desired (eg, it's not running any services, not telnetd, not ftpd, not sshd,
not httpd, etc).

Not trying to bust your chops here Andy; I think I may need another coffee.
;)

jc

> -----Original Message-----
> From: Andy [mailto:andy at droidmcse.com]
> Sent: Thursday, September 26, 2002 10:13 AM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] Service Dependencies
> 
> 
> Hey Gang,
> 
> Been using Netsaint for a while and switching over to nagios.
> 
> We have well over 400 hosts with many more to add.  Most of 
> them have at
> least the service of ping and I have run into the situation 
> where if the
> ping time on a router goes crappy, the devices that are depending on
> that box and the ones below it will also go down, I've seen 
> the need to
> create service dependencies on services between hosts with the
> check_ping service defined.
> 
> I created a home grown database to store the config files 
> that would be
> generated with the program needs to be restarted.  I queried the
> database to find all of the boxes that had the check_ping service and
> auto-created service dependencies for this and a couple other 
> services.
> 
> I'm trying to avoid a db for Nagios mainly because of the object
> orientedness of the config files that let you dramatically streamline
> the number of 'things' that you end up creating.
> 
> However, I'm kind of at a loss on how to create this setup quickly and
> easily.  I've already written a routine to look through the hosts.cfg
> file and file all of the parents and their associated 
> children.  Then I
> will have to pull the data from the services.cfg file to find all of
> those that have check_ping on both parent & host.  Then take that data
> and push it into a servicedependencies.cfg file.
> 
> I'm almost there, but I was just curious how other people 
> handle massive
> numbers of hosts.
> 
> I have a few other scenarios.  Like check_netsaint_client is just a
> check_tcp -p 1248.  If that fails, then I suppress the NT checks.  I'm
> just trying to keep the noise down mainly.
> 
> Great program and great forums!
> 
> Thanks!
> Andy
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> 


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf




More information about the Users mailing list