Internode Usage meter for Conky

This is a rework of the script from Internet Usage Monitoring – conky style! But the only problem I found is that it not wanted to work with my NodeMobile account. So here is my rewrite of parts of the script to use the other Internode Usage API url.

One thing you need to find out for this script to work is the service number for the account you want to get the usage for. That can be easily obtained by pointing your web browser to https://customer-webtools-api.internode.on.net/api/v1.5/ and logging in.


This is old code please refer to http://dale.id.au/pub/node-usage/

On the page is the number you need to add to ‘service=XXXXXXX’ in the scipt below

#!/bin/bash
## node-usage.sh
## Author:
## Quail <quail .linux@gmail.com> http://quail.southernvaleslug.org
## Created on 8th April 2010.
## Licensed under the GPL version 3.

## Get usage information from Internode's web page.
## requires: curl and gawk


# Set the username, password and service number
service=XXXXXXX
id=XXXXXXX
pw=XXXXXXX

# Grab the details
curl -s -u $id:$pw https://customer-webtools-api.internode.on.net/api/v1.5/$service/usage >/tmp/usage.xml

# Process the usage.xml
rollover=`cat /tmp/usage.xml |sed -n 2p|cut -d"=" -f5|cut -d'"' -f2`
quota=`cat /tmp/usage.xml |sed -n 2p|cut -d"=" -f7|cut -d'"' -f2`
used=`cat /tmp/usage.xml |sed -n 2p|cut -d">" -f6|cut -d"< " -f1`

# Break up the values into their respective parts
echo "$used $quota" > /tmp/node-text.txt
echo "Used: `cat /tmp/node-text.txt | gawk '{print $1/1000/1000}'` MB Quota: `cat /tmp/node-text.txt | gawk '{print $2/1000/1000}'` MB Period Ends: $rollover" > /tmp/node-usage.txt

# Generate the percent used.
cat /tmp/node-text.txt | gawk '{print $1/$2*100}' > /tmp/node-graph.txt
percent=`cat /tmp/node-graph.txt`
echo $(printf %.0f $percent) > /tmp/node-percent.txt

exit

Now make the script executable and run it from cron.

This how I have display the info in Conky

${color #5b6dad}Internode Usage: ${hr 1}
${color #7f8ed3} ${execi 900 cat /tmp/node-percent.txt}% ${execibar 900 cat /tmp/node-graph.txt}
${color #7f8ed3} ${execi 900 cat /tmp/node-usage.txt}

3 thoughts on “Internode Usage meter for Conky”

    1. you’ll have to check out the API Bigpond have in place for handling this sort of thing. If you can’t find the info via there web site I suggest try emailing them to see if they can supply you with the info.

Leave a Reply