[wplug] Software recommendation

Teodorski, Chris cteodorski at ppg.com
Fri Jun 13 12:50:25 EDT 2003


Well.....ultimately, I may end up doing that.....but I was hoping to not have too.....

-----Original Message-----
From: John Harrold [mailto:jmh17 at pitt.edu] 
Sent: Friday, June 13, 2003 11:43 AM
To: wplug at wplug.org
Subject: Re: [wplug] Software recommendation

Sometime in June Teodorski, Chris assaulted the keyboard and produced:

| Hello all....
|  
| I was wondering if someone could recommend a good piece of Open Source
| software.....currently we use an ancient copy of a product called
| Sitescope (not Open Source).....basically, what this product does is do
| an http GET to any web server (all of them being IIS so they need
| monitored CONSTANTLY) and look for some content to be returned, usually
| we just look for a specific word.  If the content returned varies from
| what is expected, it will either send us an e-mail or page us if it fails
| multiple times.....  However, it also offers the ability to authenticate
| via NTLM and Basic authentication.....so we use it on some sites to do
| more complex things than just an HTTP GET.........is their a Open Source
| product that offers this kind of functionality?


this seems like something that would be fairly easy to write in perl. i'm
pretty sure you can do authentication using lwp. here is a simple example
without auth.

#! /usr/bin/perl

use strict;
use warnings;
use LWP;

MAIN:
{
    my $ua = LWP::UserAgent->new;

    my $url = 'http://news.google.com/';
    $ua->agent("bob/0.1 " . $ua->agent);

    my $req = HTTP::Request->new(GET => $url);
    $req->header('Accept' => 'text/html');
    my $res = $ua->request($req);


    # look in $$res{_content} for some string
    if($$res{_content} =~ m#Linux#)
    {
    #if you find the string, preform some action or send yourself an email here
    print "news about linux on google\n";
    }

    exit 0;
}


-- 
--------------------------------------------------------------------------
                                               | /"\
 john harrold                                  | \ / ASCII ribbon campaign
      jmh at member.fsf.org                    |  X  against HTML mail
           the most useful idiot               | / \
--------------------------------------------------------------------------
 What difference does it make to the dead, the orphans, and the homeless,
 whether the mad destruction is brought under the name of totalitarianism or
 the holy name of liberty and democracy?
 --Gandhi
--------------------------------------------------------------------------
gpg --keyserver keys.indymedia.org --recv-key F65A739E
--------------------------------------------------------------------------



More information about the wplug mailing list