Module: check_mk
Branch: master
Commit: 36cb67e8d33d257ab37d17ca21313a38515bfdc9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=36cb67e8d33d25…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Aug 13 17:52:44 2011 +0200
snmp_info, snmp_uptime: added scan functions
Please use ignored_checktypes or ignored_checks, if
not wantet. Wenn really need a scan function in order
for WATO to work.
---
.bugs/174 | 33 ++++++++++++++++++++++++++++-----
ChangeLog | 2 ++
checks/snmp_info | 4 ++--
checks/snmp_uptime | 4 ++--
4 files changed, 34 insertions(+), 9 deletions(-)
diff --git a/.bugs/174 b/.bugs/174
index 1d552aa..4cef006 100644
--- a/.bugs/174
+++ b/.bugs/174
@@ -1,9 +1,32 @@
-Title: Reinventory removes e.g. snmp_uptime check when not given via cmdline
+Title: Reinventory removes e.g. snmp_info check when not given via cmdline
Component: core
+State: done
+Class: bug
+Date: 2011-03-03 09:56:23
Benefit: 3
-State: open
Cost: 2
-Date: 2011-03-03 09:56:23
-Class: bug
+Fun: 0
+
+When a service has been added with --checks info -I <hostname> and one executes
+a re-inventory for all checks then snmp_info check is lost and needs to be re-added with
+--checks snmp_info -I or --checks snmp_info -II.
+
+What could be a solution? Possible are:
+
+- Do not remove checks without a a scan function on -II.
+ But how do we know that there is no scan function? Or just
+ remove checks with a positive result of the scan function?
+ Sound complicated to implement.
+ Maybe add an option -III which then removes all? Or depend
+ on --flush for removing all autochecks.
+
+ Problem is anyway: Check without a scan function do not
+ work well (at all) in WATO.
+
+- Make a scan function for snmp_info and friends and
+ propose ignored_checktypes in the Migration notes.
+
-When a service has been added with --checks snmp_uptime -I <hostname> and one
executes a re-inventory for all checks the snmp_uptime check is lost and needs to be
re-added with --checks snmp_uptime -I or --checks snmp_uptime -II.
+2011-08-13 17:49:57: changed state discuss -> done
+Added scan functions. Will add a note to the migration notes
+of how to disable the check.
diff --git a/ChangeLog b/ChangeLog
index 0e5acd1..317afe2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,6 +25,8 @@
* FIX: cisco_temp_perf: add critical level to performance data
* FIX: windows agent: hopefully fix case with quotes in directory name
* FIX: printer_supply: fixed logic of Perf-O-Meter (mixed up crit with ok)
+ * snmp_uptime, snmp_info: added scan functions. These checks will now
+ always be added. Please use ingored_checktypes to disable, if non needed.
* brocade_port: check for Brocade FC ports has been rewritten with
lots of new features.
* AIX agent now simulates <<<netctr>>> output (by Jörg Linge)
diff --git a/checks/snmp_info b/checks/snmp_info
index 635d241..a0b9f54 100644
--- a/checks/snmp_info
+++ b/checks/snmp_info
@@ -37,5 +37,5 @@ def check_snmp_info(checktype, params, info):
check_info['snmp_info'] = (check_snmp_info, "SNMP Info", 0,
inventory_snmp_info)
snmp_info['snmp_info'] = ( ".1.3.6.1.2.1.1", [ '1.0',
'4.0', '5.0', '6.0', ] )
-# Do not use this check per default
-snmp_scan_functions['snmp_info'] = lambda oid: False
+# This check works on all SNMP hosts
+snmp_scan_functions['snmp_info'] = lambda oid:
oid(".1.3.6.1.2.1.1.1.0") != None
diff --git a/checks/snmp_uptime b/checks/snmp_uptime
index 70e7aea..b0131ff 100644
--- a/checks/snmp_uptime
+++ b/checks/snmp_uptime
@@ -47,5 +47,5 @@ def check_snmp_uptime(checktype, params, info):
check_info['snmp_uptime'] = (check_snmp_uptime, "Uptime", 1,
inventory_snmp_uptime)
snmp_info['snmp_uptime'] = ( ".1.3.6.1.2.1.1", [ '3.0' ] ) #
DISMAN-EVENT-MIB::sysUpTime
-# Do not use this check per default
-snmp_scan_functions['snmp_uptime'] = lambda oid: False
+# This check works on all SNMP hosts
+snmp_scan_functions['snmp_uptime'] = lambda oid:
oid(".1.3.6.1.2.1.1.1.0") != None