Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Community > Team MacNN > ClientCheck multi-client monitor

ClientCheck multi-client monitor
Thread Tools
Administrator
Join Date: May 2000
Location: California
Status: Offline
Reply With Quote
May 27, 2003, 11:14 PM
 
This is a web based monitor for multiple clients. There is no limit to how many clients can be monitored. They can be anywhere on the LAN or Internet that Apache can reach. Currently it monitors only Folding clients.

It turned up here in bousozoku's monitor thread as a stopgap solution for our larger farmers. By mikkyo's suggestion, it gets it's own thread now.

ClientCheck v0.1e (4.3K)

Edit the file for your needs. User-adjust section is at the top, clearly marked. Reference key is provided just below the user-adjust section. There is no limit to how many clients can be tracked.

PHP (Apache really) needs write permission for where ever the data file gets written. Default is the same folder as the script.

Unix symlink (do not use a Finder alias) each unitinfo.txt file to a place where Apache can reach it on the client boxes (Apache must be running on each client box). Alternatively, put the client into an Apache-served folder, or cron a copy command to regularly copy the unitinfo.txt file into an Apache-served folder (thanks mikkyo). Put the ClientCheck file itself on a box with Apache and PHP both running. Hit with browser, reload for fresh info. Cron the script to make the info stay more up-to-date.

PHP is installed when you install the Dev Tools. Alternatively, you can download an install package with more PHP options from here:
http://www.entropy.ch/software/macosx/php/
The linked page has instructions for activating PHP. Those instructions will work for activating the Dev Tools versions as well.

Neither bousozoku nor kman42 has objected to continued development of ClientCheck, and I have not felt like messing with Ranks much lately, so the door is open. Who wants what added or changed? Is support desired for additional projects?

Revisions:
0.1e suppress error message when a client is not found
0.1d bugfix for non-gromacs units, add load reporting
0.1c add display controls
0.1b nicer colortagging
0.1a bugfix of code typos
0.1 release
(Last edited by reader50; May 29, 2003 at 06:25 PM. )
     
Administrator
Join Date: May 2000
Location: California
Status: Offline
Reply With Quote
May 27, 2003, 11:22 PM
 
Could some people post their unitinfo.txt files here? I've seem some older ones posted on the Stanford forums, they are different from what I used as a reference. At the moment, ClientCheck may mess up unless it is monitoring a Mac client running Gromacs.

Right now, it expects to see something like this:
Code:
Current Work Unit ----------------- Name: p909_vill_str0 Download time: May 28 02:45:21 Due time: June 13 02:45:21 Progress: 0% [__________]
I also need to work on the Due time value. The value given in this file is the no-scientific-value, no-stats-awarded date. The date we more commonly use is the scientific-value date, which is something less that 1/2 of the toss date. If there is a fixed ratio between the two due dates, then I can calculate and show the correct date.
     
Senior User
Join Date: Feb 2002
Location: Silly Valley, Ca
Status: Offline
Reply With Quote
May 28, 2003, 12:52 AM
 
HAH!
You crazy?
I'm not posting 50+ unitinfo.txt files.


Ok, I'll do a couple.

This one looks the same as the one you posted, only it is more done.
Code:
Current Work Unit ----------------- Name: p909_vill_str0 Download time: May 22 09:11:38 Due time: June 7 09:11:38 Progress: 88% [||||||||__]
Here is one from an Athlon
Code:
Current Work Unit ----------------- Name: p544_BBA5_ext Download time: May 27 10:04:50 Due time: July 6 10:04:50 Progress: 65% [||||||____]
and a nother
Code:
Current Work Unit ----------------- Name: p545_BBA5_ext Download time: May 27 23:03:25 Due time: July 6 23:03:25 Progress: 39% [|||_______]
from DP G4
Code:
Current Work Unit ----------------- Name: p543_BBA5_ext Download time: May 24 23:37:16 Due time: July 3 23:37:16 Progress: 79% [|||||||___]
     
Administrator
Join Date: May 2000
Location: California
Status: Offline
Reply With Quote
May 28, 2003, 03:06 AM
 
