Add files via upload

This commit is contained in:
rchac
2020-10-04 13:29:16 -06:00
committed by GitHub
parent c3a50375fa
commit 3482f5df02
2 changed files with 15 additions and 4 deletions

View File

@@ -192,6 +192,12 @@ def refreshShapers():
startPointForHash = '12' #Position of src-address in IP header startPointForHash = '12' #Position of src-address in IP header
shell('tc filter add dev ' + interfaceB + ' parent ' + str(parentIDFirstPart) + ': prio 5 u32 ht 800:: match ip ' + srcOrDst + ' '+ thisSlash16Dec1 + '.' + thisSlash16Dec2 + '.0.0/16 hashkey mask 0x000000ff at ' + startPointForHash + ' link ' + str(hashIDCounter) + ':') shell('tc filter add dev ' + interfaceB + ' parent ' + str(parentIDFirstPart) + ': prio 5 u32 ht 800:: match ip ' + srcOrDst + ' '+ thisSlash16Dec1 + '.' + thisSlash16Dec2 + '.0.0/16 hashkey mask 0x000000ff at ' + startPointForHash + ' link ' + str(hashIDCounter) + ':')
hashIDCounter += 1 hashIDCounter += 1
#Recap
for customer in clientsList:
ipAddr, downloadSpeed, uploadSpeed = customer
downloadSpeed = str(downloadSpeed)
uploadSpeed = str(uploadSpeed)
print("Applied rate limiting |\t" + ipAddr + "\t| " + downloadSpeed + " down " + uploadSpeed + " up")
#Done #Done
today = date.today() today = date.today()
d1 = today.strftime("%d/%m/%Y") d1 = today.strftime("%d/%m/%Y")

View File

@@ -22,11 +22,13 @@
# v.0.4-alpha # v.0.4-alpha
# #
import requests import requests
from ispConfig import orgUNMSxAuthToken, unmsBaseURL from ispConfig import orgUNMSxAuthToken, unmsBaseURL, deviceModelBlacklistEnabled
#To omit bridged CPEs from shaping #To omit bridged CPEs from shaping
#deviceModelBlacklist = ['LBE-5AC-Gen2', 'LBE-5AC-Gen2', 'LBE-5AC-LR', 'AF-LTU5', 'AFLTULR', 'AFLTUPro', 'LTU-LITE'] if deviceModelBlacklistEnabled:
deviceModelBlacklist = [] deviceModelBlacklist = ['LBE-5AC-Gen2', 'LBE-5AC-Gen2', 'LBE-5AC-LR', 'AF-LTU5', 'AFLTULR', 'AFLTUPro', 'LTU-LITE']
else:
deviceModelBlacklist = []
def pullUNMSCustomers(): def pullUNMSCustomers():
url = unmsBaseURL + "/nms/api/v2.1/sites?type=client&ucrm=true&ucrmDetails=true" url = unmsBaseURL + "/nms/api/v2.1/sites?type=client&ucrm=true&ucrmDetails=true"
@@ -67,9 +69,11 @@ def getUNMSclientSiteDevices(siteID):
deviceMAC = device['identification']['mac'] deviceMAC = device['identification']['mac']
deviceIP = device['ipAddress'] deviceIP = device['ipAddress']
deviceModel = device['identification']['model'] deviceModel = device['identification']['model']
if not deviceModel:
deviceModel = device['identification']['modelName']
if deviceModel not in deviceModelBlacklist: if deviceModel not in deviceModelBlacklist:
deviceIPs.append(deviceIP) deviceIPs.append(deviceIP)
print("Added " + deviceModel + " device " + deviceName) print("Added " + deviceModel + ":\t" + deviceName)
return deviceIPs return deviceIPs
@@ -89,3 +93,4 @@ def getUNMSclientSiteDevices(siteID):