[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [hobbit] urlplus.pl http/https monitoring extension script
- To: hobbit (at) hswn.dk
- Subject: Re: [hobbit] urlplus.pl http/https monitoring extension script
- From: "Ralph Mitchell" <ralphmitchell (at) gmail.com>
- Date: Mon, 28 Jan 2008 12:43:21 -0600
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=jK7Zu1bE3SHrN52Z+wWXUwA5sYpH3HXbvDlu1E41DgY=; b=qNXPmTuA9aVd7VvdlyTpX3h1pHX44nQptHdIky76M65c2dTxMAthwf2+0c67gLBmYQuFNuOt+6aBdJb52QSoI/oqcq97+tAAExBJro1c2Pq606RJiJNZ1l2f5KwtDUWxicu8GQcLFxJfp3RxPp3gZJj30y6mO1c4u09KmP9BX/g=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=EcqMTzszd/d1H8nFKOLpTfi9uZ05Jj/L9DAyWTEik7wfPkXe3hC17wYVfZ2eH3GHbzw0VyyjCNrjH/NJ8HbWQ55UgUd+ZwLnOEMs2KDcUUK8gVL2Zbw9Lf6C7annAc+ZKKO/XjjfJMxF0fBZnrW7K97k/8ziPkT18/H4jrRDRWg=
- References: <29f517690801280754x304aee2u5acfd303523037a7 (at) mail.gmail.com> <997a524e0801280857o622c7c5cj94a5066c2359cfa (at) mail.gmail.com> <29f517690801280907o7ef37af6yf85093f97698b8c3 (at) mail.gmail.com>
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