Load average using python
This little script gets the load average every five seconds and sends it to statd. It should work on any unix system (linux, freebsd, mac os x, etc.).
You need to download stathat.py and put it in your import path.
#!/usr/bin/python import os import time from stathat import StatHat sh = StatHat() while True : load_avg = os.getloadavg()[0] sh.ez_post_value('you@example.com', 'load avg', load_avg) time.sleep(5)
I'm using stathat-0.0.2 and this doesn't work; `sh` has the following fields and methods only: sh.STATHAT_URL, sh.count, sh.email, sh.session, sh.value
posted 2013-04-05 08:30:57