Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Quick and Dirty Seti@home Server Status

by Mr. Muskrat (Canon)
on Apr 04, 2003 at 22:14 UTC ( [id://248201]=CUFP: print w/replies, xml ) Need Help??

Perform a quick and dirty check of the Seti@home stats and data servers.
#!/usr/bin/perl -w use strict; use LWP::Simple; my $address = $ARGV[0] || 'muskrat@mindless.com'; my ($data,$cgi); $data = $cgi = "down"; my $doc = get 'http://setiathome.ssl.berkeley.edu/fcgi-bin/fcgi?email= +'.$address.'&cmd=user_stats_new'; if ($doc =~ m/$address/is){ $cgi = "up"; } $doc = get 'http://setiathome.ssl.berkeley.edu/sstatus.html'; if ($doc =~ m/up and running/is){ $data = "up and running"; } if ($doc =~ m/dropping connections/) { $data .= " but dropping connections"; } my $gmt = gmtime(); print "As of $gmt, the stats server is $cgi and the data server is $da +ta.";

Replies are listed 'Best First'.
Re: Quick and Dirty Seti@home Server Status
by vagnerr (Prior) on Apr 05, 2003 at 13:26 UTC
    Nice, although you can extract more interesting data than that with Seti's XML interface. I have a couple of quick and nasty scripts that return information on your standings. The first script gives your individual rank, the second script shows the status of the team of your choice. Enjoy.

    getstat.pl (single user)
    #!/usr/bin/perl -w # ==================================================================== +== # Project: Seti@Home # Project Leader: Peter Wise # -------------------------------------------------------------------- +-- # Program name: GetStat # Program state: pre-alpha # Program notes: Pull stats on a seti user using XML interface # # Program filename: getstat.pl # -------------------------------------------------------------------- +-- # Version Author Date Comment # ~~~~~~~~ ~~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~ # 1.0 P.J.Wise 10/02/2003 Initial version # # -------------------------------------------------------------------- +-- # CVS: # ID: $Id: getstat.pl,v 1.1 2003/02/10 02:32:04 peter Exp $ # Author: $Author: peter $ # Date: $Date: 2003/02/10 02:32:04 $ # Revision: $Revision: 1.1 $ # # -------------------------------------------------------------------- +-- # Notes: # ~~~~~~ # # ==================================================================== +== use strict; use LWP::Simple qw/get/; use XML::Simple; use Data::Dumper; #Config my $TARGET_EMAIL = $ARGV[0] || 'youremail@yourdomain'; my $TARGET_URL = "http://setiathome.ssl.berkeley.edu/fcgi-bin/fcgi?cmd +=user_xml&email=$TARGET_EMAIL"; print "Getting data from server..."; if ( my $data = get($TARGET_URL)){ print "Done\nProcessing..."; my $ref_data = XMLin($data); print "Done\n\n"; print "Number of Results: $ref_data->{userinfo}{numresults}\n" +; print " Last Result: $ref_data->{userinfo}{lastresulttime +}\n"; print " Rank: $ref_data->{rankinfo}{rank} / $ref_d +ata->{rankinfo}{ranktotalusers} (". (100-$ref_data->{rankinfo}{top_r +ankpct})."%)\n"; }else{ print "Failed\n"; }
    getstats.pl (team info)
    #!/usr/bin/perl -w # ==================================================================== +== # Project: Seti@Home # Project Leader: Peter Wise # -------------------------------------------------------------------- +-- # Program name: GetStats # Program state: pre-alpha # Program notes: Pull stats on a seti user using XML interface # # Program filename: getstats.pl # -------------------------------------------------------------------- +-- # Version Author Date Comment # ~~~~~~~~ ~~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~ # 1.0 P.J.Wise 10/02/2003 Initial version # # -------------------------------------------------------------------- +-- # CVS: # ID: $Id: getstats.pl,v 1.1 2003/02/10 02:32:04 peter Exp $ # Author: $Author: peter $ # Date: $Date: 2003/02/10 02:32:04 $ # Revision: $Revision: 1.1 $ # # -------------------------------------------------------------------- +-- # Notes: # ~~~~~~ # # ==================================================================== +== use strict; use LWP::Simple qw/get/; use XML::Simple; use Data::Dumper; #Config my $TARGET_NAME= $ARGV[0] || 'YourTeamNameHere'; my $TARGET_URL = "http://setiathome.ssl.berkeley.edu/fcgi-bin/fcgi?cmd +=team_lookup_xml&name=$TARGET_NAME"; $= = 20; my ($nnn,$ccc,$rrr); format STDOUT_TOP = Stats Pos. Name Results ------------------------------------------------------------------- . format STDOUT = @>> @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @>>>>>>> $ccc, $nnn, $rrr . #print "Getting data from server..."; if ( my $data = get($TARGET_URL)){ #print "Done\nProcessing..."; my $ref_data = XMLin($data); #print "Done\n\n"; my $members = $ref_data->{topmembers}{member}; my $count = 0; foreach my $name (sort {$members->{$b}{numresults}<=>$members- +>{$a}{numresults}} keys %$members){ $count++; $nnn = $name; $ccc = $count; $rrr = $members->{$name}{numresults}; write(); } }else{ print "Failed\n"; }


    _______________________________________________________
    Remember that amateurs built Noah's Ark. Professionals built the Titanic.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://248201]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2024-04-16 19:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found