Module: check_mk
Branch: master
Commit: 3d79c7b0728702f8d3b2d243118b74ac2d884e10
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3d79c7b0728702…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Thu Nov 6 15:46:36 2014 +0100
#1203 FIX veeam_client: Now supports multiple Backups for one host
Before the check only supported one backup per host, so no item was needed. Now the check
supports multiple Backups.
This means, now a item is in used. A reinventory is now necessary. Also you need to renew
you Wato rule (if one).
---
.werks/1203 | 11 ++++++++
ChangeLog | 2 ++
checks/veeam_client | 46 ++++++++++++++++++++++++++--------
web/plugins/wato/check_parameters.py | 4 +--
4 files changed, 51 insertions(+), 12 deletions(-)
diff --git a/.werks/1203 b/.werks/1203
new file mode 100644
index 0000000..0b49f6c
--- /dev/null
+++ b/.werks/1203
@@ -0,0 +1,11 @@
+Title: veeam_client: Now supports multiple Backups for one host
+Level: 1
+Component: checks
+Compatible: incomp
+Version: 1.2.5i7
+Date: 1415285052
+Class: fix
+
+Before the check only supported one backup per host, so no item was needed. Now the check
supports multiple Backups.
+This means, now a item is in used. A reinventory is now necessary. Also you need to renew
you Wato rule (if one).
+
diff --git a/ChangeLog b/ChangeLog
index 38274fb..7e7e81d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -23,6 +23,8 @@
* 1485 FIX: dell_om_disks, dell_om_esmlog, dell_om_mem, dell_om_processors,
dell_om_sensors: detect more devices...
* 1202 FIX: cisco_power, cisco_temp_perf: Both checks now using a new service
description...
NOTE: Please refer to the migration notes!
+ * 1203 FIX: veeam_client: Now supports multiple Backups for one host...
+ NOTE: Please refer to the migration notes!
Multisite:
* 1164 FIX: Fixed links from servicegroup overviews to single servicegroups
diff --git a/checks/veeam_client b/checks/veeam_client
index af6671d..92f3cdc 100644
--- a/checks/veeam_client
+++ b/checks/veeam_client
@@ -28,14 +28,38 @@ factory_settings["veeam_client"] = {
"age": ( 108000, 172800 ), # 30h/2d
}
-def inventory_veeam_client(info):
- if info[0][0] == "Status":
- return [ (None, {} ) ]
-
-def check_veeam_client(item, params, info):
- if not info[0][0] == "Status":
- return 3, "No status data found in first line of agent data"
- data = dict(info[:-1])
+def parse_veeam_client(info):
+ data = {}
+ for line in info:
+ if line[0] == "Status":
+ if len(line) == 2:
+ last_status = line[1]
+ else:
+ # Prevent empty entries
+ last_status = False
+ elif line[0] == 'JobName':
+ if last_status:
+ last_found = line[1]
+ data[last_found] = {}
+ data[last_found]['Status'] = last_status
+ else:
+ if last_status and len(line) == 2:
+ data[last_found][line[0]] = line[1]
+ return data
+
+
+def inventory_veeam_client(parsed):
+ for job in parsed.keys():
+ yield job, {}
+
+def check_veeam_client(item, params, parsed):
+ # Fallback for old None item version
+ #FIXME Can be remvoed in CMK 2.0
+ if item == None:
+ key = parsed.keys()[0]
+ data = parsed[key]
+ else:
+ data = parsed[item]
perfdata = []
infotexts = []
@@ -49,7 +73,8 @@ def check_veeam_client(item, params, info):
infotexts.append("Status: %s" % data['Status'] )
# Only output the Job name
- infotexts.append("Job: %s" % data['JobName'] )
+ if data.get('JobName'):
+ infotexts.append("Job: %s" % data['JobName'] )
@@ -122,7 +147,8 @@ check_info["veeam_client"] = {
'inventory_function': inventory_veeam_client,
'service_description': 'VEEAM Client',
'group': 'veeam_backup',
- "default_levels_variable" : "veeam_client",
+ 'parse_function': parse_veeam_client,
+ 'default_levels_variable' : 'veeam_client',
'has_perfdata': True,
}
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 020ee90..22551c8 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -3691,8 +3691,8 @@ register_check_parameters(
)
)]
),
- None,
- None
+ TextAscii(title=_("Jobname")),
+ "first"
)
register_check_parameters(