Message boards : Number crunching : Is there?....or...I want....!
Message board moderation

To post messages, you must log in.

AuthorMessage
Neal Watkins
Avatar

Send message
Joined: 14 Nov 05
Posts: 32
Credit: 712,132
RAC: 60
Message 18681 - Posted: 9 Dec 2007, 23:38:44 UTC

Is there a Command line interface I could use to periodically scan the LHC@HOME main web page for the absence of a string (such as "Up. Out of Work.)
ID: 18681 · Report as offensive     Reply Quote
PovAddict
Avatar

Send message
Joined: 14 Jul 05
Posts: 275
Credit: 49,291
RAC: 0
Message 18682 - Posted: 9 Dec 2007, 23:57:17 UTC - in response to Message 18681.  

Is there a Command line interface I could use to periodically scan the LHC@HOME main web page for the absence of a string (such as "Up. Out of Work.)

Scraping the complex-layout main web page for that will probably be very painful. How about the XML server_status?
ID: 18682 · Report as offensive     Reply Quote
Neal Watkins
Avatar

Send message
Joined: 14 Nov 05
Posts: 32
Credit: 712,132
RAC: 60
Message 18683 - Posted: 10 Dec 2007, 0:19:48 UTC - in response to Message 18682.  

OK - where does that file live?
If my machine was an AIX machine with Korn shell, I could just use the
LYNX browser, redirect the output into a file and grep for that string.
Probably all on one command line (separated by &&'s of course)
ID: 18683 · Report as offensive     Reply Quote
Neal Watkins
Avatar

Send message
Joined: 14 Nov 05
Posts: 32
Credit: 712,132
RAC: 60
Message 18684 - Posted: 10 Dec 2007, 0:21:02 UTC - in response to Message 18683.  

Then use CRON to schedule it every 15 minutes...
ID: 18684 · Report as offensive     Reply Quote
Kaal

Send message
Joined: 7 Nov 05
Posts: 19
Credit: 248,179
RAC: 0
Message 18688 - Posted: 10 Dec 2007, 16:08:31 UTC

Assuming you're on some kind of *nix with libxml2 installed:
[ `/usr/bin/xmllint http://lhcathome.cern.ch/lhcathome/server_status.php?xml=1 | awk -F\\> '/results_ready_to_send/{print $2}' | sed 's/<.*$//'` -gt 0 ] && (cd $BOINCHome; ./boinc_cmd --project http://lhcathome.cern.ch/lhcathome/ update
It's quick and dirty but it should be cronable with a bit of tweaking for your system.
HTH
ID: 18688 · Report as offensive     Reply Quote
Profile Alex

Send message
Joined: 2 Sep 04
Posts: 378
Credit: 10,765
RAC: 0
Message 18689 - Posted: 11 Dec 2007, 4:19:20 UTC
Last modified: 11 Dec 2007, 4:20:03 UTC

When I played with boinc on knoppix on my old pc, I used to use Boinctop to see what boinc was running, however it doesn't query the servers.

You might want to check out the boinc bash script addon listed at

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

I'm not the LHC Alex. Just a number cruncher like everyone else here.
ID: 18689 · Report as offensive     Reply Quote
Neal Watkins
Avatar

Send message
Joined: 14 Nov 05
Posts: 32
Credit: 712,132
RAC: 60
Message 18691 - Posted: 11 Dec 2007, 21:48:29 UTC - in response to Message 18688.  

Assuming you're on some kind of *nix with libxml2 installed:

Nope - I'm on WINDERS. That's my problem. Thanx anyway
ID: 18691 · Report as offensive     Reply Quote
lidden

Send message
Joined: 16 Dec 05
Posts: 1
Credit: 11,468
RAC: 0
Message 18694 - Posted: 13 Dec 2007, 0:00:57 UTC - in response to Message 18691.  

If you have Perl installed this should work:

<code>
use warnings;
use strict;
use LWP::Simple;

my $url = 'http://lhcathome.cern.ch/lhcathome/';
my $content = get $url or die 'Could not fetch page';
my $re = qr/([^<]+)/;

for ( $content =~ m!<h2>Server Status</h2>\\n$re<br />$re<br />!){
print "$_\\n";
}
</code>

Perl for windows can be downloaded from activestate.com
ID: 18694 · Report as offensive     Reply Quote

Message boards : Number crunching : Is there?....or...I want....!


©2024 CERN