mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2024-11-29 03:13:48 -06:00
Add handling of suspended devices to integrationUISP
This commit is contained in:
parent
5c2ab0fdd6
commit
10290397cd
@ -10,6 +10,10 @@ try:
|
||||
except:
|
||||
from ispConfig import uispSite, uispStrategy
|
||||
overwriteNetworkJSONalways = False
|
||||
try:
|
||||
from ispConfig import uispSuspendedStrategy
|
||||
except:
|
||||
uispSuspendedStrategy = "none"
|
||||
|
||||
def uispRequest(target):
|
||||
# Sends an HTTP request to UISP and returns the
|
||||
@ -397,6 +401,18 @@ def buildFullGraph():
|
||||
if (site['qos']['downloadSpeed']) and (site['qos']['uploadSpeed']):
|
||||
download = int(round(site['qos']['downloadSpeed']/1000000))
|
||||
upload = int(round(site['qos']['uploadSpeed']/1000000))
|
||||
if site['identification'] is not None and site['identification']['suspended'] is not None and site['identification']['suspended'] == True:
|
||||
if uispSuspendedStrategy == "ignore":
|
||||
print("WARNING: Site " + name + " is suspended")
|
||||
continue
|
||||
if uispSuspendedStrategy == "slow":
|
||||
print("WARNING: Site " + name + " is suspended")
|
||||
download = 1
|
||||
upload = 1
|
||||
|
||||
if site['identification']['status'] == "disconnected":
|
||||
print("WARNING: Site " + name + " is disconnected")
|
||||
continue
|
||||
|
||||
node = NetworkNode(id=id, displayName=name, type=nodeType,
|
||||
parentId=parent, download=download, upload=upload, address=address, customerName=customerName)
|
||||
|
@ -97,6 +97,11 @@ uispSite = ''
|
||||
# or site options.
|
||||
# * "full" - build a complete network map
|
||||
uispStrategy = "full"
|
||||
# Handling of UISP suspensions:
|
||||
# * "none" - do not handle suspensions
|
||||
# * "ignore" - do not add suspended customers to the network map
|
||||
# * "slow" - limit suspended customers to 1mbps
|
||||
uispSuspendedStrategy = "none"
|
||||
# List any sites that should not be included, with each site name surrounded by '' and separated by commas
|
||||
excludeSites = []
|
||||
# If you use IPv6, this can be used to find associated IPv6 prefixes for your clients' IPv4 addresses, and match them
|
||||
|
Loading…
Reference in New Issue
Block a user