Re: [Nagios-devel] [PATCH] new feature: automatic services for hosts
Posted: Wed Nov 19, 2008 6:00 am
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Ignacio Goyret schrieb:
> Hi all,
> The attached patch is something that I've been using for a while
> without problems. Of course, all appropriate disclaimers apply.
>
> What does it do?
>
> The patch adds a new directive "services" to the "host" definitions.
> This new directive lists one or more "service" templates which
> are used to automatically create "service" definitions for
> the host.
>
> The following sequence:
>
> define host{
> host_name bogus
> address 192.168.1.254
> services template-check-disk-sda
> ...
> }
>
> is exactly equivalent to the following sequence:
>
> define host{
> host_name bogus
> address 192.168.1.254
> ...
> }
> define service {
> host_name bogus
> use template-check-disk-sda
> }
>
> I don't particularly like the location where the automatically
> created services are instantiated. If someone has a better idea,
> including how to deal with host templates, I'm all ears.
> May be it could be handled better as an step before resolving.
>
I've just did a fast read on your patch. Nice work that you patched the
documentiotion, too.
But to the patch: Why do you do it in a host atomic way while it might
be less work when doing it on hostgroups?
Sequence like this:
define hostgroup{
hostgroup_name x-linux-hosts
alias template hostgroup for linux hosts
register 0 # we don't want to see it but use it...
}
define service {
hostgroup_name x-linux-hosts # bind to a hostgroup
service_description Disk /
check_command check_disk!/
... other needed stuff ...
}
define host{
host_name a-linux-host
hostgroups x-linux-hosts
... other needed stuff ...
}
define host{
host_name n-linux-host
hostgroups x-linux-hosts
... other needed stuff ...
}
With something like this you control over the group membership which
services should be checked on a host.
Benefit:
Onetime service definitions
Onetime hostgroup defs
easy going after a little brainpower what service might be a standard
service in your environment.
Regards,
Hendrik
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
iEYEARECAAYFAkkjq3IACgkQlI0PwfxLQjnoKgCeLmxFwJiuafKU5xfdMaMKmyBO
7VQAn3qQlCd5LkzpdEvjR17A9p0xmFqU
=r6NY
-----END PGP SIGNATURE-----
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Hash: SHA1
Ignacio Goyret schrieb:
> Hi all,
> The attached patch is something that I've been using for a while
> without problems. Of course, all appropriate disclaimers apply.
>
> What does it do?
>
> The patch adds a new directive "services" to the "host" definitions.
> This new directive lists one or more "service" templates which
> are used to automatically create "service" definitions for
> the host.
>
> The following sequence:
>
> define host{
> host_name bogus
> address 192.168.1.254
> services template-check-disk-sda
> ...
> }
>
> is exactly equivalent to the following sequence:
>
> define host{
> host_name bogus
> address 192.168.1.254
> ...
> }
> define service {
> host_name bogus
> use template-check-disk-sda
> }
>
> I don't particularly like the location where the automatically
> created services are instantiated. If someone has a better idea,
> including how to deal with host templates, I'm all ears.
> May be it could be handled better as an step before resolving.
>
I've just did a fast read on your patch. Nice work that you patched the
documentiotion, too.
But to the patch: Why do you do it in a host atomic way while it might
be less work when doing it on hostgroups?
Sequence like this:
define hostgroup{
hostgroup_name x-linux-hosts
alias template hostgroup for linux hosts
register 0 # we don't want to see it but use it...
}
define service {
hostgroup_name x-linux-hosts # bind to a hostgroup
service_description Disk /
check_command check_disk!/
... other needed stuff ...
}
define host{
host_name a-linux-host
hostgroups x-linux-hosts
... other needed stuff ...
}
define host{
host_name n-linux-host
hostgroups x-linux-hosts
... other needed stuff ...
}
With something like this you control over the group membership which
services should be checked on a host.
Benefit:
Onetime service definitions
Onetime hostgroup defs
easy going after a little brainpower what service might be a standard
service in your environment.
Regards,
Hendrik
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
iEYEARECAAYFAkkjq3IACgkQlI0PwfxLQjnoKgCeLmxFwJiuafKU5xfdMaMKmyBO
7VQAn3qQlCd5LkzpdEvjR17A9p0xmFqU
=r6NY
-----END PGP SIGNATURE-----
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]