Re: [Nagios-devel] One service definition for all hosts

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] One service definition for all hosts

Post by Guest »

On pi±, maj 25, 2007 at 08:00:12 -0400, Thomas Guyot-Sionnest wrote:
> On 25/05/07 06:11 AM, Patryk Lasoñ wrote:
> > On pi±, maj 25, 2007 at 10:18:35 +0100, Simon Beale wrote:
> >> Under the service definition change hostgroup to hostgroup_name.
> >>
> >> Note a service can have both a host_name list and a hostgroup_name list,
> >> and the check will be run for both lists.
> >
> > Thanks a lot!
>
> What can also help is using "hostgroups" in host definitions instead of
> maintaining a list of hosts in the hostgroup definition. Together with
> templates you could get something like:
>
> define host
> name wns_host
> hostgroups wns
> use default_host
> register 0
> }
>
> define hostgroup{
> hostgroup wns
> alias WNS Cluster
> }
>
> #for each wns server:
> define host{
> host_name wnsXXX
> alias blah
> address 1.2.3.4
> use wns_host
> }
>
> define service{
> hostgroup_name wns
> service_description SSH
> check_command check_ssh
> use default_service
> }
>
> This is assuming that default_host and default_service are templates
> with all your defauklt configuration parameters. "register 0" tells
> Nagios that this is not an actual definition, but you can use it in
> other definition with "use TEMPLATE_NAME"

I prefer list of hosts in the hostgroup definition, cause adding
i.e 1000 nodes is just defining them and adding to the list.
Moving hosts between hostgroups is easier.

But I can be wrong, I'm not a Nagios expert :-).

Cheers,
Patryk





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