Module: check_mk
Branch: master
Commit: 5a6bfe42238ae9d55ef9898569d1f479f5b60c81
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5a6bfe42238ae9…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Feb 27 11:26:29 2011 +0100
Fix df_netapp32, add scan functions for netapp/32
---
ChangeLog | 2 ++
checks/df_netapp | 3 +++
checks/df_netapp.include | 4 ++++
checks/df_netapp32 | 14 ++++----------
4 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f39c5cc..b75e0be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,8 @@
* FIX: drbd now handles output of older version without an ep field
* systemtime: new simple check for time synchronization on Windows
(needs agent update)
+ * FIX: repaired df_netapp32
+ * Added SNMP scan function of df_netapp and df_netapp32
1.1.9i9:
diff --git a/checks/df_netapp b/checks/df_netapp
index c32e3b0..c9ce35b 100644
--- a/checks/df_netapp
+++ b/checks/df_netapp
@@ -28,3 +28,6 @@ check_includes['df_netapp'] = [ "df.include",
"df_netapp.include" ]
check_info['df_netapp'] = (check_df_netapp, "fs_%s", 1,
inventory_df_netapp)
snmp_info['df_netapp'] = ("1.3.6.1.4.1.789.1.5.4.1", [ 2, 29, 30 ] )
+
+snmp_scan_functions['df_netapp'] = \
+ lambda oid: is_netapp_filer(oid) and
oid("1.3.6.1.4.1.789.1.5.4.1.29.1")
diff --git a/checks/df_netapp.include b/checks/df_netapp.include
index 64430f1..00925a2 100644
--- a/checks/df_netapp.include
+++ b/checks/df_netapp.include
@@ -44,3 +44,7 @@ def check_df_netapp(volume, params, info):
avail_mb = size_mb - used_mb
return df_check_filesystem(g_hostname, volume, size_mb, avail_mb, params)
+
+def is_netapp_filer(oid):
+ return "ontap" in oid("1.3.6.1.2.1.1.1.0").lower() or \
+ oid("1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.789")
diff --git a/checks/df_netapp32 b/checks/df_netapp32
index 451ef2e..633f7cf 100644
--- a/checks/df_netapp32
+++ b/checks/df_netapp32
@@ -26,14 +26,8 @@
check_includes['df_netapp32'] = [ "df.include",
"df_netapp.include" ]
-# These dummy functions prevent 'name 'inventory_df_netapp' is not
defined'
-# errors on loading this file before loading the check_includes
-def check_df_netapp_local(*args):
- check_df_netapp(*args)
-
-def inventory_df_netapp_local(*args):
- inventory_df_netapp(*args)
-
-
-check_info['df_netapp32'] = (check_df_netapp_local, "fs_%s", 1,
inventory_df_netapp_local)
+check_info['df_netapp32'] = (check_df_netapp, "fs_%s", 1,
inventory_df_netapp)
snmp_info['df_netapp32'] = ("1.3.6.1.4.1.789.1.5.4.1", [ 2, 3, 4 ] )
+
+snmp_scan_functions['df_netapp32'] = \
+ lambda oid: is_netapp_filer(oid) and not
oid("1.3.6.1.4.1.789.1.5.4.1.29.1")