Cacher
Cacher copied to clipboard
Request: Add drive space percentage free
Hi,
Thanks for the work on this script. Just deployed and it works a treat. Is there any chance you could add metrics on drive space used by the cache or overall used/free ?
Also there is a typo bandwidth is showing as bandwith
Shane
hi @shanemdoyle ,
Please note this is ugly, as i do NOT know python at all. This worked for me however:
sudo nano cacher.py
control + w to search. Search for iPodNumberLog = []
I added the following after that line:
df_output_lines = [s.split() for s in os.popen("df -PH /PATH/TO/YOUR/VOLUME/").read().splitlines()]
HDspace = df_output_lines[1:]
Control + W to search again. search for # End of the final output.
Add the following lines:
#HD Space Test
finalOutput.append('')
finalOutput.append(' Caching Disk -Total -Used -Free -Percent -Volume')
finalOutput.append(' %s' % HDspace)
Control + X to save and quit.
At the very bottom of your Cacher report, you'll now see the following.
Remember, change the /PATH/TO/YOUR/VOLUME/ appropriately to your needs. It definitely is NOT pretty, and someone could definitely do it better, but it'll get you by.