I just saw this posted and wanted to add it to my server so I did. I have no python experience, but adding it was a snap. It currently does not auto-refresh because I didn't dig into the templates and scripts enough to see how that worked, but it gets the job done for me and is very informative. Took me about 30 minutes to figure out. I also removed some other stuff from the template I didn't want. Here's what mine looks like:
Oh and this is for linux only. I'm running an ubuntu server with 2 4x500gb raid 5 partitions. Should work with any linux distribution though.
Two files to modify. interface.py and your main.tmpl in whatever template folder you are using.
In interface.py located in /sabnzbd .4.4/sabnzbd
search for:
Code: Select all
PROVIDER = DictAuthProvider({})
USERNAME = None
PASSWORD = None
#------------------------------------------------------------------------------
after add:
Code: Select all
def upsys():
"""Returns uptime and cpu load"""
import commands
a = commands.getoutput("uptime")
return a
search for:
Code: Select all
header['diskspacetotal2'] = "%.2f" % disktotal(sabnzbd.COMPLETE_DIR)
after add:
Code: Select all
header['uptimesys'] = "%s" % upsys()
search for:
Code: Select all
"diskspace2" : diskfree(sabnzbd.COMPLETE_DIR),
after add:
search for and add the same thing again. There are two places where the above string is found.
Then in main.tmpl in the folder /sabnzbd .4.4/interfaces/smpl/templates
I use the smpl template. I just quick looked at the default main.tmpl and I wasn't sure where to put it, but this is just the code to output the results, so you can put it anywhere you want in any template.
scroll all the way to the bottom and add ${uptimesys}
I put it right before "sabnzbd version: $version"
I don't think a restart is even required, but it might be. Just refresh the page and you should see your uptime and load statistics. Let me know if you have an questions.
-xxhds