Page 1 of 1

Suggested feature: Quota alarms

Posted: Tue Jun 29, 2010 5:15 am
by cj_mack
Hi,
would it be in anyway possible to setup an alarm for each quota. For example, if someone was reaching 80% or 95% (or whatever has been chosen) they can have an email sent to their email address. I realise this would involve the likes of an SMTP client, and having an SMTP account to use.

If this could be added, it would be very very handy. If it's not possible, dreams are free I guess. ;)

Thanks.

Re: Suggested feature: Quota alarms

Posted: Wed Jun 30, 2010 8:28 am
by Eric
Possible, yes, but not a high priority.

The best way to do this is to create a cron job that calls a script which calls print_quotas, and then takes appropriate action if a quota is at a given level. I don't know when (if ever) I'll get to this, but if you want to work on it, I love contributions!

Re: Suggested feature: Quota alarms

Posted: Wed Jun 30, 2010 8:18 pm
by cj_mack
Hi Eric,
Thanks for that. As much as I appreciate that the developers are busy people, I wouldn't have a clue on how to script it!
I think I will just leave it as is for the time being, unless someone else is keen to take this on?

Re: Suggested feature: Quota alarms

Posted: Thu Jul 01, 2010 2:39 am
by DoesItMatter
I'll try and take a look at this.

Have been interested in trying Cron, but have never had a use
for it, nor have I had a use for Quotas.

I'll try this out and see what I can come up with.

What are typical quotas people set?

Keep in mind, I have never used QoS or Quotas, so please give me
a sampling that you would normally use so I can mimic it.

How would this alert though? I mean, how would you know a limit
is nearing 85% or 95%? Would this send a message via SMTP?
Would that mean I'd have to run a SMTP daemon on the router?
This will definitely be quite interesting.

Re: Suggested feature: Quota alarms

Posted: Thu Jul 01, 2010 2:53 am
by cj_mack
My quotas all depend on how many flatmates I have at the time. At the moment, I have a 30gb plan (will be changing soon), and each flatmate gets 5gb a month. We currently have 1 flatmate, so that leaves 24gb for myself and my partner. (minus 1gb for VoIP) That then gets split between our computers and game consoles.

Phil: 5gb (2 devices)
Marie: 12gb (3 devices)
Sam: 12gb (4 devices)
VoIP: 1gb (1 device)

I hope this helps. As I say, my quotas all change depending on flatmates, and what plan I'm on at the time.

Re: Suggested feature: Quota alarms

Posted: Thu Jul 01, 2010 2:59 am
by cj_mack
As far as the alerts go, I imagined the router would send an automated email, like an ISP would when you near your data limit.

E.g.

From: router@myisp.com
To: quotauser@myisp.com
Subject: Your data quota limit is about to be reached

Hi XXXX,

Your data limit of XXgb on the local network has reached XX%. Please be careful you do not reach your limit, otherwise you will no longer have internet access until the next data period.

Your data period resets every (day/week/month) on/at (XXth/0900hrs)

Thanks,

Gargoyle Router Management Utility.


Does this give you an idea of what I had in mind? A customizable message would be ideal, but this sort of thing would work.

Re: Suggested feature: Quota alarms

Posted: Thu Jul 01, 2010 3:29 am
by DoesItMatter
Yea, a lot of this would not be hard.

Just a matter of learning the code and scripting,
then just reading in some variables and plugging it into a form.

The hardest part I could see is getting the SMTP daemon working.
Never installed my own software packages, so that is a
learning curve thing I'll have to overcome.

If Eric is viewing this, instead of an SMTP message, I wonder if there
is anyway for the cron script to actually break into the web page
and come up with an alert when the user tries to access internet?

I could see a problem with this already, as far as the SMTP approach.

Messages get blocked as spam, ISP doesn't let the messages go
outbound, or they get stuck in an out-queue somewhere, etc.
The 'hi-jacking' of the page, for want of a better term, would
be the most reliable and definitely the most visible to the user.

Re: Suggested feature: Quota alarms

Posted: Sat Jul 03, 2010 5:35 pm
by rfdude
What about implementing an alarm as a pop-up or one-time page redirect instead of an email? Nodogsplash with Gargoyle?

rfdude

Re: Suggested feature: Quota alarms

Posted: Sun Aug 01, 2010 7:41 pm
by cj_mack
Yeah the redirect may be another option. I would prefer the email, however the redirect I would be happy with.

Re: Suggested feature: Quota alarms

Posted: Mon Aug 02, 2010 12:59 am
by rfdude
Actually no new web page or otherwise required .... Gargoyle already provides Quota remaining on the login page. I'm using Gargoyle at an RV camp to try and stay withing the ISP monthly quota. I have a notice on the bulletin board that lets people know they can check their quota remaining by browsing the router IP address (192.168...)... but almost no one does this. They just go full steam until they get cut off. Then they learn to stay away from video streaming for next time.

So a redirect to the Gargoyle login screen at some threshold would grab their attention in a polite way rather than an abrubt full stop.