| Author |
Message |
holden
Joined: 22 Mar 2004
Posts: 12
|
| Posted: Tue Jun 29, 2004 2:20 am Post subject: Notification for Bandwidth Consumption |
|
|
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 |
|
| Back to top |
|
caker
Joined: 15 Apr 2003
Posts: 2392
Location: Galloway, NJ
|
| Posted: Tue Jun 29, 2004 2:24 am Post subject: |
|
|
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 |
|
| Back to top |
|
sweh
Joined: 13 Apr 2004
Posts: 234
|
| Posted: Tue Jun 29, 2004 2:28 pm Post subject: |
|
|
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
|
|
| Back to top |
|
holden
Joined: 22 Mar 2004
Posts: 12
|
| Posted: Tue Jun 29, 2004 9:42 pm Post subject: |
|
|
Thanks. The script works :). I just added the script to my daily cron tab.
Holden |
|
| Back to top |
|
holden
Joined: 22 Mar 2004
Posts: 12
|
| Posted: Wed Jun 30, 2004 9:15 pm Post subject: |
|
|
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 |
|
| Back to top |
|
sweh
Joined: 13 Apr 2004
Posts: 234
|
| Posted: Wed Jun 30, 2004 9:22 pm Post subject: |
|
|
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 :-) |
|
| Back to top |
|
| |