Dynamically add/remove hosts on Nagios
Felipe Cecagno
fcecagno at gmail.com
Thu Mar 1 12:31:07 CET 2012
Thank you very much for your tips, guys!
I did the job using a passive service on Nagios that receives a message
whenever a new instance is UP. This message contains information such as IP
address and others. When Nagios get a message for this service, it calls an
event handler that modifies properly the hosts definition file. Also I have
a cronjob that checks if there's any modification in my config files, and
if is there any, it uses "killall -HUP nagios" to reload the config files.
Thank you again,
--
Felipe Cecagno
Mconf Development Team
https://mconf.org
On Sat, Feb 11, 2012 at 3:14 AM, Daniel Wittenberg <
daniel.wittenberg.r0ko at statefarm.com> wrote:
> That depends on your definition of dynamically. I would like to see it
> be able to add/remove hosts without requiring a restart of the service. I
> currently use puppet, but it’s still just updating files and then you have
> to restart to pickup the changes.****
>
> ** **
>
> Dan****
>
> ** **
>
> *From:* ranjib dey [mailto:dey.ranjib at gmail.com]
> *Sent:* Friday, February 10, 2012 11:42 PM
> *To:* Nagios Users List
> *Subject:* Re: [Nagios-users] Dynamically add/remove hosts on Nagios****
>
> ** **
>
> Have you considered using a configuration management tool like chef or
> puppet ? They address the exact usecase ****
>
> On Feb 10, 2012 7:08 AM, "Felipe Cecagno" <fcecagno at gmail.com> wrote:****
>
> Hi everybody,****
>
> ** **
>
> 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.****
>
> ** **
>
> 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.****
>
> ** **
>
> 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):****
>
> ** **
>
> "localhost Server UP 0 <new instance IP>"****
>
> ** **
>
> On Nagios I would create a new service on localhost to handle this passive
> check.****
>
> 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.****
>
> ** **
>
> My doubts are:****
>
> - is there a smarter way to do that (dynamically add and remove hosts from
> Nagios)?****
>
> - 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?****
>
> ** **
>
> Any thoughts/suggestions would be appreciated. :)****
>
> ** **
>
> Thank you in advance,****
>
> Best regards,
> ****
>
> ** **
>
> --****
>
> Felipe Cecagno****
>
> Mconf Development Team****
>
> https://mconf.org****
>
> ** **
>
>
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when
> reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null****
>
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when
> reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20120301/19f2813a/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list