Re: [Nagios-devel] hosts in multiple hostgroups

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] hosts in multiple hostgroups

Post by Guest »


----------=BoundaryPyDog1190497615.25------
Content-Type: text/plain;
charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

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:
>=20
> define
hostgroup {
> hostgroup_name all-hosts
> =20
alias All UNIX Hosts
> members =20
hostadm01,hostfs01,hostps01
> members
>
hostop01,hostop02,hostop03,hostop04,hostop05,hostop06,hostop07
> =20
members =20
hostop08,hostop09,hostop10,hostop11,hostop12
> =20
members
>
hostop14,hostop15,hostop16,hostop17,hostop18,hostop19,hostop20,hostop21,
>
hostop23
> members =20
hostweb01,hostweb02,hostweb03,hostweb05
> members
>
hostjas00,hostjas01,hostjas02,hostjas03,hostjas04,hostjas05
> =20
members
>
hostapp01,hostapp02,hostdb01,hostdb02,hostdb03,hosteq01,hosteq02,hosteq0
>
3
> members =20
hostdoc01,hostdoc02,hostot01,host100
> }
>=20
>=20
>
define hostgroup {
> hostgroup_name some-hosts
> =20
alias Some UNIX Hosts
> members =20
hostop03,hostop05,hostop06,hostop07
> members
>
hostjas00,hostjas01,hostjas02,hostjas03,hostjas04,hostjas05
> =20
members hosteq02,hostot01,host100
> }
>=20
>
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 =20
generic-service
> hostgroup_name =20
all-hosts,!some-hosts
> service_description DISK
ALL
> check_command =20
check_nrpe!check_disk
> contact_groups =20
unix-admins
> }
> define service {
> use =20
generic-service
> hostgroup_name =20
some-hosts
> service_description DISK ALL
> =20
check_command check_nrpe!check_disk
> =20
contact_groups erp-admins,unix-admins
> }
>

> This cinfig passes preflight on 2.1, but gets the following
message on
> 3.0b3:
>=20
> Reading configuration
data...
>=20
> 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)
>=20
>=20
> 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?
>=20
> --=20
> Mike Stevens 

----------=BoundaryPyDog1190497615.25------
Content-Type: text/html;
charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

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> =20
alias All UNIX Hosts> members =20
hostadm01,hostfs01,hostps01> members>
hostop01,hostop02,hostop03,hostop04,hostop05,hostop06,hostop07> =20
members =20
hostop08,hostop09,hostop10,hostop11,hostop12> =20
members>
hostop14,hostop15,hostop16,hostop17,hostop18,hostop19,hostop20,hostop21,>
hostop23> members =20
hostweb01,hostweb02,hostweb03,hostweb

...[email truncated]...


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