<div>Hello</div>
<div> </div>
<div> </div>
<div>i dont know if it helps but there is a plugins called check_find_new_hosts at nagiosexchange</div>
<div><a href="http://www.nagiosexchange.org/Networking.53.0.html?&tx_netnagext_pi1[p_view]=275">http://www.nagiosexchange.org/Networking.53.0.html?&tx_netnagext_pi1[p_view]=275</a><br> </div>
<div>basically it adds new hosts to nagios when it runs. i did not test it and im not sure about services but im pretty sure it can be extended</div>
<div>to do what you need</div>
<div> </div>
<div>Hope it helped</div>
<div>Moshe Sharon<br> </div>
<div><span class="gmail_quote">On 5/11/06, <b class="gmail_sendername">Sam Stickland</b> <<a href="mailto:sam_mailinglists@spacething.org">sam_mailinglists@spacething.org</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Thanks for your reply Bob.<br><br>Comments are inline.<br><br>> -----Original Message-----<br>> From: 
<a href="mailto:nagios-devel-admin@lists.sourceforge.net">nagios-devel-admin@lists.sourceforge.net</a> [mailto:<a href="mailto:nagios-devel-">nagios-devel-</a><br>> <a href="mailto:admin@lists.sourceforge.net">admin@lists.sourceforge.net
</a>] On Behalf Of Bob Ingraham<br>> Sent: 11 May 2006 15:08<br>> To: Sam Stickland<br>> Cc: <a href="mailto:nagios-devel@lists.sourceforge.net">nagios-devel@lists.sourceforge.net</a><br>> Subject: RE: [Nagios-devel] Defining services at runtime
<br><br><br>> ><br>> > * Create for existing services<br>> ><br>> > I notice that Nagios-db gets it's configuration information from the<br>> > following callback:<br>><br>><br>> Which callback were you thinking of?
<br><br>The message got sent too early first time around. The second message didn't<br>mention this :)<br><br>> > * Create a new service check<br>> ><br>> > nebstructs.h defines a struct "nebstruct_service_check_struct". However,
<br>> > this seems to be the only place this struct is referred to in the header<br>> > files. How do I pass a completed struct to Nagios?<br>> ><br>> > It looks reality straight forward to work out how to fill out this
<br>> struct,<br>> > but "char *host_name;" could be a problem. The plugin is only going to<br>> > know<br>> > the host address, so I'll need a way to get a hostname from an address.<br>>
<br>> You can't add a service to Nagios using the<br>> nebstruct_service_check_struct; in fact you can't add anything to Nagios<br>> using any of the nebstruct_* structure.  They are one-way, informational<br>> only - passed down to your module.  When your module returns, Nagios never
<br>> examines the structure that it passed to you for changes.<br>><br>> The way to add a service from within a NEB module would be to call the<br>> internal "add_service()" function.  It's the same one that Nagios uses to
<br>> add services during configuration load.<br>><br>> The API for the add_service() function is:<br><br>OK, that makes sense. Of course, the need to get the host_name from the host<br>address still remains.<br>
<br>> However, you have a significant problem with your above strategy:<br><br><br>> So, you have a timing issue:<br><br>> One strategy might be to have your service_check either:<br>><br>> - Return the list of services it wants created as a result string
<br>> (although, you might not have enough space to do so on one line,) and then<br>> have your callback routine create services based on the contents of the<br>> results string, or<br>><br>> - Your service check writes it results to a temp file or IPC message queue
<br>> or some such, and your callback routine then reads this file (or from the<br>> message queue,) and creates the services based upon that information<br>> source.<br>><br>> I'm sure that there are many other ways to do this...
<br>><br>> Anyway, anyone please correct me if I'm off on any of this, but that's how<br>> I understand the way the callback routine mechanism works.<br><br>Yes, I understand the issue here. The code here<br><br>
<a href="http://www.louisville.edu/~tjande01/nagios/exthandler.c">http://www.louisville.edu/~tjande01/nagios/exthandler.c</a><br><br>uses a schedule_new_event callback that executes once a second in order to<br>handle the socket code. Personally, I'd prefer to spawn a new thread to
<br>handle the socket communication with the check-command. This ties into the<br>last thing that got missed off my original email that is:<br><br>* Submit passive service check results<br><br>The old school method of doing this is via the external command file, but I
<br>presume the new API has a method of doing this? There's some functions in<br>broker.h that look like likely candidates, but they don't even have basic<br>comments ;) (e.g. broker_service_check).<br><br>The check-command that reports back to the broker module would only return
<br>state based on its ability to reach the switch and to talk to the broker<br>module.<br><br>Sam<br><br><br><br>-------------------------------------------------------<br>Using Tomcat but need to do more? Need to support web services, security?
<br>Get stuff done quickly with pre-integrated technology to make your job easier<br>Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo<br><a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642">
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642</a><br>_______________________________________________<br>Nagios-devel mailing list<br><a href="mailto:Nagios-devel@lists.sourceforge.net">
Nagios-devel@lists.sourceforge.net</a><br><a href="https://lists.sourceforge.net/lists/listinfo/nagios-devel">https://lists.sourceforge.net/lists/listinfo/nagios-devel</a><br></blockquote></div><br>