<br><br><div class="gmail_quote">On Fri, Nov 27, 2009 at 4:28 PM, Marc Powell <span dir="ltr"><<a href="mailto:marc@ena.com">marc@ena.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im"><br>
</div>Different problem. If you're just wanting to ping them, the only purpose of the hostgroup would just be to group them for display in the GUI. You do need them in a hostgroup for that. They should be in a hostgroup anyway though, it's just better in the long-run.<br>
</blockquote><div><br>As mentioned, a script can generate such config files.  But would they work?  Has anyone tried listing<br>400+ hosts in a hostgroup?<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div class="im"><br>
</div>You'll first need to create a hostgroup{} definition to contain all the switches. - <a href="http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html#hostgroup" target="_blank">http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html#hostgroup</a><br>

<br>
define hostgroup{<br>
        hostgroup_name switches<br>
        alias All Your Switches Are Belong To Us<br>
}<br>
<br>
There are at least 3 ways to associate your switches with this hostgroup. I purposely avoided using a 'members' directive with a wildcard because you may one day monitor more than just these switches... I also didn't list out each switch in the members line either. You could do it, but it gets messy to manage by hand. A third way, and most flexible, is below.<br>

<br>
Next, you'll need to create a host{} definition for each of your switches. Your script-fu powers should come in handy here (i.e. a long one-liner awk should do it). Besides the usual required parameters, be sure to set the 'hostgroups' parameter to 'switches' to include it in the group above -- <a href="http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html#host" target="_blank">http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html#host</a><br>

<br>
define host{<br>
        host_name       cool_switch<br>
        alias           Freezer Switch<br>
        address         192.168.1.2<br>
        hostgroups      switches<br>
        check_command   check_fping ;(or whatever it's called)<br>
        check_period    24x7 ; (or whatever your schedule is)<br>
        check_interval  5 ; (or whatever your schedule is)<br>
        retry_interval  1 ; (or whatever your schedule is)<br>
        other required parameters   ...<br>
}<br>
<br>
</blockquote></div><br>I'm liking that the hosts don't need to be listed in a hostgroup but can be configured<br>as in your example. That is much more workable.<br><br>It looks like this will meet our needs nicely and I will be automating the generation<br>
of the configs for this part of our nagios set up.<br><br>Thanks for your help everyone...<br><br><br><br>