<p>Have you considered using a configuration management tool like chef or puppet ? They address the exact usecase </p>
<div class="gmail_quote">On Feb 10, 2012 7:08 AM, "Felipe Cecagno" <<a href="mailto:fcecagno@gmail.com">fcecagno@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi everybody,<div><br></div><div>This is the first time I'm posting on this mailing list, so I'm sorry if my question was already discussed here - I tried to find information about it on the mailing list and also on Nagios documentation + googling, but couldn't find it.</div>


<div><br></div><div>Well, I'm setting up Nagios to monitor a group of servers in a cloud environment. I decided to use passive checks, so I will have one Nagios central monitor and all servers push statistics to Nagios using NSCA. Everything is OK so far.</div>


<div><br></div><div>The problem is that I want to add and remove instances dynamically, I don't want to manually modify hosts.cfg on the central each time I change my infrastructure. So my idea was that when a new instance gets up, it will send to Nagios something like (always using NSCA):</div>


<div><br></div><div>"localhost     Server UP     0     <new instance IP>"</div><div><br></div><div>On Nagios I would create a new service on localhost to handle this passive check.</div><div>I've created a Python script (that uses pynag) to modify the hosts.cfg file in order to add and remove host definitions. When Nagios receives this passive check, I would call the script to modify the hosts definition files, and a cron job would execute every minute to look for modifications on hosts.cfg and make Nagios reload the definition files.</div>


<div><br></div><div>My doubts are:</div><div>- is there a smarter way to do that (dynamically add and remove hosts from Nagios)?</div><div>- since my "Server UP" service uses passive checks only, how do I make Nagios call my script to modify hosts.cfg every time it receives the passive check?</div>


<div><br></div><div>Any thoughts/suggestions would be appreciated. :)</div><div><br></div><div>Thank you in advance,</div><div>Best regards,<br clear="all"><font><div><font><br></font></div><div><font>--</font></div>   </font><font>Felipe Cecagno</font><div>


   Mconf Development Team</div><div>   <a href="https://mconf.org/" target="_blank">https://mconf.org</a></div><br>
</div>
<br>------------------------------------------------------------------------------<br>
Virtualization & Cloud Management Using Capacity Planning<br>
Cloud computing makes use of virtualization - but cloud computing<br>
also focuses on allowing computing to be delivered as a service.<br>
<a href="http://www.accelacomm.com/jaw/sfnl/114/51521223/" target="_blank">http://www.accelacomm.com/jaw/sfnl/114/51521223/</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>