Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Tue Jun 29, 2004 3:20 am 
Offline
Senior Newbie

Joined: Mon Mar 22, 2004 6:50 pm
Posts: 12
Anybody know if Linode will send an email if you are nearing your bandwidth quota?

I just placed a Linux ISO on my linode and I want to know when I can pull the plug before I get billed extra for the bandwidth.

Thanks.

Holden


Top
   
 Post subject:
PostPosted: Tue Jun 29, 2004 3:24 am 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 6:24 pm
Posts: 3090
Website: http://www.linode.com/
Location: Galloway, NJ
No, but I do provide your bandwidth statistics in a "poll-able" http retrievable XML document:

http://www.linode.com/forums/viewtopic.php?t=776
http://www.linode.com/forums/viewtopic.php?t=795

Time for someone to code this up as a cron-job (be nice, only poll every few hours or something) and set it up to email you...

-Chris


Top
   
 Post subject:
PostPosted: Tue Jun 29, 2004 3:28 pm 
Offline
Senior Member
User avatar

Joined: Tue Apr 13, 2004 6:54 pm
Posts: 833
caker wrote:
Time for someone to code this up as a cron-job (be nice, only poll every few hours or something) and set it up to email you...


Here ya go. This is quick and nasty and will mail you every time you run the script. Just disable it in cron once you've been alerted :-) It requires "lynx" to be installed to do the request

Code:
#!/bin/bash

# Your linode user name
USER=YOURUSERNAME

# Where to report mail
EMAIL=YOUREMAILADDRESS

# What level to send emails at
WARN=90

URL="http://www.linode.com/members/bw/?user=$USER"

data=$(lynx --dump $URL)

max=${data#*<max_avail>} ; max=${max%%<*}
total=${data#*<total_bytes>}; total=${total%%<*}


let pct=100*total/max

if [ $pct -gt $WARN ]
then
  echo -e "Over $WARN% of quota used\nBytes transferred=$total (allowance=$max)\nThis is approx $pct%" | /bin/mail -s "Linode bandwidth warning" $EMAIL
fi

_________________
Rgds
Stephen
(Linux user since kernel version 0.11)


Top
   
 Post subject:
PostPosted: Tue Jun 29, 2004 10:42 pm 
Offline
Senior Newbie

Joined: Mon Mar 22, 2004 6:50 pm
Posts: 12
Thanks. The script works :). I just added the script to my daily cron tab.


Holden


Top
   
 Post subject:
PostPosted: Wed Jun 30, 2004 10:15 pm 
Offline
Senior Newbie

Joined: Mon Mar 22, 2004 6:50 pm
Posts: 12
Its not really that important but it would be nice to have the official linode time on the members control panel. Perhaps near the bandwidth stat box. This can be useful to cheapskates :) like me who monitors the bandwidth near the end of the month. :)


Holden


Top
   
 Post subject:
PostPosted: Wed Jun 30, 2004 10:22 pm 
Offline
Senior Member
User avatar

Joined: Tue Apr 13, 2004 6:54 pm
Posts: 833
holden wrote:
Its not really that important but it would be nice to have the official linode time on the members control panel.

Well, there is a date on the "job queue" page :-)

_________________
Rgds

Stephen

(Linux user since kernel version 0.11)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: mwchase and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group