Graphing FAH WU progress with Munin

Associate
Joined
27 Apr 2004
Posts
2,377
Here's a link to my Munin so you can see what I'm talking about, before I start confusing people:
http://venus.piggott.me.uk/munin/piggott.me.uk/saturn.piggott.me.uk.html#Folding@home

For now I've only got it working on Linux but might have a go at getting it working on Windows too at some point.

See http://munin.projects.linpro.no/ for more information on Munin. I've just written a plugin to graph FAH WU progress (as seen in the first link), and thought I'd post here in case it's of any use to anyone. Not sure how many will want to use it but hey, worth checking.

Since the explanation doesn't take long I thought I may aswell post it without waiting to see if anyone's interested first.

Since PHP is pretty much the only language I know, that is what I wrote it in, which means you will need the PHP-CLI installed - apt-get install php5-cli should take care of that on Debian based systems if you don't already have it.

Then put the following in /usr/share/munin/plugins/folding using your favourite editor (nano for me). You will probably need to do this as root (using su or sudo):
Code:
#!/usr/bin/php
<?php

 /*	Very very basic plugin to graph Folding@Home WU Progress in Munin.
 /	Written by David Piggott - www.piggott.me.uk
*/

$cpus = 2;
$foldingpath = "/home/david/foldingathome/";

if($argv[1] == "config"){
	echo "graph_title Folding@Home WU Progress\n";
	echo "graph_vlabel %\n";
	echo "graph_category Folding@Home\n";
	
	for($i = 1; $i <= $cpus; $i++){
		echo "CPU{$i}.label CPU{$i}\n";
	}
	
	echo "graph_info This graph shows the progress of Folding@Home Work Units.\n";
	
}else{

	for($i = 1; $i <= $cpus; $i++){
		$lines = file("{$foldingpath}CPU{$i}/unitinfo.txt");
		$parts = explode(" ", $lines[5]);
		$progress[$i] = trim($parts[1], "%");
		echo "CPU{$i}.value {$progress[$i]}\n";
	}
	
}

?>
You will need to edit $cpus to equal the number of Folding clients you have installed on the machine, and $foldingpath to the base directory of your Folding install as created by finstall. Then save and exit.

Now run:
Code:
chmod +x /usr/share/munin/plugins/folding
as root to make the plugin executable, and run:
Code:
ln -s /usr/share/munin/plugins/folding /etc/munin/plugins/
to link the folding plugin into the munin config, again as root. Then run:
Code:
/etc/init.d/munin-node restart
as root again, to make munin-node pick up the new plugin. That's it, done. Just wait a few minutes for Munin to update and you should now have nice graphs showing WU progress.

Hope someone finds this useful, null :)
 
Last edited:
Pretty graphs. The folding one is a bit sparse, stop slacking. Nice work mate :)

Also, love the idea of "Available entropy". What happens when you run out of entropy? Or is it always increasing? :D That's why the entropy in the universe always increases, your server is dishing it out :D
 
joeyjojo said:
The folding one is a bit sparse, stop slacking.
Only just set it up didn't I ;)

As for entropy, all I know is Munin's definition: 'The number of random bytes available. This is typically used by cryptographic applications.' But I don't really care :p

null :)
 
Back
Top Bottom