Skip to content

Commit d67358a

Browse files
Merge pull request #1 from doctore74/patch-1
Update unifi_controller.py
2 parents 6813a7c + c6f9b80 commit d67358a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/check_mk/base/plugins/agent_based/unifi_controller.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ def inventory_unifi_device_shortlist(section):
270270
def discovery_unifi_device(section):
271271
yield Service(item="Device Status")
272272
yield Service(item="Unifi Device")
273+
yield Service(item="Unifi Device Uptime")
273274
yield Service(item="Active-User")
274275
if section.type != "uap": # kein satisfaction bei ap .. radio/ssid haben schon
275276
yield Service(item="Satisfaction")
@@ -315,7 +316,14 @@ def check_unifi_device(item,section):
315316
)
316317
yield Metric("user_sta",_active_user)
317318
yield Metric("guest_sta",_safe_int(section.guest_num_sta))
318-
319+
if item == "Unifi Device Uptime":
320+
_uptime = int(section.uptime) if section.uptime else -1
321+
if _uptime > 0:
322+
yield Result(
323+
state=State.OK,
324+
summary=render.timespan(_uptime)
325+
)
326+
yield Metric("unifi_uptime",_uptime)
319327
if item == "Satisfaction":
320328
yield Result(
321329
state=State.OK,

0 commit comments

Comments
 (0)