Genome units supposedly omit the Due time line. Also, I was wondering if a Tinker file looked the same.

I'll at least smarten up the parser enough to recognize specific lines instead of assuming they are present in exact order.
     
Dedicated MacNNer
Join Date: Sep 2001
Location: California
Status: Offline
Reply With Quote
May 28, 2003, 09:13 AM
 
Here's one from a Tinker my iBook is currently laboring on.

Code:
Current Work Unit ----------------- Name: p184 Download time: May 25 16:27:05 Progress: 76% [|||||||___]
     
Administrator
Join Date: May 2000
Location: California
Status: Offline
Reply With Quote
May 28, 2003, 08:16 PM
 
I expect to post v0.1d tonight. It fixes the parsing problem, 0.1c and earlier will mess up on a tinker or genome unit. Also, I've added mikkyo's CPU load support. Append a line to the unitinfo.txt file:

"CPU load: ##"

Omit the quotes. The ## part should be the load number. The script expects a float, but will accept an integer. Appending this line will not break earlier versions.

Bad news is that the Due time line is a variable multiplier of the due time we are interested in. There is no way to adjust to the desired value based on info from this file alone.
     
Senior User
Join Date: Feb 2002
Location: Silly Valley, Ca
Status: Offline
Reply With Quote
May 29, 2003, 12:14 AM
 
I've come across a couple of other issues.
Some clients show up as late for no reason that I can tell.
I have the unitinfo.txt file being copied every 15 minutes.

If a client is added, and web sharing isn't on, there are errors at the top of the page like fopen failed and stuff like that.
It should probably just list the client as unreachable and not error into the page other than that.

If you delete a unitinfo.txt file, god knows what happens.
On one of my machines, it refuses to recreate that file.
It isn't a permissions issue.
No amount of stopping and starting the client can seem to regenerate that file.
I even cleared the work directory and queue just to see what would create it.
I have no idea what does.
This may be a big issue.

Thanks for adding the CPU load field.
You might want to leave it commented out for now as I'm not sure how to get what we want when there are 2 instances running.
Maybe renaming the client so there is an easy way to grep the CPU load out of ps and append it to the correct copy of unitinfo.text.
     
Administrator
Join Date: May 2000
Location: California
Status: Offline
Reply With Quote
May 29, 2003, 12:46 AM
 
Cron the ClientCheck.php script, in order to keep it's own datafile current. If you check manually now and then, a fast box could turn over in between checks, but get the same protein again. This can confuse the script.

You can cron the script in several ways:
lynx -dump http://127.0.0.1/ClientCheck.php
wget --spider http://127.0.0.1/ClientCheck.php
curl http://127.0.0.1/ClientCheck.php

The first two will dump the results instead of saving them as a "file". Not sure how to do that with curl, perhaps direct the output to /dev/null.

I'll look into the errors on a file-fetch fail. The script already traps that condition, I'll look into suppressing the messages.

About the unitinfo.txt, try copying another one, then chmod the copy to 777.
     
Senior User
Join Date: Feb 2002
Location: Silly Valley, Ca
Status: Offline
Reply With Quote
Jun 2, 2003, 08:21 PM
 
I got the machine to update its unitinfo files finally.
I deleted them, made sure the permissions were all ok and waited.
Once it finished its current proteins, it remade them.
Wheee.
     
Senior User
Join Date: Feb 2002
Location: Silly Valley, Ca
Status: Offline
Reply With Quote
Jun 2, 2003, 09:05 PM
 
Here is my dumper script, at least that is what I call it.

Create it as a plain text file and paste the following, editting your info in where needed..
Code:
#!/bin/sh # Copy unitinfo.txt file to published location cp /Applications/Folding/unitinfo.txt /Users/yourname/Sites/unitinfo.txt #Get the cpu load for a single instance of FahCore running. cpuLoad=`ps axuww | grep FahCore | grep -v grep | awk '{ print $3 }'` # append the CPU load to the copied unitinfo.txt file. echo "CPU load: $cpuLoad" >> /Users/yourname/Sites/unitinfo.txt
Then make it executable in Terminal
cd wherever/dumper/is
chmod a+rx ./dumper


