[hobbit] urlplus.pl http/https monitoring extension script

Ralph Mitchell ralphmitchell at gmail.com
Mon Jan 28 19:43:21 CET 2008


On Jan 28, 2008 11:07 AM, Gary Baluha <gumby3203 at gmail.com> wrote:

> That looks like the kind of thing I've been doing in bash scripts using
> > curl.  I've thought about switching to a different language, but I don't
> > know enough Perl to get started.  Maybe I'll take another look...  :)
> >
>
> For the kind of work that this script is doing, there weren't really any
> reasons to require perl over shell script.  I picked perl because I've been
> doing a lot of perl scripting lately, but also because it should be easier
> to convert the perl code to C at some point, if I feel that is necessary.
>
> As far as speed goes, I've found there isn't much of a difference between
> perl and shell, though in certain cases I've seen shell script a little
> quicker.  I'm sure the usual "your mileage may vary" quote is worth throwing
> out at this point ;-)


Yeah, my mileage varies - I've got around 100 scripts running checks on 655
hosts (the number varies daily) generating over 2700 messages.  I've got a
fairly steady load average of around 6.5 on a single-cpu 733MHz DL380.  I'm
supposed to be getting a faster system, while at the same time the company
keeps trying to "replace Hobbit/Big Brother with XXX", so I'm not holding my
breath on that.

I'm not doing anything really perl-crazy with this script, and I think I
> have it pretty well commented, so it should be a decent reference if you
> want to get in to perl.  Either way, I'd be interested in comparing notes in
> what our two scripts do, and possibly combining features from yours into
> this one.
>

I think most of my scripts are fairly simple-minded - grab a page, grep for
something, flag red/green - but some of them dig a lot deeper.  Login,
navigate through some pages, logout again.  I won't name the worst one I
have to deal with, but the first page does a redirect using a "meta refresh"
tag, the next page does "self.location=/web/guest/home" in javascript,
followed by "window.location=/c/portal/login"  to get to the login page.
After posting the login form, I get another "self.location" that takes me to
a page containing another form that self-submits via onLoad in the <body>
tag.  After all that it's relatively trivial to extract the logout url to
exit cleanly from the site.  Loads of fun...

Ralph Mitchell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20080128/d95b4c19/attachment.html>


More information about the Xymon mailing list