mirror of
https://github.com/bashclub/check-unifi-controller.git
synced 2024-11-07 20:31:58 +01:00
sometimes an SSID gets removed.
This commit is contained in:
parent
f3646613fd
commit
47d2713f87
@ -115,6 +115,7 @@ def check_unifi_controller(item,section):
|
|||||||
state=State.WARN,
|
state=State.WARN,
|
||||||
notice=_("Update available")
|
notice=_("Update available")
|
||||||
)
|
)
|
||||||
|
yield Metric("uptime",int(section.uptime))
|
||||||
if item == "Cloudkey":
|
if item == "Cloudkey":
|
||||||
yield Result(
|
yield Result(
|
||||||
state=State.OK,
|
state=State.OK,
|
||||||
@ -270,7 +271,7 @@ register.inventory_plugin(
|
|||||||
def discovery_unifi_device(section):
|
def discovery_unifi_device(section):
|
||||||
yield Service(item="Device Status")
|
yield Service(item="Device Status")
|
||||||
yield Service(item="Unifi Device")
|
yield Service(item="Unifi Device")
|
||||||
yield Service(item="Unifi Device Uptime")
|
yield Service(item="Uptime")
|
||||||
yield Service(item="Active-User")
|
yield Service(item="Active-User")
|
||||||
if section.type != "uap": # kein satisfaction bei ap .. radio/ssid haben schon
|
if section.type != "uap": # kein satisfaction bei ap .. radio/ssid haben schon
|
||||||
yield Service(item="Satisfaction")
|
yield Service(item="Satisfaction")
|
||||||
@ -316,7 +317,7 @@ def check_unifi_device(item,section):
|
|||||||
)
|
)
|
||||||
yield Metric("user_sta",_active_user)
|
yield Metric("user_sta",_active_user)
|
||||||
yield Metric("guest_sta",_safe_int(section.guest_num_sta))
|
yield Metric("guest_sta",_safe_int(section.guest_num_sta))
|
||||||
if item == "Unifi Device Uptime":
|
if item == "Uptime":
|
||||||
_uptime = int(section.uptime) if section.uptime else -1
|
_uptime = int(section.uptime) if section.uptime else -1
|
||||||
if _uptime > 0:
|
if _uptime > 0:
|
||||||
yield Result(
|
yield Result(
|
||||||
@ -673,6 +674,7 @@ def discovery_unifi_ssids(section):
|
|||||||
|
|
||||||
def check_unifi_ssids(item,section):
|
def check_unifi_ssids(item,section):
|
||||||
ssid = section.get(item)
|
ssid = section.get(item)
|
||||||
|
if ssid:
|
||||||
_channels = ",".join(list(filter(lambda x: _safe_int(x) > 0,[ssid.ng_channel,ssid.na_channel])))
|
_channels = ",".join(list(filter(lambda x: _safe_int(x) > 0,[ssid.ng_channel,ssid.na_channel])))
|
||||||
yield Result(
|
yield Result(
|
||||||
state=State.OK,
|
state=State.OK,
|
||||||
@ -732,6 +734,7 @@ def discovery_unifi_ssidlist(section):
|
|||||||
|
|
||||||
def check_unifi_ssidlist(item,section):
|
def check_unifi_ssidlist(item,section):
|
||||||
ssid = section.get(item)
|
ssid = section.get(item)
|
||||||
|
if ssid:
|
||||||
yield Result(
|
yield Result(
|
||||||
state=State.OK,
|
state=State.OK,
|
||||||
summary=f"Channels: {ssid.channels}"
|
summary=f"Channels: {ssid.channels}"
|
||||||
|
Loading…
Reference in New Issue
Block a user