mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Add handling of suspended devices to integrationUISP
This commit is contained in:
parent
5c2ab0fdd6
commit
10290397cd
@ -10,6 +10,10 @@ try:
|
|||||||
except:
|
except:
|
||||||
from ispConfig import uispSite, uispStrategy
|
from ispConfig import uispSite, uispStrategy
|
||||||
overwriteNetworkJSONalways = False
|
overwriteNetworkJSONalways = False
|
||||||
|
try:
|
||||||
|
from ispConfig import uispSuspendedStrategy
|
||||||
|
except:
|
||||||
|
uispSuspendedStrategy = "none"
|
||||||
|
|
||||||
def uispRequest(target):
|
def uispRequest(target):
|
||||||
# Sends an HTTP request to UISP and returns the
|
# Sends an HTTP request to UISP and returns the
|
||||||
@ -397,6 +401,18 @@ def buildFullGraph():
|
|||||||
if (site['qos']['downloadSpeed']) and (site['qos']['uploadSpeed']):
|
if (site['qos']['downloadSpeed']) and (site['qos']['uploadSpeed']):
|
||||||
download = int(round(site['qos']['downloadSpeed']/1000000))
|
download = int(round(site['qos']['downloadSpeed']/1000000))
|
||||||
upload = int(round(site['qos']['uploadSpeed']/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,
|
node = NetworkNode(id=id, displayName=name, type=nodeType,
|
||||||
parentId=parent, download=download, upload=upload, address=address, customerName=customerName)
|
parentId=parent, download=download, upload=upload, address=address, customerName=customerName)
|
||||||
|
@ -97,6 +97,11 @@ uispSite = ''
|
|||||||
# or site options.
|
# or site options.
|
||||||
# * "full" - build a complete network map
|
# * "full" - build a complete network map
|
||||||
uispStrategy = "full"
|
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
|
# List any sites that should not be included, with each site name surrounded by '' and separated by commas
|
||||||
excludeSites = []
|
excludeSites = []
|
||||||
# If you use IPv6, this can be used to find associated IPv6 prefixes for your clients' IPv4 addresses, and match them
|
# 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