Hi,<br> <br>Using REgExp and Object Templats is a key for optimizing maintenance.<br> <br>I read some good details on handling what needs to be configured and what can be inhereted and automatically associated in the current Nagios 3 Documentation.   I think much of the framework was in Nagios 2, but the documentaiton is a bit easier to read in nagios 3 so look at that for some tips. then check the nagios 2 docs to see if the option is also in there.<br>
 <br>A few years ago I converted a nagios 1.2 were all hosts and services were defined in a single to file to a scalable configuration similar to what was initialy described here.<br> <br>I found that if you have a need of suporting different clients with daily changes it was convient to have one Config directory for each clinet then in that directory have a single host file, and for each host a seperate Config file.<br>
 <br>on a host being removed it is just a matter of removing it from the Host file configuration and renaming its Config file.<br>on adding a new host is was only adding it to the host file, then adding copy an existing service file and then cut and past to get all the services defined. <br>
 <br>then maintain the entire directory substructer through CVS or some other version controle.<br>This as noted does get tedious to maintain, but it alows for customization of services per host without much thinking.<br>
The Disadvantage of this is the time involved for maintaining,  when there are few changes getting made.<br> <br>OTHER options using templates work well, <br>setting up Inheritance, using REG EXP as well as , other techniques using HostGroups all assist with orginizing the files but depending on skill levels  somtimes lead to less readability (Whle for other admins it would lead to easier maintenance)<br>
 <br>Hope this helps,<br> <br><br>
<div class="gmail_quote">On Tue, Jun 17, 2008 at 8:22 AM, Wheeler, JF (Jonathan) <<a href="mailto:J.F.Wheeler@rl.ac.uk">J.F.Wheeler@rl.ac.uk</a>> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="Ih2E3d">> -----Original Message-----<br>> From: nagios-users On Behalf Of Matthew Macdonald-Wallace<br>> Sent: 17 June 2008 13:14<br>><br>> I currently help maintain and monitor around 50 servers across various<br>
> parts of the UK using Nagios 2.  At the moment, we have a<br>configuration<br>> file for each host (%hostname%.cfg) and in that file we specify all<br>the<br>> services for the named host.<br>><br>> We are trying to reduce the number of configuration files as we take<br>
on<br></div>> more and more servers because there are a large number checks that we<br>
<div class="Ih2E3d">> need to be rolled out to all servers and we feel that we are<br>> duplicating our workload.<br>><br>> I'm open to ideas on how to achieve this however my thoughts were a<br>> setup along the lines of the following:<br>
><br>>  - A "master" host template is created in which all services are<br>defined<br>>    for a host.<br>><br>>  - If a check does not need to be run for a given host (for example it<br>>    is not a web server), a stanza is added to that particular host's<br>
>    config file that effectively tells nagios "don't check for this<br>>    service on this host"<br>><br>> I've tried defining all the services in a master templates file and<br>> this works perfectly however when I come to exclude certain services,<br>
I<br>> am at a loss on how to do it.<br>><br>> Initially I tried adding a stanza with the same service name and<br>> "register 0" as one of the options, however this didn't work.<br>><br>> We have used HostGroups in the past to achieve a similar goal, however<br>
> we ran into the issue that whilst we need to check the CPU Usage on<br>all<br>> of the servers, a few of the servers that we monitor can take a lot<br>> more of a beating than the majority.  This lead to us defining the CPU<br>
> checks on a per-host basis as if we defined it separately from the<br></div>> hostgroup for the more powerful servers we presented with a load of<br>
<div class="Ih2E3d">> errors regarding duplicate service names.<br>><br>> I hope I've made myself clear on what we're after and I look forward<br>to<br>> receiving your input on this.<br><br></div>One thing that I use in the configuration that I maintain is to have<br>
something like this:<br><br>define service{<br>       use                     generic-hung-mounts<br>       hostgroup_name          experiments<br>       hosts                   !lfc0448<br>       contact_groups          experiments<br>
}<br><br>where "lcg0448" is a host in host group "experiments" and I want to<br>apply the "generic-hung-mounts" check to all hosts in that group except<br>for "lcg0448".<br><br>This can lead to configuration like this:<br>
<br>define service{<br>       use                     check-pbs-offline<br>       hostgroup_name          workers<br>       hosts                   !lcg0614,!lcg0617,!lcg0618,!lcg0626<br>       contact_groups          tier1a<br>
}<br>define service{<br>       use                     check-pbs-offline<br>       hosts                   lcg0614,lcg0617,lcg0618,lcg0626<br>       contact_groups          tier1a,grid-team<br>}<br><br>where the only difference is that the hosts in the second definition<br>
have a second contact group.<br><br>HTH<br><br>Jonathan Wheeler<br>e-Science Centre<br>Rutherford Appleton Laboratory<br>
<div>
<div></div>
<div class="Wj3C7c"><br>-------------------------------------------------------------------------<br>Check out the new SourceForge.net Marketplace.<br>It's the best place to buy or sell services for<br>just about anything Open Source.<br>
<a href="http://sourceforge.net/services/buy/index.php" target="_blank">http://sourceforge.net/services/buy/index.php</a><br>_______________________________________________<br>Nagios-users mailing list<br><a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>
::: Messages without supporting info will risk being sent to /dev/null<br></div></div></blockquote></div><br>