It is fantastic to see a lot of interest in FaH during this covid-19 pandemic. This is something I hold very close and have been folding since 2005, but more constantly since 2011 when I was diagnosed with PMLBCL (Primary mediastinal large B-cell lymphoma) a rare and highly aggressive form of Non-Hodgkin’s Lymphoma and FaH is a small way I can give back so that maybe someone doesn’t need to go through what I had to.
It has been great seeing Team VMware release an Appliance to make folding simple and easy to get involved and getting behind using Technology for a Force for Good. I saw a dashboard that John Dias and Sunny Dua create and thought lets up this a notch!! lets grab the folding clients data and do something like this:

I really like these projects when I get to combine multiple hobbies, this really goes to show you can monitor almost anything in vROps and I do. I monitor my Solar, Smart Home stuff and all my services in my Lab, my internet, kids dont ask me if something is down, they look at a screen 🙂 .
Now the hardest part is getting the client details. Hopefully one day the FaH client has a proper rest API, but for now we have to use the telnet port, this is the same way the advanced client connects to other clients like shown in the image below:

For this I thought I would use Python, it has been a while since busting out Python and this way I could use some parts already created by John Dias and Sunny Dua in their python script for adding Team VMware into vROps.
I wrote this up last night while watching TV, so it’s not what I would call polished but it has been running fine since. The only caveats are where you run the script from needs network access to your clients and the IP of the server running the script needs to be added to the allow passwordless connection on the client.
Script is available Here in my Git Repo or as a download at the bottom of the page.
in the code you need to modify the following to your own values:
vropsUser = "admin"
vropsPassword = "VMware1!"
vropsHost = "vrops.virtualiseme.com.au"
vropsAuthsource = "Local"
teamId = "52737"
foldingUserName = "NuggetGTR"
hosts = [
#['IP or hostname', port , "DisplayName in output"],
['10.0.0.144', 36330 , "fah02"],
['192.168.0.194', 36330, "FoldingServer"],
['10.0.0.146', 36330, "fah01"],
['192.168.0.161', 36330, "Samuels-PC"],
['192.168.0.127', 36330, "Ahleighs-PC"]
]
loopdelay can bee changed from 5 to anything. this is how often it will update vROps with your metric information.
when running you will see it runs through each client connecting via telnet basically. I am using the FaH 3rd party API that is available, details here https://github.com/FoldingAtHome/fah-control/wiki/3rd-party-FAHClient-API
It is not nice and has to be read in a stream, when executing the script you will see it revive a stream of data like:
Connecting...
Telnet(10.0.0.146,36330): recv b'\x1b[H\x1b[2JWelcome to the Folding@home Client command '
Telnet(10.0.0.146,36330): recv b'server.\n> '
Telnet(10.0.0.146,36330): send b'slot-info\n'
Telnet(10.0.0.146,36330): recv b'PyON 1 slots\n[\n {\n "id": "00",\n "status": "'
Telnet(10.0.0.146,36330): recv b'RUNNING",\n "description": "cpu:6",\n "options'
Telnet(10.0.0.146,36330): recv b'": {},\n "reason": "",\n "idle": False\n }\n]\n-'
Telnet(10.0.0.146,36330): recv b'--\n> '
Telnet(10.0.0.146,36330): send b'queue-info\n'
Telnet(10.0.0.146,36330): recv b'PyON 1 units\n[\n {"id": "01", "state": "RUNNING", '
Telnet(10.0.0.146,36330): recv b'"error": "NO_ERROR", "project": 14820, "run": 676,'
Telnet(10.0.0.146,36330): recv b' "clone": 1, "gen": 69, "core": "0xa7", "unit": "0'
Telnet(10.0.0.146,36330): recv b'x000000532879986c5eaa27ec2f24db44", "percentdone":'
Telnet(10.0.0.146,36330): recv b' "53.66%", "eta": "1 hours 18 mins", "ppd": "36051'
Telnet(10.0.0.146,36330): recv b'", "creditestimate": "4214", "waitingon": "", "nex'
Telnet(10.0.0.146,36330): recv b'tattempt": "0.00 secs", "timeremaining": "4.84 day'
Telnet(10.0.0.146,36330): recv b's", "totalframes": 100, "framesdone": 53, "assigne'
Telnet(10.0.0.146,36330): recv b'd": "2020-06-08T01:41:50Z", "timeout": "2020-06-10'
Telnet(10.0.0.146,36330): recv b'T08:53:49Z", "deadline": "2020-06-12T23:17:50Z", "'
Telnet(10.0.0.146,36330): recv b'ws": "40.121.152.108", "cs": "52.224.109.74", "att'
Telnet(10.0.0.146,36330): recv b'empts": 0, "slot": "00", "tpf": "1 mins 41 secs", '
Telnet(10.0.0.146,36330): recv b'"basecredit": "755"}\n]\n---\n> '
Telnet(10.0.0.146,36330): send b'exit\n'
Which then gets formatted. some of this great work I came across in a post from StefanR5R on a fah post so I didn’t need to completely re-invent the wheel.
The script will create all your clients, and add metrics no matter how many slots are running, it will create a relationship between User and Clients so your can start doing dynamic dashboards.

Using this we can populate the data into vROps and start crafting dashboards like below:


Keep up the good folding work, Cancer and Diseases don’t discriminate everyone is equal. Thank you for get behind FaH and making this world of ours that little bit better 1 Compute cycle at a time.
Cheers