Cheshire Cat Computing

Software support and information
It is currently Sat May 25, 2013 6:45 pm

All times are UTC + 12 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Mon Oct 17, 2005 8:58 am 
Offline
User

Joined: Mon Oct 17, 2005 8:41 am
Posts: 3
In the demo system, there is an example with a HTTP reponse measurement (host-a). The code contains

Target[host-a-httpbase]: `httpGet.pl "http://x.y.5.102/"`

Where can we find the code for httpGet.pl?

Alternatively, I would be open to other ideas and solutions. I remember that the cricket version has a breakdown into connect time and download time.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 26, 2005 10:11 am 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 2921
Location: Auckland, New Zealand
I think that httpGet was included in the MRTG contrib directory. There may be other similar contributions available now that do what you are asking.

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 28, 2005 4:42 am 
Offline
User

Joined: Mon Oct 17, 2005 8:41 am
Posts: 3
In the contrib dir i can only find gethttp, which is a windows executable.
Just searching for httpget points to dozen different implementations, with different outputs.

THe one that looks most like it is from infodot.org but it does not seem to give the propoer results.

can you post your version?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 28, 2005 8:56 am 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 2921
Location: Auckland, New Zealand
httpGet.pl:

Code:
#!/usr/bin/perl
##########################################################
# SYNTAX ./httpGet.pl [http://www.myserver.com/page_to_get.htm]
# Version : 1.0 tom_vandevelde@yahoo.com
##########################################################
package Page;
$returnedRes;
my $TIMEOUT = 12;

sub get{
use LWP::UserAgent;

$get_page = @_[1];
$ua = LWP::UserAgent->new(timeout=>$TIMEOUT);

$request = new HTTP::Request('GET',$get_page);
$request->header(Expires=> "Mon, 26 Jul 1997 05:00:00 GMT");

my $response = $ua->request($request);

if($response->code =~ /^[23]\d\d/ ) {
        $returnedRes=$response->content;
        return 0;
} else {
        return $response->code;
}
}

sub size{
return length($returnedRes);
}


package main;
use Time::HiRes qw(usleep gettimeofday tv_interval);
my $page=Page;
$check_url= $ARGV[0];

($s, $usec) = gettimeofday;
$t0 = [gettimeofday];
$res=$page->get($check_url);
$elapsed1 = tv_interval ($t0);
if ($res==0){
     printf("%.3f\n",$elapsed1);
     printf("%.3f\n",$elapsed1);
     print "---\n";
     print "$check_url\n";
     exit (0);
}else{
    printf("UNKNOWN\n");
    printf("UNKNOWN\n");
    print "$res\n";
    print "$check_url\n";

}
exit(1);

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 28, 2005 11:53 pm 
Offline
User

Joined: Mon Oct 17, 2005 8:41 am
Posts: 3
Very funny. Same version as the one i have, but otherwise different in important places.
Works mucho better.

Tnx.

BTW you should give this software a better name, sysmon, or routers.cgi does not quit make it. What about shipmon, or netnavigator.?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 29, 2005 9:47 am 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 2921
Location: Auckland, New Zealand
pve wrote:
BTW you should give this software a better name, sysmon, or routers.cgi does not quit make it. What about shipmon, or netnavigator.?


Historical reasons... originally, there were 3 scripts, routers.cgi, servers.cgi and generic.cgi. They all had a similar look and feel but different abilities and defaults. Then they were merged into routers.cgi to create routers2.cgi (since routers.cgi had the greatest functionality).

I agree another name that doesn't have 'routers' in it would be better, although I'm not sure what to pick. Also, the 'routers2' name is becoming more well-known now so it would be a nuisance to change it.

Maybe when I go to version 3 (with proper multilevel collapsing menus, etc) I'll rebrand it.

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 12 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group