Module: check_mk
Branch: master
Commit: a247555c3737dd1c8cdf200132ab3c00e2aedc96
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a247555c3737dd…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Thu Sep 4 15:15:41 2014 +0200
hivemanager_devices: Added uptime as perfdata
---
checkman/hivemanager_devices | 2 +-
checks/hivemanager_devices | 9 +++++----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/checkman/hivemanager_devices b/checkman/hivemanager_devices
index 8affa8f..59ccd73 100644
--- a/checkman/hivemanager_devices
+++ b/checkman/hivemanager_devices
@@ -14,7 +14,7 @@ item:
The name of the Devices
perfdata:
- One variable: the current number of clients
+ Two variables: the current number of clients and the uptime in sec
inventory:
One check for each device will be created
diff --git a/checks/hivemanager_devices b/checks/hivemanager_devices
index 88df1a5..7c3edf7 100644
--- a/checks/hivemanager_devices
+++ b/checks/hivemanager_devices
@@ -34,7 +34,7 @@
factory_settings['hivemanger_devices'] = {
'alert_on_loss' : True,
- 'max_clients' : ( 25, 50 ),
+ 'max_clients' : (25, 50),
}
def inventory_hivemanager_devices(info):
@@ -48,7 +48,7 @@ def check_hivemanager_devices(item, params, info):
# Check for Alarm State
alarmstate = "Alarm state: " + alarm
- if alarm in [ 'Maybe', 'Major', 'Minor' ]:
+ if alarm in ['Maybe', 'Major', 'Minor']:
yield 1, alarmstate
elif alarm == 'Critical':
yield 2, alarmstate
@@ -62,7 +62,7 @@ def check_hivemanager_devices(item, params, info):
number_of_clients = int(clients)
warn, crit = params['max_clients']
- perfdata = [ ( 'client_count', number_of_clients, warn, crit )]
+ perfdata = [('client_count', number_of_clients, warn, crit)]
infotext = "Clients: %s" % number_of_clients
levels = ' Warn/Crit at %s/%s' % ( warn, crit )
@@ -84,13 +84,14 @@ def check_hivemanager_devices(item, params, info):
infotext = "Uptime: %s" % get_age_human_readable(uptime_secs)
state = 0
+ warn, crit = 0 , 0
if 'max_uptime' in params:
warn, crit = params['max_uptime']
if uptime_secs >= crit:
state = 2
elif uptime_secs >= warn:
state = 1
- yield state, infotext
+ yield state, infotext, [('uptime', uptime_secs, warn, crit)]