Scheduled Changes to MIR?

Is there a way MIR could be adjusted on a time schedule? For example, could I increase the MIR on a profile for a specific time window.. or change the MIR profile for a period of time? I imagine the change would have to be scripted, or somehow pushed through a RADIUS server, but I'm looking for any input.

I'm considering offering "the next faster service" during low use hours. 

Thanks - Chris

We would like to do a similar thing.  Where we are located, bandwidth is expensive, so offering 2AM-7AM 'quota free' periods or 'turbo boost' periods to encourage the heaviest users to schedule their downloads to those off-peak times, that would be interesting to us also. :)

Hi all,
Today such functionality is not available on ePMP devices.
But it can be easily performed by scheduled script(python for example) in crontab.


Let me know if you need example of such script.


Thank you.


@Fedor wrote:

Let me know if you need example of such script.


Yes please! An example would be great.

Thank you, Chris

You can change this in a simple bash/shell script using snmpset, like

snmpset -v2c -cPrivate 10.11.12.13 .1.3.6.1.4.1.17713.21.3.8.2.30.0 i 7

snmpset -v2c -cPrivate 10.11.12.13 .1.3.6.1.4.1.17713.21.4.4.0 i 1

First one sets MIR profile 7, second applies changes. (.1.3.6.1.4.1.17713.21.3.8.2.30.0=wirelessMIRSTAProfileNumber.0)

I'd worry about tracking and consistency.  Unless all customers are on the same service plan, and all are getting toggled, then you'd need to track who was on what plan.  (e.g. you bump a 4mbps customer to 10mbps class during the wee hours, but a 10mbps customer to 20mbps during that time - without tracking, script might take a 10mbps customer who wasn't reachable during bump-up and subsequently cut them to 4mbps)  This would quickly increase the complexity of the script, obviously, so I'd tend to handle that outside the script.

That said, if you have a mysql database or something listing the IPs to change, and simply want to change them to 'x' at a given time, the two lines above are the gist of it.

Literally, you can set up a single line cron job like:

1 1 * * * for ip in $(mysql -sss radios -u smlist -e 'select ip from sm where MIR=1;');do snmpset -v2c -cPrivate $ip 1.3.6.1.4.1.17713.21.3.8.2.30.0 i 2;snmpset -v2c -cPrivate $ip.1.3.6.1.4.1.17713.21.4.4.0 i 1;done

 This assumes you have a mysql database named 'radios' with a table named 'sm', and a user 'smlist' allowed to query it without password, and SNMP writeable community string 'Private'.  It would run at 1:01am and find anyone whose provisioning was listed as MIR=1 and try to bump them to MIR=2 - do the same thing later (like "1 7 * * *" for 7:01am) to set them all back to MIR=1.

Everything inside the $(...) block can be changed to any command that will result in a simple text result with one IP address per line - so it could be "cat mir1SMs.txt" for example if you keep a simple text-file list of the IPs to change prepared.

j

2 Likes

Hi,

Here is the simplest example with verification of current MIR profile, without additional errors verifications.

Script has only one IP address, but it could be inserted in cycle from IP addresses list converted in tuple.

__author__ = 'fedortrutsko'


import pexpect
import paramiko
import re

ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('169.254.1.1', port=22, username='admin', password='admin')

stdin, stdout, stderr = ssh.exec_command('config show | systemConfigDeviceName')
devNameOut = stdout.read()
devName = str((re.sub(r"systemConfigDeviceName ",'', devNameOut)).strip() + ('>'))
print devName


stdin, stdout, stderr = ssh.exec_command('config show | wirelessMIRSTAProfileNumber')
currentMIRprofile = stdout.read()
print ('currentMIRprofile ' + currentMIRprofile)
MIRnum = int(str(re.sub(r"wirelessMIRSTAProfileNumber ",'', currentMIRprofile)).strip())

if MIRnum == 8:
child = pexpect.spawn("ssh admin@169.254.1.1")
child.logfile = open("/tmp/mylog", "w")
child.expect(".*assword:")
child.send("admin\r")
child.expect(devName)
child.sendline("show config\r")
child.expect(devName)
child.sendline("config set wirelessMIRSTAProfileNumber 3\r")
child.expect(devName)
child.sendline("config save\r")
child.expect(devName)
child.sendline("config apply\r")
child.expect(devName)
child.sendline("config show\r")
child.expect(devName)


stdin, stdout, stderr = ssh.exec_command('config show | wirelessMIRSTAProfileNumber')
newMIRprofile = stdout.read()
print ('newMIRprofile ' + newMIRprofile)
else:
print "Device does not need MIR profile changes" 
1 Like