Module: check_mk
Branch: master
Commit: 830f1db66721bd1f29fa9b23aec528c468f406ee
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=830f1db66721bd…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Fri Aug 11 14:00:02 2017 +0200
Revert "transformed checkplugin"
This reverts commit c9992bdda6c8c832aa44752d99d746988427f1e8.
It broke the integration tests:
https://ci.mathias-kettner.de/job/cmk_master/job/integrationstests/2867/
---
checks/{stormshield_sync => stormshield_policy} | 32 +++++++++++++------------
1 file changed, 17 insertions(+), 15 deletions(-)
diff --git a/checks/stormshield_sync b/checks/stormshield_policy
similarity index 67%
rename from checks/stormshield_sync
rename to checks/stormshield_policy
index 24ffcc0..5422e0a 100644
--- a/checks/stormshield_sync
+++ b/checks/stormshield_policy
@@ -28,28 +28,30 @@
# example output
-def inventory_stormshield_sync(info):
- return [ (None, None) ]
+def inventory_stormshield_policy(info):
+ for line in info:
+ yield (line[0], None)
-def check_stormshield_sync(_no_item, _no_params, info):
+def check_stormshield_policy(item, params, info):
sync_status = {
- '1' : (0, "Synced"),
- '0' : (2, "Not synced"),
- '-1' : (3, "Unknown / error"),
+ '1' : (0, "synced"),
+ '2' : (2, "not synced"),
}
- state, state_readable = sync_status[info[0][0]]
- return state, "%s" % state_readable
+ for line in info:
+ if line[0] == item:
+ state, state_readable = sync_status[line[1]]
+ yield state, "Policy is %s" % state_readable
-
-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
+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
]),
'snmp_scan_function' : stormshield_scan_function,
'includes' : [ 'stormshield.include' ],