cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: [First Post] Curl & Nagios

From: Ben Madsen - Mailing List <bmadsen_at_ecbridges.com>
Date: Fri, 28 Oct 2005 16:18:05 -0700

Well, to echo Daniel's comments and provide a little bit more insight, I
do have some experience in both using and writing Nagios plugins.

Basically, Nagios is designed such that you can use any script or
compiled application as a plugin. The only requirement is that it
returns status in a predefined way (which I'd have to lookup, and is not
directly relevant for this conversation). Essentially, it's up to the
plugin author (the programmer) to define how he wants to come about his
result of status between choices of UP, WARNING, DOWN, etc. Whatever
the script does in the mean time, the main Nagios engine and plugin API
don't care about.

In this case, you would want to use Curl in such a fashion as to emulate
an "expected" HTTP session with cookies and form posts and such.
Anywhere the plugin's scripted interface deterred from expected, you
would then classify that as an error condition. If the error was
serious enough, bump the return code to that of DOWN and return. If it
was an error only warranting a WARNING message, then return that code.

If I am correct (and I think I am as I have thought about doing this
kind of plugin more than once), you would probably want to do a libcurl
or some kind of curl API implementation so you could do multiple steps
and paths, while keeping the session state and being able to track
status within the workflow of the script. Again though, it's up to you
as the implementor to determine how the session is tested and what
constitutes what level of response from the script to the Nagios engine.

My $0.02... Hope it helps.
Regards,
Ben Madsen

Marcel Mitsuto Fucatu Sugano wrote:

>Hi everyone...
>
>First post here. I'm looking for documentation about ways of using curl
>to automate web login process (as well as other types of transactions
>too), in order to create some Nagios Plugin to monitor all sorts of web
>applications. This "dynamic-transaction-monitoring" require the
>flexibility and completeness of curl, as the engine behind a Nagios
>Plugin, foreseeing the need of "http-cookied-session", and the need of
>an script that could pass through a whole auth, post some form, and
>analyse the results process.
>
>Does anyone here ever heard about creating a Nagios Plugin for
>transaction monitoring with curl? Any thoughts?
>
>Thanks In Advance.
>
>
Received on 2005-10-29