Inheritance and templating question
Thomas Slutyer
nagios at kilala.nl
Fri Jun 16 06:23:38 CEST 2006
Hey :)
>> Create a hostgroup and apply the services to that group. Then all you
>> need to do is make sure new hosts belong to the right hostgroup.
>
> Would you mind giving me an example of this? I'm not sure exactly what
> you mean.... according to the documentation:
This is -exactly- how I'll be configuring our Nagios environment and
it's gonna save me a boatload of work :) (>300 hosts, >3000 checks)
What you do is this:
1. Define a set of service checks you would like to assign to multiple
hosts at once. For example: all Solaris boxen would need checks
regarding cpu load, ram, swap, partitions root/var/tmp and metastat. At
the top of the file, put all variables that are the same for each check
into a template. Make sure that all your checks use this template with
the "use" directive.
2. Create a service group called Solaris-checks.
3. Create a host group called Solaris-hosts.
Now comes the fun part:
4. Add all Solaris service checks to Solaris-checks.
5. Add all Solaris hosts to Solaris-hosts.
6. Add Solaris-hosts to each Solaris check as a subscriber by adding it
to the -template- at the top of the file.
And presto! You now have a group of hosts subscribed to a group of
services! The deal with the service groups is only for display purposes
BTW, but I thought I'd throw it in there :)
Want to add additional services to all these hosts at once? Just define
a service check and let it use the template. Want to add some Solaris
boxen to the network? Just add them to the Solaris host group.
Cheers!
Thomas
_______________________________________________
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