• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

OC SETI Team Signiture Stats Script!

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

JigPu

Inactive Pokémon Moderator
Joined
Jun 20, 2001
Location
Vancouver, WA
Project is dead.
I currently don't have the time to continue making updates, and with almost no interest in it anymore, I declare this project dead. If there are any perl hackers out there who want to use my code feel free, but please let me know that you are using it. I may not be updating it, but I still would love to see who finds it useful :)

Lastest Version: BOINC / Classic Script 0.30 (10/26/05) ;)
User Data Courtesy BOINCStats :thup:.
~~~~~~~~~~~~~~~~~~~

Christoph recently created a lovely Perl script which is able to find / get statistics for the Folding and SETI teams, and then upload this data into their sig. His thread regarding this script can be found here, and includes instructions on getting Perl (to run the script), setting the script up, etc.

Unfortunatly, with it's presence in the Folding section, it dosen't get much visibility from us SETI guys :D This thread was created as a SETI specific version of the original thread, where you could download the latest BOINC/Classic script, get fast(er) help with making the script do your bidding, as well as provide a place for feature requests. This version of the script has lots of neat additional features (such as the data gathered from BOINCStats) and is now THE sig script for the team :D

Christoph's original thread (linked above) is still an excelent resource for getting Perl and the scripts to work, and I would suggest reading through it if you have the time (or posting in it if you still have problems).


That said...
~~~~~~~~~~~~~~~~~~~

Step 1:
To save myself from repeating what has already been written, see Christoph's excelent post HERE. It contains instructions on obtaining perl, installing his mksig.pl file, etc. It has a brief overview of how Perl works, and how to get your sig stats working and updated automatically. You may wish to use the simple SETI stats script he has in the post before using my (rather complex one) just to verify that everything is working properly.


Step 2:
Download the following file (right click -> "Save As"), and save it to your C:\mksig directory with the filename sig_gen.pl. If you are asked wether you would like to replace an existing file, click Yes.

sig_gen.pl

This code (when run) will generate a sig which looks similar to the following:
Crunching.for.Overclockers.com!
Team Rank: 26th________________98,583.89 Total SETI Credit
World Rank: 1,536th___________________1,499.08838 Recent Average Credit

Currently Visible Work As Of 02/16/2005 at 20:31.

{>>>>>__________}__33%____ [goddess: Athlon XP 1800+]
{>>>>>>>>>>>>___}__78%____ [Crackerjack: mobile Athlon XP 1500+]
{>>>>>>>>>>>____}__72%/29% [Nacho: Mobile Pentium 4 2.80GHz]


Step 3:
Modify the code :) Now, I know what you're thinking.... How in the heck are you supposed to know what to modify in that huge 977 line monstrosoty of code?? Well, everything that you need to change is all in the first few lines, and should be fairly simple to change.
You need to modify:
  • The "# Projects To Provide Data For" section - This section tells the script where/how to get data.
  • The "# BOINC Setup" section - This section provides the script with some data regarding BOINC. Not all of it is used, but to be safe you should fill them in. It includes:
    • The directory you've installed BOINC to
    • A list of remote hosts that can be contacted via RPC ("localhost" should work fine if you have no remote hosts you want to monitor)
    • A list of ports to connect to (31416 is the port currently used by BOINC unless you know you've changed it)
    • You're SETI ID number (access your account and scroll down to the bottom of the page. the "Account number" is this number)
    • You're BOINC cross-project ID (again, access your account and scroll to the bottom. the "Cross-project ID" is this piece of data)
  • The "# Classic Setup" section - This gives the script info about your Classic account so it can get data for it as well. It includes:
    • The directory you've installed SETI@Home Classic to
    • The E-Mail address used to check your Classic stats


That's It!!
...Unless you want to further modify the code so that it looks different. Christoph's post (linked above) covers the basics of how to work with Perl should you want to tweak the code on your own. All the variables that the program creates and sets to various values are listed just below the setup portion for step 3. The actual code which creates the sig is located near the bottom of the sig, just before all the subs.

If you've made a modification to the display code, by all means post it up so others can have more of a choice in how their sig looks! (since, even though I like my scheme, some may want simpler or different stats covered :))


~~~~~~~~~~~~~~~~~~~
If you have any questions, comments, or requests, post away!


Change Log:
0.11 - Fixed buggy SETI World Rank variable, Fixed "long" SETI RAC display (now only displays first 5 digits of RAC)
0.12 [3/18/05] - (Hopefully) Fixed the script from dying if the machine running the script does not have RPC privlages on the remote system. Since the program will only display the first 2 "active" WUs it comes across right now, it now shows the two RUNNING active projects. Updated progress bar generator to incorporate the neat multiple charachter progress bar that JerMe made. Updated to work with the new official BOINC 4.25 XML data. Fixed two XML bugs.
0.13 [3/28/05] - Fixed a bug that caused "World Rank" to not display because of a change in BOINCstats.com's stat format. Added a bit more documentation.
0.14 [3/31/05] - Log file added for debugging aid, sig_gen gracefully dies when a classic e-mail isn't found
0.15 [6/27/05] - Various bug fixes and graphical tweaks. Hopefully fixed RPC calls for some systems.
0.16 [8/10/05] - BOINCStats layout fix and additional stats.
0.20 [8/28/05] - Fixed spelling error, changed RPC mechanism (should no longer freeze script if BOINC denies RPC), new BOINCStats code (this should be the last version ;)), additional projects, additional stats for projects.
0.30 [10/26/05] - Added code to allow sig_gen to connect to a passworded client (ALL 5.x clients are passworded on install, making this a very nesscary feature).