Run this as a cronjob instead of copying the unitinfo file. My crontab looks like this..
Code:
@reboot cd /Applications/Folding; ./startfolding 0,15,30,45 * * * * cd /Applications/Folding; ./dumper
I have some ideas for dual processor machines, we shall see what works.
(Last edited by mikkyo; Jun 2, 2003 at 09:11 PM. )
     
Senior User
Join Date: Feb 2002
Location: Silly Valley, Ca
Status: Offline
Reply With Quote
Jun 10, 2003, 03:50 PM
 
So I noticed another issue.
When some of my machines die, they don't respond.
ClientCheck will not run and gather data.
If I deleted the Data file and try again it sometimes works the first time, but will eventually fail.
If I make sure all my machines are up, then ClientCheck works fine.
Maybe it needs some error handling for down/not responding machines it has already gathered data about?
I'm not sure what code path it is taking and hanging up on.
When I hit the .php file in this state, it just times out eventually and shows nothing at all.
     
Administrator
Join Date: May 2000
Location: California
Status: Offline
Reply With Quote
Jun 10, 2003, 05:42 PM
 
Your php install has a time limit on script execution. The limit is usually 30 seconds or 60 seconds. I'd guess the clientcheck script is timing out waiting for a bunch of boxes to respond. If only 1-2 are down, the cumulative network timeouts would fit within the php timeout. A larger number of boxes would fail it.

ClientCheck checks the various boxes in series. You can increase your php execution time limit in the php.ini file. This config file can be in different locations, depending on who compiled your php package. Mine is located at:

/usr/local/lib/php.ini
Code:
[PHP] ; various lines ..... ;;;;;;;;;;;;;;;;;;; ; Resource Limits ; ;;;;;;;;;;;;;;;;;;; max_execution_time = 300 ; Maximum execution time of each script, in seconds memory_limit = 8M ; Maximum amount of memory a script may consume (8MB) ; various lines ; End:
If you can't find the php.ini file, write out the following file and call it test.php

[?php
phpinfo();
?]

(replace the [brackets] with < > )

Hit this file with a browser, it will give PHP's current parameters, as well as the location where PHP expects to find the php.ini file. If checking that location reveals that you do not have a php.ini file, then write out my example php.ini file to that location. Apache must be restarted for the changed timeout to take effect.
     
Senior User
Join Date: Feb 2002
Location: Silly Valley, Ca
Status: Offline
Reply With Quote
Jun 19, 2003, 05:24 PM
 
I'll have to try that.
It seems like it is just the one system is down and that the script is unable to deal.
Maybe if it didn't check them in order or something. Multithread-like?

Another question for you.
I have machines behind a firewall.
I would like to periodically copy their unitinfo.txt files to my machine outside the firewall.
They need to do the copy, since the machine outside can't get to them.
What do you recommend as a good way to do this and how would I set it up?
I don't want to open guest ftp on my machine outside, so maybe sftp using access keys only with a periodic cron job?
Any other options?
     
Moderator Emeritus
Join Date: Dec 2000
Location: College Park, MD
Status: Offline
Reply With Quote
Jun 19, 2003, 05:51 PM
 
Originally posted by mikkyo:
I'll have to try that.
It seems like it is just the one system is down and that the script is unable to deal.
Maybe if it didn't check them in order or something. Multithread-like?

Another question for you.
I have machines behind a firewall.
I would like to periodically copy their unitinfo.txt files to my machine outside the firewall.
They need to do the copy, since the machine outside can't get to them.
What do you recommend as a good way to do this and how would I set it up?
I don't want to open guest ftp on my machine outside, so maybe sftp using access keys only with a periodic cron job?
Any other options?
rsync or scp thru a ssh tunnel would work well.
My website
Help me pay for college. Click for more info.
     
Forum Regular
Join Date: Nov 2002
Location: Santa Barbara CA
Status: Offline
Reply With Quote
Jun 19, 2003, 07:27 PM
 
I use scp through an ssh connection to copy files from work to my home computer. I would second that way.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:18 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2