<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: HTTP-Retrievable Bandwidth Stats (in XML)</title>
	<atom:link href="http://blog.linode.com/2004/03/30/httpretrievable-bandwidth-stats-in-xml/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.linode.com/2004/03/30/httpretrievable-bandwidth-stats-in-xml/</link>
	<description>Announcements, news, and musings from your pals at Linode.com</description>
	<lastBuildDate>Tue, 24 Jan 2012 21:18:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: sweh</title>
		<link>http://blog.linode.com/2004/03/30/httpretrievable-bandwidth-stats-in-xml/comment-page-1/#comment-202</link>
		<dc:creator>sweh</dc:creator>
		<pubDate>Fri, 16 Jul 2004 02:36:41 +0000</pubDate>
		<guid isPermaLink="false">#comment-202</guid>
		<description>[quote:26d24b6abe=&quot;iggy&quot;]Here&#039;s a fairly non-fancy bash version. Minimal dependencies (bash, grep, and sed) though. [/quote]

In this thread ( http://www.linode.com/forums/viewtopic.php?t=983 ) I wrote a simple bash script to do similar.  You might be interested in the ${ } variable expansion abilities of bash to avoid the use of sed and grep.</description>
		<content:encoded><![CDATA[<p>[quote:26d24b6abe="iggy"]Here&#8217;s a fairly non-fancy bash version. Minimal dependencies (bash, grep, and sed) though. [/quote]</p>
<p>In this thread ( <a href="http://www.linode.com/forums/viewtopic.php?t=983" rel="nofollow">http://www.linode.com/forums/viewtopic.php?t=983</a> ) I wrote a simple bash script to do similar.  You might be interested in the ${ } variable expansion abilities of bash to avoid the use of sed and grep.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: iggy</title>
		<link>http://blog.linode.com/2004/03/30/httpretrievable-bandwidth-stats-in-xml/comment-page-1/#comment-201</link>
		<dc:creator>iggy</dc:creator>
		<pubDate>Thu, 15 Jul 2004 20:57:57 +0000</pubDate>
		<guid isPermaLink="false">#comment-201</guid>
		<description>Here&#039;s a fairly non-fancy bash version. Minimal dependencies (bash, grep, and sed) though. Could easily be expanded to be fancier. Have fun.

[code]
#!/bin/bash

# fetch linode bandwidth stats from the xml interface

USERNAME=&quot;iggy&quot;

wget -q -O - http&#058;//www.linode.com/members/bw/?user=$&#123;USERNAME&#125; &#124;
while read -s line ; do
        if `echo $line &#124; grep -q max_avail` ; then
                maxavail=&quot;`echo $line &#124; grep -o \&gt;.*\&lt; &#124; sed -e &#039;s&#058;^.&#058;&#058;&#039; -e &#039;s&#058;.$&#058;&#058;&#039;`&quot;
                maxavailmb=&quot;$&#040;&#040;maxavail/1048576&#041;&#041;&quot;
                echo &quot;Available bandwidth&#058; $maxavail &#040;$&#123;maxavailmb&#125;M&#041;&quot;
        fi
        if `echo $line &#124; grep -q rx_bytes` ; then
                rxbytes=&quot;`echo $line &#124; grep -o \&gt;.*\&lt; &#124; sed -e &#039;s&#058;^.&#058;&#058;&#039; -e &#039;s&#058;.$&#058;&#058;&#039;`&quot;
                rxbytesmb=&quot;`expr $&#123;rxbytes&#125; / 1048576`&quot;
                echo &quot;Received&#058; $rxbytes &#040;$&#123;rxbytesmb&#125;M&#041;&quot;
        fi
        if `echo $line &#124; grep -q tx_bytes` ; then
                txbytes=&quot;`echo $line &#124; grep -o \&gt;.*\&lt; &#124; sed -e &#039;s&#058;^.&#058;&#058;&#039; -e &#039;s&#058;.$&#058;&#058;&#039;`&quot;
                txbytesmb=&quot;`expr $&#123;txbytes&#125; / 1048576`&quot;
                echo &quot;Transmitted&#058; $txbytes &#040;$&#123;txbytesmb&#125;M&#041;&quot;
        fi
        if `echo $line &#124; grep -q total_bytes ` ; then
                totalbytes=&quot;`echo $line &#124; grep -o \&gt;.*\&lt; &#124; sed -e &#039;s&#058;^.&#058;&#058;&#039; -e &#039;s&#058;.$&#058;&#058;&#039;`&quot;
                totalbytesmb=&quot;`expr $&#123;totalbytes&#125; / 1048576`&quot;
                echo &quot;Total Used&#058; $totalbytes &#040;$&#123;totalbytesmb&#125;M&#041;&quot;
        fi
        if &#091; -n &quot;$maxavail&quot; -a -n &quot;$totalbytes&quot; &#093; ; then
                remainbw=&quot;$&#040;&#040;$maxavail-$totalbytes&#041;&#041;&quot;
                remainbwmb=`expr $&#123;maxavailmb&#125; - $&#123;totalbytesmb&#125;`
                echo &quot;Remaining Bandwidth for the month&#058; $remainbw &#040;$&#123;remainbwmb&#125;M&#041;&quot;
                break
        fi
done
[/code]</description>
		<content:encoded><![CDATA[<p>Here&#8217;s a fairly non-fancy bash version. Minimal dependencies (bash, grep, and sed) though. Could easily be expanded to be fancier. Have fun.</p>
<p>[code]<br />
#!/bin/bash</p>
<p># fetch linode bandwidth stats from the xml interface</p>
<p>USERNAME=&quot;iggy&quot;</p>
<p>wget -q -O - http&#58;//www.linode.com/members/bw/?user=$&#123;USERNAME&#125; |<br />
while read -s line ; do<br />
        if `echo $line | grep -q max_avail` ; then<br />
                maxavail=&quot;`echo $line | grep -o \&gt;.*\&lt; | sed -e 's&#58;^.&#58;&#58;' -e 's&#58;.$&#58;&#58;'`&quot;<br />
                maxavailmb=&quot;$&#40;&#40;maxavail/1048576&#41;&#41;&quot;<br />
                echo &quot;Available bandwidth&#58; $maxavail &#40;$&#123;maxavailmb&#125;M&#41;&quot;<br />
        fi<br />
        if `echo $line | grep -q rx_bytes` ; then<br />
                rxbytes=&quot;`echo $line | grep -o \&gt;.*\&lt; | sed -e 's&#58;^.&#58;&#58;' -e 's&#58;.$&#58;&#58;'`&quot;<br />
                rxbytesmb=&quot;`expr $&#123;rxbytes&#125; / 1048576`&quot;<br />
                echo &quot;Received&#58; $rxbytes &#40;$&#123;rxbytesmb&#125;M&#41;&quot;<br />
        fi<br />
        if `echo $line | grep -q tx_bytes` ; then<br />
                txbytes=&quot;`echo $line | grep -o \&gt;.*\&lt; | sed -e 's&#58;^.&#58;&#58;' -e 's&#58;.$&#58;&#58;'`&quot;<br />
                txbytesmb=&quot;`expr $&#123;txbytes&#125; / 1048576`&quot;<br />
                echo &quot;Transmitted&#58; $txbytes &#40;$&#123;txbytesmb&#125;M&#41;&quot;<br />
        fi<br />
        if `echo $line | grep -q total_bytes ` ; then<br />
                totalbytes=&quot;`echo $line | grep -o \&gt;.*\&lt; | sed -e 's&#58;^.&#58;&#58;' -e 's&#58;.$&#58;&#58;'`&quot;<br />
                totalbytesmb=&quot;`expr $&#123;totalbytes&#125; / 1048576`&quot;<br />
                echo &quot;Total Used&#58; $totalbytes &#40;$&#123;totalbytesmb&#125;M&#41;&quot;<br />
        fi<br />
        if &#91; -n &quot;$maxavail&quot; -a -n &quot;$totalbytes&quot; &#93; ; then<br />
                remainbw=&quot;$&#40;&#40;$maxavail-$totalbytes&#41;&#41;&quot;<br />
                remainbwmb=`expr $&#123;maxavailmb&#125; - $&#123;totalbytesmb&#125;`<br />
                echo &quot;Remaining Bandwidth for the month&#58; $remainbw &#40;$&#123;remainbwmb&#125;M&#41;&quot;<br />
                break<br />
        fi<br />
done<br />
[/code]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: caker</title>
		<link>http://blog.linode.com/2004/03/30/httpretrievable-bandwidth-stats-in-xml/comment-page-1/#comment-200</link>
		<dc:creator>caker</dc:creator>
		<pubDate>Thu, 15 Jul 2004 16:52:53 +0000</pubDate>
		<guid isPermaLink="false">#comment-200</guid>
		<description>http://www.linode.com/forums/viewtopic.php?t=795</description>
		<content:encoded><![CDATA[<p><a href="http://www.linode.com/forums/viewtopic.php?t=795" rel="nofollow">http://www.linode.com/forums/viewtopic.php?t=795</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jax</title>
		<link>http://blog.linode.com/2004/03/30/httpretrievable-bandwidth-stats-in-xml/comment-page-1/#comment-199</link>
		<dc:creator>jax</dc:creator>
		<pubDate>Wed, 07 Apr 2004 22:52:10 +0000</pubDate>
		<guid isPermaLink="false">#comment-199</guid>
		<description>I changed efudd&#039;s script to also dispay a percentage at the bottom.  It is green if less than 50%, yellow if less than 90%, and red is it&#039;s &gt;=90%.

Output looks like:
[code]As of Wed Apr  7 21&#058;46&#058;02 2004 you are currently UNDER your set limit &#040;80%&#041;.
        Input Bytes Xfer&#058; 0.16 GiBs
        Otput Bytes Xfer&#058; 0.89 GiBs
        ------------------------
        Total Bytes Xfer&#058; 1.04 GiBs of 25.00 available.
        Percent Usage&#058;    4.18 %
[/code]

Download from
[code]http&#058;//parazoid.net/bw.pl
[/code]</description>
		<content:encoded><![CDATA[<p>I changed efudd&#8217;s script to also dispay a percentage at the bottom.  It is green if less than 50%, yellow if less than 90%, and red is it&#8217;s &gt;=90%.</p>
<p>Output looks like:<br />
[code]As of Wed Apr  7 21&#58;46&#58;02 2004 you are currently UNDER your set limit &#40;80%&#41;.<br />
        Input Bytes Xfer&#58; 0.16 GiBs<br />
        Otput Bytes Xfer&#58; 0.89 GiBs<br />
        ------------------------<br />
        Total Bytes Xfer&#58; 1.04 GiBs of 25.00 available.<br />
        Percent Usage&#58;    4.18 %<br />
[/code]</p>
<p>Download from<br />
[code]http&#58;//parazoid.net/bw.pl<br />
[/code]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: efudd</title>
		<link>http://blog.linode.com/2004/03/30/httpretrievable-bandwidth-stats-in-xml/comment-page-1/#comment-198</link>
		<dc:creator>efudd</dc:creator>
		<pubDate>Wed, 31 Mar 2004 02:00:57 +0000</pubDate>
		<guid isPermaLink="false">#comment-198</guid>
		<description>Output looks like this:
[code]
As of Wed Jan 24 04&#058;45&#058;59 2007 you are currently UNDER your set limit &#040;80%&#041;.
        Input  Bytes Xfer&#058; 0.84 GiBs    Host&#058; host29.linode.com
        Output Bytes Xfer&#058; 2.62 GiBs    Load&#058; IDLE
        ------------------------
        Total Bytes Xfer&#058; 3.46 GiBs of 200.00 available.
[/code]

Recommended Installation Method:

Add this to your $HOME/.bash_profile

[code]&#091; -f $HOME/bin/bw.pl &#093; &amp;&amp; $HOME/bin/bw.pl[/code]

Code:

[code]
#!/usr/bin/perl 
# $Id&#058; bw.pl,v 1.11 2007/01/24 04&#058;40&#058;51 jason Exp $
########################################################################
# bw.pl -  Linode Bandwidth Utilization^W^H^Winfo Monitor via shell
# 
# Revision History&#058; 
# 	1.7 - First Public Release
#	1.8 - some lame fixes, such as 0byte $myLastState
#       1.11 - updated URL to /info/, added host level info
#
# To setup, modify $username to match your LPM login &#040;Web Login&#041;
#
# NOTES&#058; Please do not modify $userAgent or $maxTime as this is used
#        on linode server to monitor usage.
#
#        If you desire to graph your bandwidth usage, use your your
#        local interface stats.
########################################################################

# Installation Tips&#058;
# gentoo&#058; emerge XML-LibXML ....
# debian&#058; install gentoo OR apt-get install libxml-libxml-perl
# redhat&#058; install windows
# slackware&#058; rock on!

use XML&#058;&#058;LibXML;
use LWP&#058;&#058;UserAgent;
use IO&#058;&#058;File;
use strict;

# Config
my $username = &quot;someuser&quot;;
my $warning_pct = 80;
my $userAgent = &quot;BandWidth Snarf v1.11/&quot; . $username;
my $myLastState = $ENV&#123;HOME&#125; . &quot;/.bw_state&quot;;
my $maxTime = 43200; 
my $xmlState;

my $kilobyte = 1024;
my $megabyte = $kilobyte * 1024;
my $gigabyte = $megabyte * 1024;

if &#040;&#040;time&#040;&#041;-&#040;stat&#040;$myLastState&#041;&#041;&#091;9&#093; &gt; $maxTime&#041; &#124;&#124; &#040;&#040;our &#040;$f&#041;=&#040;stat&#040;$myLastState&#041;&#041;&#091;6&#093;&#041; &amp;&amp; $f==0&#041; &#041; &#123;
	# Use LWP to GET the data without any error checking.
	my $ua = LWP&#058;&#058;UserAgent-&gt;new&#040;keep_alive =&gt; 0, timeout =&gt; 10, agent =&gt; $userAgent&#041;;
	my $req = &quot;http&#058;//www.linode.com/members/info/?user=&quot; . $username;
	my $res = $ua-&gt;get&#040;$req&#041; &#124;&#124; die &quot;uh oh&#058; $!\n&quot;;

	my $fh = new IO&#058;&#058;File&#040;$myLastState, &#039;w&#039;&#041; &#124;&#124; die &quot;Ack $!&quot;;
		print $fh $res-&gt;content;
	$fh-&gt;close;
	$xmlState = $res-&gt;content;
&#125; else &#123;
	my $fh = new IO&#058;&#058;File&#040;$myLastState, &#039;r&#039;&#041; &#124;&#124; die &quot;Ack $!&quot;;
	local $/;
	$xmlState = &lt;$fh&gt;;
	$fh-&gt;close;
&#125;

# Instantiate a new parser object then utilize the crap out of it
my $parser = new XML&#058;&#058;LibXML;
my $doc = $parser-&gt;parse_string&#040;$xmlState&#041;;

# Leeto like a burrito parse da shanizzle out!
my $year 	= $doc-&gt;findvalue&#040;&#039;/linData/bwdata/year/text&#040;&#041;&#039;&#041;;
my $month 	= $doc-&gt;findvalue&#040;&#039;/linData/bwdata/month/text&#040;&#041;&#039;&#041;;
my $max_bytes	= $doc-&gt;findvalue&#040;&#039;/linData/bwdata/max_avail/text&#040;&#041;&#039;&#041;;
my $rx_bytes 	= $doc-&gt;findvalue&#040;&#039;/linData/bwdata/rx_bytes/text&#040;&#041;&#039;&#041;;
my $tx_bytes 	= $doc-&gt;findvalue&#040;&#039;/linData/bwdata/tx_bytes/text&#040;&#041;&#039;&#041;;
my $total_bytes	= $doc-&gt;findvalue&#040;&#039;/linData/bwdata/total_bytes/text&#040;&#041;&#039;&#041;;
# new, v1.11 +
my $parentHost	= $doc-&gt;findvalue&#040;&#039;/linData/host/host/text&#040;&#041;&#039;&#041;;
my $hostLoad	= $doc-&gt;findvalue&#040;&#039;/linData/host/hostLoad/text&#040;&#041;&#039;&#041;;
my $pendingJobs	= $doc-&gt;findvalue&#040;&#039;/linData/host/pendingJobs/text&#040;&#041;&#039;&#041;;

# Create some potentially useful variables based on the datum above
my $timestamp	= $month . &quot;/&quot; . $year;

if &#040; &#040; $rx_bytes + $tx_bytes &#041; != $total_bytes &#041; &#123;
	print &quot;Hmmm. My tx+rx count != caker&#039;s total_bytes count!\n&quot;;
	print &quot;Additionally, you shouldn&#039;t ever see this message.&quot;;
&#125;

printf&#040;&quot;As of %s you are currently %s your set limit &#040;%d%%&#041;.\n&quot;,
 scalar&#040;gmtime&#040;&#040;stat&#040;$myLastState&#041;&#041;&#091;9&#093;&#041;&#041;,
 &#040;&#040;&#040;$total_bytes / $max_bytes&#041; * 100&#041; &gt; $warning_pct&#041; ? &quot;OVER&quot; &#058; &quot;UNDER&quot;,
  $warning_pct&#041;;
printf&#040;&quot;\tInput  Bytes Xfer&#058; %02.2f GiBs\tHost&#058; %s\n&quot;, $rx_bytes / $gigabyte, $parentHost&#041;;
printf&#040;&quot;\tOutput Bytes Xfer&#058; %02.2f GiBs\tLoad&#058; %s\n&quot;, $tx_bytes / $gigabyte,uc&#040;$hostLoad&#041;&#041;;
printf&#040;&quot;\t------------------------\n&quot;&#041;;
printf&#040;&quot;\tTotal Bytes Xfer&#058; %02.2f GiBs of %02.2f available.\n&quot;, 
 $total_bytes / $gigabyte, $max_bytes / $gigabyte&#041;;


[/code]

You can download this from 

[code]http&#058;//forever.broked.net/~jason/bw.pl.txt[/code]

Please report any bugs to bw@broked.net or find me on IRC.

You will need to edit a couple of things in the script as defined inside it for this to work. You will also need the perl modules used... i&#039;ve listed installation instructions for these modules for each distribution as best I can inside the script.

LASTLY - Please *LEAVE* it at 7200 seconds and do not modify the $useragent variable. 

[b]Not modifying them makes you a very good community member and mikegrb will give you cookies.[/b]

-NOTE-
There are a couple of minor bugs in this that only show up with -w and strict on first run due to uninitialized variables. It is a one-time error.

ALSO - If you fail to properly set your $username, you will have to manually remove $HOME/.bw_state and try again. 

Lastly - the time displayed is in UTC instead of localtime.

[b]-EDIT-[/b]
Thu Feb 17 18:42:28 EST 2005 - jasonl
Found a bug in &#039;Output&#039;. Really. I apparently typo&#039;d &#039;Otput&#039;.

Fri Jun 17 22:52:45 EDT 2005 -jasonl
Fixed long standing issue with a 0 byte state file.

Tue Jan 23 23:47:04 EST 2007 -jasonl
Updated for /info vs. /bw URL, fixed bug in useragent, added hostload information

-efudd</description>
		<content:encoded><![CDATA[<p>Output looks like this:<br />
[code]<br />
As of Wed Jan 24 04&#58;45&#58;59 2007 you are currently UNDER your set limit &#40;80%&#41;.<br />
        Input  Bytes Xfer&#58; 0.84 GiBs    Host&#58; host29.linode.com<br />
        Output Bytes Xfer&#58; 2.62 GiBs    Load&#58; IDLE<br />
        ------------------------<br />
        Total Bytes Xfer&#58; 3.46 GiBs of 200.00 available.<br />
[/code]</p>
<p>Recommended Installation Method:</p>
<p>Add this to your $HOME/.bash_profile</p>
<p>[code]&#91; -f $HOME/bin/bw.pl &#93; &amp;&amp; $HOME/bin/bw.pl[/code]</p>
<p>Code:</p>
<p>[code]<br />
#!/usr/bin/perl<br />
# $Id&#58; bw.pl,v 1.11 2007/01/24 04&#58;40&#58;51 jason Exp $<br />
########################################################################<br />
# bw.pl -  Linode Bandwidth Utilization^W^H^Winfo Monitor via shell<br />
#<br />
# Revision History&#58;<br />
# 	1.7 - First Public Release<br />
#	1.8 - some lame fixes, such as 0byte $myLastState<br />
#       1.11 - updated URL to /info/, added host level info<br />
#<br />
# To setup, modify $username to match your LPM login &#40;Web Login&#41;<br />
#<br />
# NOTES&#58; Please do not modify $userAgent or $maxTime as this is used<br />
#        on linode server to monitor usage.<br />
#<br />
#        If you desire to graph your bandwidth usage, use your your<br />
#        local interface stats.<br />
########################################################################</p>
<p># Installation Tips&#58;<br />
# gentoo&#58; emerge XML-LibXML ....<br />
# debian&#58; install gentoo OR apt-get install libxml-libxml-perl<br />
# redhat&#58; install windows<br />
# slackware&#58; rock on!</p>
<p>use XML&#58;&#58;LibXML;<br />
use LWP&#58;&#58;UserAgent;<br />
use IO&#58;&#58;File;<br />
use strict;</p>
<p># Config<br />
my $username = &quot;someuser&quot;;<br />
my $warning_pct = 80;<br />
my $userAgent = &quot;BandWidth Snarf v1.11/&quot; . $username;<br />
my $myLastState = $ENV&#123;HOME&#125; . &quot;/.bw_state&quot;;<br />
my $maxTime = 43200;<br />
my $xmlState;</p>
<p>my $kilobyte = 1024;<br />
my $megabyte = $kilobyte * 1024;<br />
my $gigabyte = $megabyte * 1024;</p>
<p>if &#40;&#40;time&#40;&#41;-&#40;stat&#40;$myLastState&#41;&#41;&#91;9&#93; &gt; $maxTime&#41; || &#40;&#40;our &#40;$f&#41;=&#40;stat&#40;$myLastState&#41;&#41;&#91;6&#93;&#41; &amp;&amp; $f==0&#41; &#41; &#123;<br />
	# Use LWP to GET the data without any error checking.<br />
	my $ua = LWP&#58;&#58;UserAgent-&gt;new&#40;keep_alive =&gt; 0, timeout =&gt; 10, agent =&gt; $userAgent&#41;;<br />
	my $req = &quot;http&#58;//www.linode.com/members/info/?user=&quot; . $username;<br />
	my $res = $ua-&gt;get&#40;$req&#41; || die &quot;uh oh&#58; $!\n&quot;;</p>
<p>	my $fh = new IO&#58;&#58;File&#40;$myLastState, 'w'&#41; || die &quot;Ack $!&quot;;<br />
		print $fh $res-&gt;content;<br />
	$fh-&gt;close;<br />
	$xmlState = $res-&gt;content;<br />
&#125; else &#123;<br />
	my $fh = new IO&#58;&#58;File&#40;$myLastState, 'r'&#41; || die &quot;Ack $!&quot;;<br />
	local $/;<br />
	$xmlState = &lt;$fh&gt;;<br />
	$fh-&gt;close;<br />
&#125;</p>
<p># Instantiate a new parser object then utilize the crap out of it<br />
my $parser = new XML&#58;&#58;LibXML;<br />
my $doc = $parser-&gt;parse_string&#40;$xmlState&#41;;</p>
<p># Leeto like a burrito parse da shanizzle out!<br />
my $year 	= $doc-&gt;findvalue&#40;'/linData/bwdata/year/text&#40;&#41;'&#41;;<br />
my $month 	= $doc-&gt;findvalue&#40;'/linData/bwdata/month/text&#40;&#41;'&#41;;<br />
my $max_bytes	= $doc-&gt;findvalue&#40;'/linData/bwdata/max_avail/text&#40;&#41;'&#41;;<br />
my $rx_bytes 	= $doc-&gt;findvalue&#40;'/linData/bwdata/rx_bytes/text&#40;&#41;'&#41;;<br />
my $tx_bytes 	= $doc-&gt;findvalue&#40;'/linData/bwdata/tx_bytes/text&#40;&#41;'&#41;;<br />
my $total_bytes	= $doc-&gt;findvalue&#40;'/linData/bwdata/total_bytes/text&#40;&#41;'&#41;;<br />
# new, v1.11 +<br />
my $parentHost	= $doc-&gt;findvalue&#40;'/linData/host/host/text&#40;&#41;'&#41;;<br />
my $hostLoad	= $doc-&gt;findvalue&#40;'/linData/host/hostLoad/text&#40;&#41;'&#41;;<br />
my $pendingJobs	= $doc-&gt;findvalue&#40;'/linData/host/pendingJobs/text&#40;&#41;'&#41;;</p>
<p># Create some potentially useful variables based on the datum above<br />
my $timestamp	= $month . &quot;/&quot; . $year;</p>
<p>if &#40; &#40; $rx_bytes + $tx_bytes &#41; != $total_bytes &#41; &#123;<br />
	print &quot;Hmmm. My tx+rx count != caker's total_bytes count!\n&quot;;<br />
	print &quot;Additionally, you shouldn't ever see this message.&quot;;<br />
&#125;</p>
<p>printf&#40;&quot;As of %s you are currently %s your set limit &#40;%d%%&#41;.\n&quot;,<br />
 scalar&#40;gmtime&#40;&#40;stat&#40;$myLastState&#41;&#41;&#91;9&#93;&#41;&#41;,<br />
 &#40;&#40;&#40;$total_bytes / $max_bytes&#41; * 100&#41; &gt; $warning_pct&#41; ? &quot;OVER&quot; &#58; &quot;UNDER&quot;,<br />
  $warning_pct&#41;;<br />
printf&#40;&quot;\tInput  Bytes Xfer&#58; %02.2f GiBs\tHost&#58; %s\n&quot;, $rx_bytes / $gigabyte, $parentHost&#41;;<br />
printf&#40;&quot;\tOutput Bytes Xfer&#58; %02.2f GiBs\tLoad&#58; %s\n&quot;, $tx_bytes / $gigabyte,uc&#40;$hostLoad&#41;&#41;;<br />
printf&#40;&quot;\t------------------------\n&quot;&#41;;<br />
printf&#40;&quot;\tTotal Bytes Xfer&#58; %02.2f GiBs of %02.2f available.\n&quot;,<br />
 $total_bytes / $gigabyte, $max_bytes / $gigabyte&#41;;</p>
<p>[/code]</p>
<p>You can download this from </p>
<p>[code]http&#58;//forever.broked.net/~jason/bw.pl.txt[/code]</p>
<p>Please report any bugs to <a href="mailto:bw@broked.net">bw@broked.net</a> or find me on IRC.</p>
<p>You will need to edit a couple of things in the script as defined inside it for this to work. You will also need the perl modules used&#8230; i&#8217;ve listed installation instructions for these modules for each distribution as best I can inside the script.</p>
<p>LASTLY &#8211; Please *LEAVE* it at 7200 seconds and do not modify the $useragent variable. </p>
<p>[b]Not modifying them makes you a very good community member and mikegrb will give you cookies.[/b]</p>
<p>-NOTE-<br />
There are a couple of minor bugs in this that only show up with -w and strict on first run due to uninitialized variables. It is a one-time error.</p>
<p>ALSO &#8211; If you fail to properly set your $username, you will have to manually remove $HOME/.bw_state and try again. </p>
<p>Lastly &#8211; the time displayed is in UTC instead of localtime.</p>
<p>[b]-EDIT-[/b]<br />
Thu Feb 17 18:42:28 EST 2005 &#8211; jasonl<br />
Found a bug in &#8216;Output&#8217;. Really. I apparently typo&#8217;d &#8216;Otput&#8217;.</p>
<p>Fri Jun 17 22:52:45 EDT 2005 -jasonl<br />
Fixed long standing issue with a 0 byte state file.</p>
<p>Tue Jan 23 23:47:04 EST 2007 -jasonl<br />
Updated for /info vs. /bw URL, fixed bug in useragent, added hostload information</p>
<p>-efudd</p>
]]></content:encoded>
	</item>
</channel>
</rss>

