Nagios 4: Registering object relationships in CGIs

Ton Voon ton.voon at opsview.com
Fri Jan 18 12:29:46 CET 2013


Hi Andreas,

On 16 Jan 2013, at 17:37, Andreas Ericsson wrote:

> Well, the story goes like this:
> We would *actually* want to use the recombobulate_*groups() functions,
> but those rely on find_*(), add_member_to_group() and a whole bunch of
> other functions which are inside #ifndef NSCGI (or #ifdef NSCORE).
> 
> Those functions bring in yet other functions and some of *those* live
> in other files. There are no functions anywhere that reside in the
> base/ directory which have to be linked to the cgi's no matter how far
> down the rabbithole you go, but it's a bit of a mess, really, and
> with the recent improbable-but-possible coredump issue in Nagios core
> I was forced to take a short hiatus from cgi issues and jump on that
> one instead.
> 
> Anyways; It's unlikely manageable to fix it the proper way. If you
> beat me to a hack that just iterates over the string elements inside
> register_*group(), I think I'll just take that patch instead and put
> a big fat "FIXME this is fugly and should use <solutionX> instead".

I think I've fixed this "properly", as properly as possible. Can you review?

Most of the changes are just #ifdefs moved to appropriate places. It seems that the parsing of objects.cache was done, just the expansion was not. I'm assuming that host/service dependency information is not required in the CGIs.

I've also included a test update which checks the CGI are returning the object information correctly. svn has marked t/610cgistatus.t as an application/x-troff so was not showing the diff correctly. I've included as a separate file. Can this be fixed in svn please.

Ton

-------------- next part --------------
A non-text attachment was scrubbed...
Name: nagios_fix_cgi_object_relationships.patch
Type: application/octet-stream
Size: 8201 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20130118/0d2a5fde/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nagios_cgi_object_tests.patch
Type: application/octet-stream
Size: 1547 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20130118/0d2a5fde/attachment-0001.obj>
-------------- next part --------------
------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list