<p>Hi, </p><p>By scripting, you can create a new file for your new host (or
delete) and reload nagios.</p><p></p><p>Not smart...</p><p></p>
Felipe Cecagno <fcecagno@gmail.com> ha escrito:<br />
<br />
> Hi everybody,<br />
><br />
> This is the first time I'm posting on this mailing list, so I'm sorry if
my<br />
> question was already discussed here - I tried to find information about
it<br />
> on the mailing list and also on Nagios documentation + googling, but<br />
> couldn't find it.<br />
><br />
> Well, I'm setting up Nagios to monitor a group of servers in a cloud<br />
> environment. I decided to use passive checks, so I will have one Nagios<br
/>
> central monitor and all servers push statistics to Nagios using NSCA.<br />
> Everything is OK so far.<br />
><br />
> The problem is that I want to add and remove instances dynamically, I
don't<br />
> want to manually modify hosts.cfg on the central each time I change my<br
/>
> infrastructure. So my idea was that when a new instance gets up, it will<br
/>
> send to Nagios something like (always using NSCA):<br />
><br />
> "localhost     Server UP     0     <new instance IP>"<br />
><br />
> On Nagios I would create a new service on localhost to handle this
passive<br />
> check.<br />
> I've created a Python script (that uses pynag) to modify the hosts.cfg
file<br />
> in order to add and remove host definitions. When Nagios receives this<br
/>
> passive check, I would call the script to modify the hosts definition<br />
> files, and a cron job would execute every minute to look for
modifications<br />
> on hosts.cfg and make Nagios reload the definition files.<br />
><br />
> My doubts are:<br />
> - is there a smarter way to do that (dynamically add and remove hosts
from<br />
> Nagios)?<br />
> - since my "Server UP" service uses passive checks only, how do I
make<br />
> Nagios call my script to modify hosts.cfg every time it receives the<br />
> passive check?<br />
><br />
> Any thoughts/suggestions would be appreciated. :)<br />
><br />
> Thank you in advance,<br />
> Best regards,<br />
><br />
> --<br />
>    Felipe Cecagno<br />
>    Mconf Development Team<br />
>    <a target="_blank" href="https://mconf.org">https://mconf.org</a><br />
><br />
<br />

<br />
------------------------------------------------------------------<br />
2007 Jazztel - Jazz Telecom, S.A.U.         <a href="http://www.jazztel.com" target="_blank">http://www.jazztel.com</a><br />
Antes de imprimir este e-mail piense bien si es necesario hacerlo.<br />
<br />