Module: check_mk
Branch: master
Commit: c9992bdda6c8c832aa44752d99d746988427f1e8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c9992bdda6c8c8…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Thu Aug 10 17:36:19 2017 +0200
transformed checkplugin
The original plugin did not the job. The sync status can only be
checked at all but not for particular policies.
Change-Id: I2e2af0c893b61af62f9612d21d8c11cfec8ebf7b
---
checks/{stormshield_policy => stormshield_sync} | 32 ++++++++++++-------------
1 file changed, 15 insertions(+), 17 deletions(-)
diff --git a/checks/stormshield_policy b/checks/stormshield_sync
similarity index 67%
rename from checks/stormshield_policy
rename to checks/stormshield_sync
index 5422e0a..24ffcc0 100644
--- a/checks/stormshield_policy
+++ b/checks/stormshield_sync
@@ -28,30 +28,28 @@
# example output
-def inventory_stormshield_policy(info):
- for line in info:
- yield (line[0], None)
+def inventory_stormshield_sync(info):
+ return [ (None, None) ]
-def check_stormshield_policy(item, params, info):
+def check_stormshield_sync(_no_item, _no_params, info):
sync_status = {
- '1' : (0, "synced"),
- '2' : (2, "not synced"),
+ '1' : (0, "Synced"),
+ '0' : (2, "Not synced"),
+ '-1' : (3, "Unknown / error"),
}
- for line in info:
- if line[0] == item:
- state, state_readable = sync_status[line[1]]
- yield state, "Policy is %s" % state_readable
+ state, state_readable = sync_status[info[0][0]]
+ return state, "%s" % state_readable
-check_info['stormshield_policy'] = {
- 'inventory_function' : inventory_stormshield_policy,
- 'check_function' : check_stormshield_policy,
- 'service_description' : 'Policy %s status',
- 'snmp_info' : ('.1.3.6.1.4.1.11256.1.8.1.1', [
- '2', # STORMSHIELD-POLICY-MIB::snsPolicyName
- '5', # STORMSHIELD-POLICY-MIB::snsPolicySync
+
+check_info['stormshield_sync'] = {
+ 'inventory_function' : inventory_stormshield_sync,
+ 'check_function' : check_stormshield_sync,
+ 'service_description' : 'Sync status',
+ 'snmp_info' : ('.1.3.6.1.4.1.11256.1.11', [
+ '8', #
STORMSHIELD-POLICY-MIB::snsHASyncStatus
]),
'snmp_scan_function' : stormshield_scan_function,
'includes' : [ 'stormshield.include' ],