Module: check_mk
Branch: master
Commit: 6defc74cf0cdf2feb3e1567e1f9d8d971dadf68a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6defc74cf0cdf2…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Dec 9 09:57:50 2010 +0100
3ware_disks: Ignoring devices in state NOT-PRESENT during inventory
---
ChangeLog | 1 +
checkman/3ware_disks | 4 ++--
checks/3ware_disks | 14 ++++++++++++++
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d029396..a5f4654 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -119,6 +119,7 @@
* aironet_clients: Only counting clients which don't have empty values for
strength
* statgrab_disk: Fixed byte calculation in plugin output
* statgrab_disk: Added inventory function
+ * 3ware_disks: Ignoring devices in state NOT-PRESENT during inventory
Multisite:
* The custom open/close states of custom links are now stored for each
diff --git a/checkman/3ware_disks b/checkman/3ware_disks
index c13db27..d5468c3 100644
--- a/checkman/3ware_disks
+++ b/checkman/3ware_disks
@@ -13,5 +13,5 @@ item:
A string containing the unit number of the disk, e.g. {"p0"}.
inventory:
- All logical units are automatically inventorized. All states other than
- {OK} are considered critical.
+ All logical units which don't have the status NOT-PRESENT are automatically
inventorized. All states other than
+ {OK} are considered critical.
diff --git a/checks/3ware_disks b/checks/3ware_disks
index 7fe64d6..2b8761b 100644
--- a/checks/3ware_disks
+++ b/checks/3ware_disks
@@ -38,11 +38,25 @@
# p4 OK u0 298.09 GB 625142448 WD-WCAPD4160960
# p5 OK u0 298.09 GB 625142448 WD-WCAPD4164594
+# Some more data
+# Port Status Unit Size Blocks Serial
+# ---------------------------------------------------------------
+# p0 OK u0 233.81 GB 490350672 WD-WCAT1E297748
+# p1 OK u0 233.81 GB 490350672 WD-WCAT1E314892
+# p2 OK u2 233.81 GB 490350672 WD-WCAT1E313303
+# p3 OK u1 931.51 GB 1953525168 9QJ56A1M
+# p4 OK u1 931.51 GB 1953525168 9QJ2WPCR
+# p5 OK u1 931.51 GB 1953525168 9QJ2DG9C
+# p6 NOT-PRESENT - - - -
+# p7 NOT-PRESENT - - - -
+
def inventory_3ware_disks(checkname, info):
inventory = []
for line in info:
if len(line) > 0:
+ if line[1] == 'NOT-PRESENT':
+ continue
disk = line[0]
inventory.append( (disk, None) )
return inventory