
Data Plan Throttling
Data Plan Throttling
Design
Design
This creates a rudimentary, but stable, data plan throttle that will disable any/all LAN traffic on a
device if it detects that it has gone over its monthly data usage limit. This is achieved by
leveraging the
data usage API
available on aView. The main benefit is the API tracks data usage
across reboots, so we can accurately measure the data usage over time.
This feature is implemented using a custom script. See example setup below. Note that the
user must specify their
API token
in the custom script. They can also adjust the data limit
(default is 100MB) and the rollover day for the data plan (default is the first day of the month).
If the data plan limit is reached for the month, this script will disable the LAN interface by
default (you can change script to disable passthrough mode instead). Similarly, when the
device is within/under its data plan limit for the month, this script will ensure the LAN (or
passthrough, if specified) interface is disabled.
Config Setup
Config Setup
Create a new custom script under
System -> Scheduled tasks -> custom scripts
System -> Scheduled tasks -> custom scripts
, and enter in the
following. The top three lines should be adjusted to put in the users API token from aView, the
desired data plan limit in bytes, and the rollover day of the month.
Keep in mind that each user in aView only gets 100 API requests every 15 minutes, so don't
adjust this interval down so low to the point that the user runs out of API queries (e.g. running
this script on 100 devices every 5 minutes equals 300 requests per 15-min, which is more than
the API limit).
usage_limit='100000000'
# 100MB
rollover_day='01'
# pick day of month 01-31 to choose when data plan resets
api_token='xxxxxxxxxx'
mac=$(runt get system.mac)
intf=$(runt dump network.modem | grep intf | tail -n 1 | cut -f2 -d'=')
network_to_enable_disable='network.interface.lan'
# set to modem.passthrough if device
in passthrough mode
network_enabled="$(config get $network_to_enable_disable.enable)"
bugout() {
accns_log w config "$@"
exit
}
var_is_number(){
[ "$1" ]
|| return 1
User Manual
Page 106
Page 106
6310-DX
Summary of Contents for 6310-DX
Page 1: ...6310 DX...
Page 5: ...Package Contents Package Contents 6310 DX Unit 6310 DX Unit User Manual Page 5 Page 5 6310 DX...
Page 7: ...Mounting Bracket Mounting Bracket User Manual Page 7 Page 7 6310 DX...
Page 24: ...User Manual Page 24 Page 24 6310 DX...
Page 34: ...User Manual Page 34 Page 34 6310 DX...
Page 41: ...IMEI SV 11 FSN J8513103240310 GCAP User Manual Page 41 Page 41 6310 DX...
Page 62: ...User Manual Page 62 Page 62 6310 DX...
Page 65: ...User Manual Page 65 Page 65 6310 DX...
Page 73: ...User Manual Page 73 Page 73 6310 DX...
Page 76: ...User Manual Page 76 Page 76 6310 DX...
Page 81: ...User Manual Page 81 Page 81 6310 DX...
Page 92: ...User Manual Page 92 Page 92 6310 DX...
Page 100: ...User Manual Page 100 Page 100 6310 DX...
Page 105: ...User Manual Page 105 Page 105 6310 DX...
Page 118: ...User Manual Page 118 Page 118 6310 DX...
Page 137: ...User Manual Page 137 Page 137 6310 DX...
Page 143: ...User Manual Page 143 Page 143 6310 DX...
Page 145: ...User Manual Page 145 Page 145 6310 DX...
Page 231: ...User Manual Page 231 Page 231 6310 DX...