Wish List / Bugs To Be Fixed: (feel free to post or PM features you'd like to see!)
  • Get SETI@Home Classic stats from state.sah (or whatever other files on disk)
  • Progress bars for systems running more than 2 WUs simultanously (quad xeons/opterons for instance)
  • Ability to show progress bar for currently suspended WUs
  • Ability to display if a WU is suspended or not (probably for use with the item above)
  • Allow program to work with versions prior to 4.25
  • Add statistics for BURP to overall BOINC
  • Add variable to determine number of WUs in cache
  • Add variable to determine number of complete WUs in cache
  • Show state of client machine (ie: if a box was unreachable, or reachable but idle)
  • Add fix for project-specific BoincStats layout tweak
  • Add project-specific stats for ALL projects (just like the SETI specific ones)

JigPu
 
Last edited:
Geez, just looked at the current WU code...that's so kewl! JigPu, did you write that section? If so, I'm impressed! Nice job.

EDIT: Hmm, I tried that version, and it isn't working for me...something about the @rpc stuff I think. I'll have to mess with it later.
 
Last edited:
FloridaBear said:
Geez, just looked at the current WU code...that's so kewl! JigPu, did you write that section? If so, I'm impressed! Nice job.

EDIT: Hmm, I tried that version, and it isn't working for me...something about the @rpc stuff I think. I'll have to mess with it later.
I wrote all the RPC stuff myself, and threw in some things (like the general BOINC statistics from BoincStats) that were pretty much a copy/paste of the code Christoph had for another function (the SETI specifc stats from BoincStats for instance).

If you can't get it to work, post or PM me the problem and I'll see if I can help :)

JigPu
 
Program updated to version to 0.12
Code now inside a link, which should prevent the forum from screwing it up (this seems to be a problem with posting really long pieces of code...)

Changes:
(Hopefully) Fixed the script from dying if the machine running the script does not have RPC privlages on the remote system.

Since the program will only display the first 2 "active" WUs it comes across right now, it now shows the two RUNNING active projects.

Updated progress bar generator to incorporate the neat multiple charachter progress bar that JerMe made.

Updated to work with the new official BOINC 4.25 XML data.

Fixed two XML bugs.
 
Update to version 0.13

BOINCstats.com changed the format of their stats slightly, and it broke the "World Rank" stat. This has been fixed.

Added a bit more documenation on the BOINC setup variables, though it could definatly stand quite a bit more...

JigPu
 
Update to version 0.14

Minor change so that the script will gracefully die if you give it a bad classic e-mail address.

Added log file to help me with future debugging :) At the very least, it will let me figure out what variables are "broken" when I notice something stops working.

JigPu
 
Perl! I hate you!

With the wonderfull pearl example of stats from JigPu, I was able to adapt it to *my* primary need. The original pearl code from JigPu was running well with the stats-getting-part.

Due I do have 4.19/4.25 of boinc clients. also to much project attached.
the bad is on my side.

--> But from the example, I could LEARN so much.

basically JigPu I want to first say "tankyou" and invite to do the same thing like I did when started with coding of boinc guis/manager, do not follow the way of local/remote file accessing! try to handle ONLY over rpc, this has the huge advantage, no more file share, no more incompatibilities of divers clients releases and
you talk to the host the same way, it doesn't matter if the to be managed client is local (same pc as the script is running) or remote. I use different client locations (different directories) and I would fall in a never ending mess due alway changing hostnames and file locations.

With rpc, this all has gone.

what I'm not understanding, why the first about 100k of data is readen, not more. is there a technical reason?

