Suggested feature: Quota alarms

Suggest improvements and new features for Gargoyle.

Moderator: Moderators

Post Reply
cj_mack
Posts: 53
Joined: Sun Dec 13, 2009 8:56 am

Suggested feature: Quota alarms

Post 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.

Eric
Site Admin
Posts: 1443
Joined: Sat Jun 14, 2008 1:14 pm

Re: Suggested feature: Quota alarms

Post 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!

cj_mack
Posts: 53
Joined: Sun Dec 13, 2009 8:56 am

Re: Suggested feature: Quota alarms

Post 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?

User avatar
DoesItMatter
Moderator
Posts: 1373
Joined: Thu May 21, 2009 3:56 pm

Re: Suggested feature: Quota alarms

Post 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.
:twisted: Soylent Green Is People! :twisted:
2x Asus RT-N16 = Asus 3.0.0.4.374.43 Merlin
2x Buffalo WZR-HP-G300NH V1 A0D0 = Gargoyle 1.9.x / LEDE 17.01.x
2x Engenius - ESR900 Stock 1.4.0 / OpenWRT Trunk 49400

cj_mack
Posts: 53
Joined: Sun Dec 13, 2009 8:56 am

Re: Suggested feature: Quota alarms

Post 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.

cj_mack
Posts: 53
Joined: Sun Dec 13, 2009 8:56 am

Re: Suggested feature: Quota alarms

Post 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.

User avatar
DoesItMatter
Moderator
Posts: 1373
Joined: Thu May 21, 2009 3:56 pm

Re: Suggested feature: Quota alarms

Post 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.
:twisted: Soylent Green Is People! :twisted:
2x Asus RT-N16 = Asus 3.0.0.4.374.43 Merlin
2x Buffalo WZR-HP-G300NH V1 A0D0 = Gargoyle 1.9.x / LEDE 17.01.x
2x Engenius - ESR900 Stock 1.4.0 / OpenWRT Trunk 49400

rfdude
Posts: 41
Joined: Sat May 08, 2010 2:16 pm

Re: Suggested feature: Quota alarms

Post by rfdude »

What about implementing an alarm as a pop-up or one-time page redirect instead of an email? Nodogsplash with Gargoyle?

rfdude
rfdude
------------------
1.09.2 Buffalo WZR-HP-G300NH2 -> 8 OpenMesh AP's
1.10.0 Archer C7 -> Multiple Cisco 1702i Autonomous Mode

cj_mack
Posts: 53
Joined: Sun Dec 13, 2009 8:56 am

Re: Suggested feature: Quota alarms

Post by cj_mack »

Yeah the redirect may be another option. I would prefer the email, however the redirect I would be happy with.

rfdude
Posts: 41
Joined: Sat May 08, 2010 2:16 pm

Re: Suggested feature: Quota alarms

Post 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.
rfdude
------------------
1.09.2 Buffalo WZR-HP-G300NH2 -> 8 OpenMesh AP's
1.10.0 Archer C7 -> Multiple Cisco 1702i Autonomous Mode

Post Reply