[Nagiosplug-devel] Check_http and web-based checks

Thomas Guyot-Sionnest dermoth at aei.ca
Sun Mar 11 04:51:09 CET 2007


On 10/03/07 09:42 PM, Ton Voon wrote:
> On 8 Mar 2007, at 17:27, Thomas Guyot-Sionnest wrote:
>> What do you think? Any objection? Comments? Better suggestions for  
>> switch
>> names? Arguably this could be granted a new check plugin, but I'd  
>> like to
>> use all check_http's features like SSL, authentication, regexps.
> 
> This sounds like a good idea. I guess it is effectively moving a lot  
> of the check logic from the plugin to the app server, which makes  
> sense in a lot of cases.
> 
> However, I'm tempted not to add this to check_http because the amount  
> of current options in this plugin is just too confusing. And the  
> thought of doing "hacks" to stop threshold alerts doesn't sound good.
> 
> Ideally, the "web connection stuff" should be moved "lower down", to  
> a lib/utils_http.c file, which is then available to other plugins,  

I think this is a wise idea. I haven't though of moving functions but
that could effectively allow a standalone check without duplicating too
Much code

> like your check_web (check_webapp? check_webapp_text?  
> check_webapp_response?).

To stay consistent with what we already have I'd suggest check_by_web.
And one thing that comes to my mind then is a simple extension to this
check(i.e. symlink), check_by_xmlrpc that could do xml-rpc calls and get
the answer wrapped in XML (i.e. return code, status test, extended
status text (multi-line, Nagios 3), performance data). That would be a
real "interface" to do web checks, though most ppl that can't ask a team
of experienced web developers will likely choose the "simpler" way of
doing web checks :).

> There is a sslutils.c, done by Sean Finney,  
> which handles a lot of the SSL connection stuff. Regexps is already  
> provided from gnulib. I guess authentication is an option to "move  
> lower".

I could try that, though I'm not totally sure what has to be done. As I
understand it I'd have to move function to a new file in /lib making
sure they don't use any global variables, create a header file with the
prototypes (is it written by hand or can be done automatically with some
command?) and include the header file in check_http.c. I guess there's
some additions to do in Makefile.in... Maybe configure.in too?

> FYI, Karl was thinking about using libcurl's library for providing  
> the web connection, rather than our own home grown one, though this  
> is a long way off as no-one has expressed an interest in getting it  
> working.

Maybe I could try that for check_web. Or use a library shared with
check_http so we can eventually replace the code in that library by
libcurl functions. While it would likely be safer to do so it might not
be wise to end up with a useless wrapper lib.

> Sorry, probably not the reply you wanted to hear :(

Quite the opposite! I'm open to suggestions and you made interesting ones :)

Thomas




More information about the Devel mailing list