hosts in multiple hostgroups

Stevens, Michael Michael_Stevens at affymetrix.com
Fri Sep 21 22:45:04 CEST 2007


I've discovered what seems to be an inconsistency between Nagios 2.1 and
3.0b3.  I have a few host groups defined, one containing all my hosts,
and the second a subset:

define hostgroup {
        hostgroup_name  all-hosts
        alias           All UNIX Hosts
        members         hostadm01,hostfs01,hostps01
        members
hostop01,hostop02,hostop03,hostop04,hostop05,hostop06,hostop07
        members         hostop08,hostop09,hostop10,hostop11,hostop12
        members
hostop14,hostop15,hostop16,hostop17,hostop18,hostop19,hostop20,hostop21,
hostop23
        members         hostweb01,hostweb02,hostweb03,hostweb05
        members
hostjas00,hostjas01,hostjas02,hostjas03,hostjas04,hostjas05
        members
hostapp01,hostapp02,hostdb01,hostdb02,hostdb03,hosteq01,hosteq02,hosteq0
3
        members         hostdoc01,hostdoc02,hostot01,host100
}


define hostgroup {
        hostgroup_name  some-hosts
        alias           Some UNIX Hosts
        members         hostop03,hostop05,hostop06,hostop07
        members
hostjas00,hostjas01,hostjas02,hostjas03,hostjas04,hostjas05
        members         hosteq02,hostot01,host100
}

Now, I'd like to monitor disk services and send email to 'erp-admins' if
there is a problem on one of the 'some-hosts':

define service {
        use                     generic-service
        hostgroup_name          all-hosts,!some-hosts
        service_description     DISK ALL
        check_command           check_nrpe!check_disk
        contact_groups          unix-admins
}
define service {
        use                     generic-service
        hostgroup_name          some-hosts
        service_description     DISK ALL
        check_command           check_nrpe!check_disk
        contact_groups          erp-admins,unix-admins
}

This cinfig passes preflight on 2.1, but gets the following message on
3.0b3:

Reading configuration data...

Error: Service 'DISK ALL' on host 'host100 has already been defined
Error: Could not register service (config file
'/usr/local/nagios/etc/services.cfg', starting on line 65)


So, host100 exists in both all-hosts, and some-hosts.  But it should be
excluded with the !some-hosts statement.  Is this broken, or am I doing
something wrong?

-- 
Mike Stevens


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/




More information about the Developers mailing list