hosts in multiple hostgroups

Ints intsm at hot.ee
Sat Sep 22 23:46:55 CEST 2007


I have, in fact, the very same problem, but  I just added a 
line to exclude that specific host  (so technically it was
double-excluded) and it didn't cry at me anymore. For some reason, only
the 1st host (when listed alphabetically) generates that problem as I
didn't need to exclude any other hosts in a sub-group.


>
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 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20070923/57dc107e/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
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/
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list