Can you define an empty hostgroup?

Samuel P Howard nagios at GMxTechnologies.com
Sat Aug 19 04:07:31 CEST 2006


ARG!

I had it that way, but must not have had the host defining the 
hostgroups line yet ... I went around and around and around and never 
hit the right combination ... sad.

OK, now that all of my hosts in each directory have a hostsgroup entry, 
and my main customer.cfg has the skeleton definition, all is working.

What threw me off was in the documentation, "members" is listed as a 
*required* directive.  So, not a bug in the software, but a bug in the 
documentation (sort of).  I tried all sorts of crazy stuff like 
"members" with no list, "members 0", "members null", etc ... and even 
had it commented out, just not when a hostgroups line was in a host, 
apparently.  Oh well.

Just in case anyone cares, what I've finally done is create a directory 
structure like this under /usr/local/nagios/etc:

    client/
       {client_name}/
       {client_name}.cfg
          devices/

In the client_name.cfg, I have defined the following stuff specific to 
each client (prefixed "{client_name}_" to the beginning of the standard 
section identifier):
    timeperiod
       {client_name}_24x7 (in case their version of 24x7 isn't *really* 
24x7)
    commands
       {client_name}_notify-by-email          (so we can customize the 
e-mail template)
       {client_name}_host-notify-by-email     (so we can customize the 
e-mail template)
       {client_name}_check-host-alive         (so we can adjust the 
thresholds)
       {client_name}_check-ping               (so we can adjust the 
thresholds)
    contact
    contactgroup
    host
       {client_name}_host                     (define the generic host 
on a per-client basis)
    service
       {client_name}_ping                     (so we can adjust the 
thresholds)
    hostgroup
       {define a customer specific hostgroup}

Then, in the "devices/" directory, I create 1 file per host (to make it 
easier to build a web interface to create/remove/modify hosts) with the 
following:

    host             (include the customer hostgroup from the config above)
    hostextinfo      (with a "notes" link to the cacti site with the 
host's graphs)

I'm sure it will need a bit more tweaking, but I *think* I'm headed in 
the correct direction.  This should let us add additional clients/groups 
such that they can see only their own stuff, and do some of their own 
configuration, etc.

Thanks!
Sam

> No, you must create the skeleton hostgroup as below. It's not a bug,
> that's how it's designed. It can't auto-create it as the other required
> hostgroup element, alias, would be unknown.
>
> define host {
>         use                     generic-host
>         host_name               tnops-redacted
>         alias                   Redacted - 4774
>         address                 redacted
>         contact_groups          tnops
>         hostgroups              tnops-williamson,all-middle-tn
> }
>
> define hostgroup {
>         hostgroup_name  tnops-williamson
>         alias           Williamson Tennessee
> }
>
> define hostgroup {
>         hostgroup_name  all-middle-tn
>         alias           All Middle Tennessee
> }
>
> --
> Marc
>

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list