Node Usage for Conky is a Bash script for retrieving usage data from Internode's web API so that it can then be displayed in Conky. Node Usage for Conky is a rework of the original code by Matt found here

Author - Dale http://dale.id.au
Licensed under the GPL version 3.
Feedback and comments, you can find my email address in the download or you can post them here

Or you can follow me on Identi.ca for updates etc to the script


You need the following software installed for this script to work:
Curl - http://curl.haxx.se/
Gawk - http://www.gnu.org/software/gawk/
These packages should be available in you distribution's repository.

And of course Conky and an active Internode account.


Make sure the script is executable:

$ chmod 755 node-usage.sh

Add the following line to ~/.netrc remember to change 'myself'(username) and 'secret'(password)

machine customer-webtools-api.internode.on.net login myself password secret
Example of doing it via terminal:
$ echo "machine customer-webtools-api.internode.on.net login myself password secret" >> ~/.netrc
now to be safe do:
$ chmod 600 ~/.netrc
This is to make sure that the file is only readable by your account.

To get the script to update for example every 30 minutes do the following to cron:

$ crontab -e
and now add:
*/30 * * * * /home/quail/programs/scripts/node-usage.sh
And it best not to have it updating anything less than 30 minutes.


Here is the snippet of the code for the ~/.conkyrc file:

${color #5b6dad}Internode Usage: ${hr 1}
 ${color #7f8ed3}${execi 900 cat ~/.config/internode/cache/node-percent.txt}% ${execibar 900 cat ~/.config/internode/cache/node-graph.txt}
 ${color #5b6dad}Used: ${color #7f8ed3}${execi 900 cat ~/.config/internode/cache/node-used.txt}   ${color #5b6dad}Quota: ${color #7f8ed3}${execi 900 cat ~/.config/internode/cache/node-quota.txt}${alignr}${color #5b6dad}Days Left: ${color #7f8ed3}${execi 900 cat ~/.config/internode/cache/node-rollover.txt}
 ${color #5b6dad}Today: ${color #7f8ed3}${execi 900 cat ~/.config/internode/cache/node-today.txt}${alignr}${color #5b6dad}Remaining: ${color #7f8ed3}${execi 900 cat ~/.config/internode/cache/node-remaining.txt}


2012-07-12 0.0.6 * Fixed problem with spamming a proxy with useless info. * Updated contact info in README and script Download 2010-04-15 0.0.5 * Added multiple account support, Thanks to Karl Bowden * Updated README Download 2010-04-15 0.0.4 * Added current days usage. * Added a tmp directory for storing data downloaded and corrected some the to match that. * Made it so some the output are set to the to the 2 decimal point. Download 2010-04-12 0.0.3 * Add remaining quote and average usage per day based on quota left * clean up code and made it more configurable in conky. Download 2010-04-10 0.0.2 * Added user agent string * Modified the output data so it more configurable in Conky ${execi 900 cat ~/.config/internode/cache/node-quota.txt} * Added version * Updated README Download 2010-04-09 * Initial Release Download


What is Conky?
Conky is a free, light-weight system monitor for X, that displays any information on your desktop.

Where can I run the 'node-usage.sh' script?
In theory anywhere you like under your home directory

Where does Node Usage for Conky store its files?
You'll find them in your home directory under .config/internode/

What are all theses files in ~/.config/internode/cache/ directory?
These files are used to store the data that can be used in Conky.

Here is a break down of the files and what they used for:
node-curdayavg.txt - The average you can use for the day
node-graph.txt - percentage for producing the graph
node-left.txt - Data you have left for the month
node-percent.txt - percentage of data used
node-quota.txt - Monthly data quota
node-remaining.txt - Usage left for the month + day average
node-rollover.txt - The date your account rolls over
node-today.txt - Todays data used
node-used.txt - Overall data used for the month

How do I monitor multiple accounts?
Create an account directory in ~/.config/internode and create a ~/.config/internode/account/.netrc file for each account you want to monitor. Then execute the script like this node-usage.sh account for each account. Then configure ~/.conkyrc accordingly.