/usr/share/munin/plugins/foldingathome_rank is in munin-plugins-extra 2.0.25-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | #!/bin/sh
# -*- sh -*-
#
# Folding@Home Rank
#
# Parameters:
#
# config (required)
# autoconf (optional - only used by munin-config)
#
# Magic markers (optional - used by munin-config and some installation
# scripts):
#%# family=contrib
#%# capabilities=autoconf
statefile=$MUNIN_PLUGSTATE/plugin-fah_rank.state
if [ "$1" = "autoconf" ]; then
# No real check of anything
# echo yes
echo no
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title Folding@Home Rank'
echo 'graph_args -l 0 --base 1000'
echo 'graph_vlabel rank'
echo 'rank.label rank'
echo 'rank.type GAUGE'
echo 'rank.max 12000'''
exit 0
fi
rank=`wget "http://vspx27.stanford.edu/cgi-bin/main.py?qtype=userpage&username=8d" -q -t 1 -T 5 -O - | egrep "<TD> <font size=3> <b> [0-9]* </b> of [0-9]* </font></TD>" | sed 's/.*<font size=3> <b> \([0-9]*\) .*/\1/'`
if [ "$rank" = "" ]; then
if [ -f $statefile ]; then
echo rank.value `cat $statefile`
fi
else
echo $rank > $statefile
echo rank.value $rank
fi
|