Page 1 of 1

Re: [Nagios-devel] Empty hostgroups ok, but not if services defined?

Posted: Wed Apr 09, 2008 12:07 am
by Guest
Hi again,

Marcus Fleige schrieb am 27.03.2008 15:35 Uhr:
> Hi Ethan, hi list,
>
> i got a little problem with empty hostgroups in my config.
> From Nagios Version 3.0rc3 and up, empty hostgroups are
> ignored by default. So far, so good, but when i define a
> service for an empty hostgroup, i get an error:
>
> Error: Could not expand hostgroups and/or hosts specified
> in service (config file '/etc/nagios/hostgroup-templates/
> services-hardware-accesspoint.cfg', starting on line 1)
>
> Is it possible to circumvent this error? My initial idea was
> to define a dummy host and make it a member of every hostgroup.
> But i think this is not the most elegant way to deal with this...
>

As this is bothering me, I'll try to make things clearer:

I'm using hostgroups to inherit services to hostgroup members, the
hostgroups are globally defined. Now, as i am building distributed
monitoring, some of these hostgroups are only used on the first
monitoring node and unknown to the second. This leads to a configuration
error on the second node, as the hostgroup is empty but there are still
services defined for it.

Per Definition, it is ok for Nagios if there is an empty hostgroup, it
is no problem if you define a hostgroup in your config without any
members ("0 Warnings, 0 Errors").

But if you define a service for that empty hostgroup, Nagios complains
about being unable to expand the hostgroup:

Error: Could not expand hostgroups and/or hosts specified in service
(config file
'/etc/nagios/hostgroup-templates/services-hardware-accesspoint.cfg',
starting on line 1)

For me, this is somewhat inconsistent behaviour. From my understanding,
Nagios should ignore the empty hostgroup completely including its
services instead of complaining.

What do you think about that? Thanks for your time,


Regards,

Marcus





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]