print $socket "<get_state/>\n";
$socket->recv($reply,102400);
#print "$reply";

Me too in, VB, got a limit of buffer, it could be solved by asking parts and parts and parts and every part while arrival of the datastream, was put into an array until the end of data arrived. and then the analysing routine could passed. Depending of the number of attached projects, depending of the amount of downloaded work, the size of data "returning over sockets" will overpass 400k. so ist not so so much higher than the used "buffer" of 102400

alternatively instead of getting the full available information (<get_state>)
there is the <get_results>, this is a little bid shorter in size

http://boinc.berkeley.edu/gui_rpc.php

anyway, important information is located at the nearly end of data stream
look at the client_state.xml for example, the section so called <active_task>

it's the same structure, used by your script, but from a other section from the file/datastream)




the returnal of what I could learn from YOUR example (screenoutput):

project total_credit team team_pos world_pos

sah 603,203.69 Overclockers.com 2 102
pah 86,971.22 SwissTeam.NET 1 32
cp 25,141.65 UniBE.CH - SwissTeam.NET 27 3,933
pirates 34,407.26 Team AlienWare 1 1
lhc 216,654.70 SwissTeam.NET 1 1
einstein 232,647.89 Overclockers.com 1 11
burp 65.77 SwissTeam.NET 1 20

just that what I wanted to have since a long time..

please do not laugh to much..

It's my first pearl script, normaly using more the VB coding environment, but there, it's very hard to get informations from a webside.

in pearl it looks so much more easy

Code:
#!/usr/bin/perl 

use XML::Simple;
use LWP::Simple;
use LWP::UserAgent;



$id_user[1]=3744 ; #seti
$id_user[2]=8142 ; #predictor
$id_user[3]=2741 ; #cpdn
$id_user[4]=1149 ; #pirates
$id_user[5]=1133 ; #lhc
$id_user[6]=2077 ; #einstein
$id_user[7]= 227 ; #burp

$project[1]="sah";
$project[2]="pah";
$project[3]="cp";
$project[4]="pirates";
$project[5]="lhc";
$project[6]="einstein";
$project[7]="burp";


$mainURL="http://www.boincstats.com/stats/user_graph.php?pr=";



$i = 1;

while($i <= 7) 
{
  $boinc_pages[$i]=$mainURL . $project[$i] ."&id=". $id_user[$i];
  print "-".$i."- boinc_pages[$i]=$boinc_pages[$i]\n";
  $i++;
}


print "\n\n\n";

$i = 1;

print "project  total_credit team team_pos world_pos \n\n";

while($i <= 7)
{
  get_from_web($i);
  read_file($i);
  print "$project[$i] $boinc_total_credit $team $team_pos $world_pos \n";
  $i++;
     #  $total = $total+$boinc_total_credit;
     # print "$total\n"
}


print "\n\nOverall Total $total";

exit;
sub get_from_web 
{

  $fn="tmp_" .$id_user[$_[0]] .".txt";
#  print "get data from " . $project[$_[0]]."\n";
  getstore($boinc_pages[$_[0]], $fn);
} #end sub





sub read_file 
{
  $fn="tmp_" .$id_user[$_[0]] .".txt";
  if (! -e $fn) {
    print "get the file, stupid\n";
    exit;}

  open BC, "$fn";
  while(<BC>)
  {

    if (/<td>Total Credit</) 
      {
      <BC>;
      $boinc_total_credit = <BC>;
      chomp($boinc_total_credit);
      $boinc_total_credit =~ s/\s*([\d\.\,]*)<.*/$1/;
      }
    if (/<td>Member of Team</) 
      {
      <BC>;
      $team = <BC>;
      chomp($team);
      $team =~ s/\s*([\d\.\,]*)<.*/$1/;
      }

    if (/<td>Position in Team</) 
      {
      <BC>;
      $team_pos = <BC>;
      chomp($team_pos);
      $team_pos =~ s/\s*([\d\.\,]*)<.*/$1/;
      }
  
   
  if (/<td>World Position</) 
      {
      <BC>;
      $world_pos = <BC>;
      chomp($world_pos);
      $world_pos =~ s/\s*([\d\.\,]*)<.*/$1/;
      }
  }
  close BC;
} #end sub

still not able now, to format the strings and count the total :shrug:
 
ric said:
basically JigPu I want to first say "tankyou" and invite to do the same thing like I did when started with coding of boinc guis/manager, do not follow the way of local/remote file accessing! try to handle ONLY over rpc, this has the huge advantage, no more file share, no more incompatibilities of divers clients releases and
you talk to the host the same way, it doesn't matter if the to be managed client is local (same pc as the script is running) or remote. I use different client locations (different directories) and I would fall in a never ending mess due alway changing hostnames and file locations.

