<div class="gmail_quote">On Thu, Mar 18, 2010 at 9:16 PM, mlrtime3 <span dir="ltr"><<a href="mailto:mlrtime3@gmail.com">mlrtime3@gmail.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;">
I've been using Nagios for awhile (since netsaint).  I'm not sure if<br>
this is possible, so I'm asking here.  I hope this makes sense.<br>
<br>
I currently have a service that I run for every host in a hostgroup. The<br>
service is executed by pulling a macro from the host definition<br>
$_HOSTPARAM1$. This works well for instances where there is a 1 to 1<br>
relationship between the host and the service. Meaning I'm just calling<br>
one instance of the service for each host.<br>
<br>
What I need to do is have multiple instances of this same service for<br>
some of the hosts depending on the macros on the host.<br>
<br>
For example<br>
<br>
HOST1 - SERVICE ($PARAM1$)<br>
<br>
HOST2 - SERVICE ($PARAM1$)<br>
      - SERVICE ($PARAM2$)<br>
<br>
HOST3 - SERVICE ($PARAM1$)<br>
      - SERVICE ($PARAM2$)<br>
      - SERVICE ($PARAM3$)<br>
<br>
<br>
I know I can modify my service to take in multiple parameters, but then<br>
the whole service would be down if any of the parameters caused the<br>
service instance to be down. I also can't create multiple service copies<br>
because the number of "PARAMS" is dynamic per host.<br>
<br>
Any ideas on how to do something like this?<br></blockquote><div><br>An ugly hack would be to have multiple sub-templates, one for each number of services a host can have (assuming the max is a reasonable number).<br><br>
However, I do not feel that the proper place for this logic is to somehow hack it into Nagios' definitions. Nagios does not support dynamic service/host definitions, other than modifying its configuration files and sending a SIGHUP, and changing that behavior causes all kinds of interesting issues that I'm not sure you want a program like Nagios handling.<br>
<br>A simple script should be enough to read your host definitions and generate the appropiate number of service definitions for each host. I know people who have their custom server management scripts output a Nagios config tree every N minutes, then send a SIGHUP to Nagios to have it re-read the configuration files. My opinion is that this would be the best way forward for you, too.<br>
 </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Thanks for any suggestions.<br>
<br>
------------------------------------------------------------------------------<br>
Download Intel&#174; Parallel Studio Eval<br>
Try the new software tools for yourself. Speed compiling, find bugs<br>
proactively, and fine-tune applications for parallel performance.<br>
See why Intel Parallel Studio got high marks during beta.<br>
<a href="http://p.sf.net/sfu/intel-sw-dev" target="_blank">http://p.sf.net/sfu/intel-sw-dev</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>
</blockquote></div><br><br clear="all"><br>-- <br>Martin Melin<br><br>May your delusions be benign and your compulsions have utility<br>____________________________<br>op5 AB<br><a href="http://www.op5.com">http://www.op5.com</a><br>
<br><a href="http://www.op5.org/">http://www.op5.org/</a><br><a href="http://www.op5.com/op5/products/network-monitor/nagios/">http://www.op5.com/op5/products/network-monitor/nagios/</a> <br>