On Jan 28, 2008 11:07 AM, Gary Baluha <<a href="mailto:gumby3203@gmail.com">gumby3203@gmail.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d"><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="gmail_quote"><div>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...  :)<br>

</div></div></blockquote></div><br></div>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.<br>

<br>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 ;-)</blockquote>
<div><br>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.<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">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.<br>

</blockquote></div><br>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...<br>
<br>Ralph Mitchell<br><br>