With rpc, this all has gone.
I wholeheartedly agree. I hate the file access method, and it's extrordinarily difficult to get working over networks. RPC makes me sooooooo much happier :)

ric said:
what I'm not understanding, why the first about 100k of data is readen, not more. is there a technical reason?

print $socket "<get_state/>\n";
$socket->recv($reply,102400);
#print "$reply";

Me too in, VB, got a limit of buffer, it could be solved by asking parts and parts and parts and every part while arrival of the datastream, was put into an array until the end of data arrived. and then the analysing routine could passed. Depending of the number of attached projects, depending of the amount of downloaded work, the size of data "returning over sockets" will overpass 400k. so ist not so so much higher than the used "buffer" of 102400
The "100K" was purely arbitrary on my part. I didn't see more than 50K ever used (on my own system :D), so I went with double to be safe. However, it would be nice if I could just keep recieving data until the transmission is ended, because buffer overflows are never fun... I'll look at trying to implement something like you mention, and see if I can't get something similar to work.

ric said:
alternatively instead of getting the full available information (<get_state>)
there is the <get_results>, this is a little bid shorter in size

http://boinc.berkeley.edu/gui_rpc.php
Woah! Thanks ric!! I've been looking for a list of the RPC commands that can be used for a while now... The only one I knew was <get_state>, and that was from packet sniffing. I'll definatly look into how the other calls could be of use!


ric said:
anyway, important information is located at the nearly end of data stream
look at the client_state.xml for example, the section so called <active_task>

it's the same structure, used by your script, but from a other section from the file/datastream)




the returnal of what I could learn from YOUR example (screenoutput):

project total_credit team team_pos world_pos

sah 603,203.69 Overclockers.com 2 102
pah 86,971.22 SwissTeam.NET 1 32
cp 25,141.65 UniBE.CH - SwissTeam.NET 27 3,933
pirates 34,407.26 Team AlienWare 1 1
lhc 216,654.70 SwissTeam.NET 1 1
einstein 232,647.89 Overclockers.com 1 11
burp 65.77 SwissTeam.NET 1 20

just that what I wanted to have since a long time..

please do not laugh to much..

It's my first pearl script, normaly using more the VB coding environment, but there, it's very hard to get informations from a webside.

in pearl it looks so much more easy

still not able now, to format the strings and count the total :shrug:
Congrats man!! I was (and still am... :santa: ) a total newbie at Perl when I started this sig gen as well :D The real man to thank is not me, but Christoph, who made the original Perl script for the Folding team that this is based off of. Like you, I "learned" how to do most everything (except network connections and XMLin) from that script. If you've got questions on how to do something, shoot me or Christoph a PM and we'll see if we can help you out :)

JigPu
 
Nice job on the sig Jigpu but I cant seem to get the bottom to work... got a bit lost on the RPC thing. Is there an easy way to just remove the that section?

Also have you figured out how to add other project stats yet?
 
huh? what? huh? i dont understand DUHHH

ummm i dont understand how to get one of those in my sig..
i copy what thet wroye and put it into my sig but it doesnt seem to work..why? is there some other trick that im not getting??
i would really like to put it in my sig
if anyone would be so kind as to explin how to do it..in lameins terms i would be greatfull...

thx
 
deez said:
Nice job on the sig Jigpu but I cant seem to get the bottom to work... got a bit lost on the RPC thing. Is there an easy way to just remove the that section?

Also have you figured out how to add other project stats yet?
I'll send you a PM for how to get RPC working. I really need to make better documentation, but I haven't found the time as of yet :( As far as getting stats from other projects, I know how to do it, but again I need to find some time to implement the stuff (currently, all my programming powers are directed to class use).


thedude9804 said:
ummm i dont understand how to get one of those in my sig..
i copy what thet wroye and put it into my sig but it doesnt seem to work..why? is there some other trick that im not getting??
i would really like to put it in my sig
if anyone would be so kind as to explin how to do it..in lameins terms i would be greatfull...

thx
I'll PM you and see if we can't get the script to work for 'ya :)

JigPu
 
JigPu said:
I'll PM you and see if we can't get the script to work for 'ya :)

JigPu


ok cool that would be awsome dude...thx :) :santa:

ok i tryed again and still can get it to work.. :shrug: :shrug:
as you can see it wont show my stats :bang head

HELP!!!!
 
Last edited:
Back