Merge pull request #1 from doctore74/patch-1

Update unifi_controller.py
This commit is contained in:
Thorsten Spille 2023-02-18 21:04:37 +01:00 committed by GitHub
commit d67358acef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -270,6 +270,7 @@ register.inventory_plugin(
def discovery_unifi_device(section):
yield Service(item="Device Status")
yield Service(item="Unifi Device")
yield Service(item="Unifi Device Uptime")
yield Service(item="Active-User")
if section.type != "uap": # kein satisfaction bei ap .. radio/ssid haben schon
yield Service(item="Satisfaction")
@ -315,7 +316,14 @@ def check_unifi_device(item,section):
)
yield Metric("user_sta",_active_user)
yield Metric("guest_sta",_safe_int(section.guest_num_sta))
if item == "Unifi Device Uptime":
_uptime = int(section.uptime) if section.uptime else -1
if _uptime > 0:
yield Result(
state=State.OK,
summary=render.timespan(_uptime)
)
yield Metric("unifi_uptime",_uptime)
if item == "Satisfaction":
yield Result(
state=State.OK,