Module: check_mk
Branch: master
Commit: 89e9a1a7cdf484c003cc4b9299f62c2ae80294c6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=89e9a1a7cdf484…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Feb 21 12:07:01 2012 +0100
WATO: formalized yet further checks (200 still to go)
---
ChangeLog | 4 +-
checkman/fjdarye100_disks | 2 +-
checkman/fjdarye60_disks | 2 +-
checks/3ware_disks | 3 +-
checks/3ware_units | 3 +-
checks/fjdarye.include | 5 +--
checks/fjdarye100_disks | 1 +
checks/fjdarye60_disks | 1 +
checks/lsi | 5 +++-
checks/md | 5 ++-
checks/megaraid_pdisks | 1 +
checks/mounts | 1 +
web/plugins/wato/check_parameters.py | 42 ++++++++++++++++++++++++++++++++++
13 files changed, 63 insertions(+), 12 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index af32aea..d2be19b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,8 +11,8 @@
* FIX: fix problem with check includes in subchecks
WATO:
- * More checks are configurable via WATO now
- * Distributed WATO: Made all url calls using curl now
+ * Much more checks are configurable via WATO now
+ * Distributed WATO: Made all URL calls using curl now
* FIX: fix bug in inventory in validate_datatype()
* Better output in case of inventory error
* FIX: fix bug in host_icon rule on non OMD
diff --git a/checkman/fjdarye100_disks b/checkman/fjdarye100_disks
index 61f3a1f..7bb7d94 100644
--- a/checkman/fjdarye100_disks
+++ b/checkman/fjdarye100_disks
@@ -1,4 +1,4 @@
-title: Monitor status of disks in Fujitsu ETERNUS DX80 S2 storage systems
+title: Monitor status of disk in Fujitsu ETERNUS DX80 S2 storage systems
agents: SNMP
author: Philipp Hoefflin <hoefflin+cmk(a)fuh-e.de>
license: GPLv2
diff --git a/checkman/fjdarye60_disks b/checkman/fjdarye60_disks
index 211919e..0af70f0 100644
--- a/checkman/fjdarye60_disks
+++ b/checkman/fjdarye60_disks
@@ -1,4 +1,4 @@
-title: Monitor status of disks in Fujitsu ETERNUS DX storage systems
+title: Monitor status of disk in Fujitsu ETERNUS DX storage systems
agents: SNMP
author: Lars Michelsen <lm(a)mathias-kettner.de>
license: GPL
diff --git a/checks/3ware_disks b/checks/3ware_disks
index 89e2681..b9a4c41 100644
--- a/checks/3ware_disks
+++ b/checks/3ware_disks
@@ -61,7 +61,7 @@ def inventory_3ware_disks(info):
inventory.append( (disk, None) )
return inventory
-def check_3ware_disks(item, params, info):
+def check_3ware_disks(item, _no_params, info):
for line in info:
if line[0] == item:
status = line[1]
@@ -81,3 +81,4 @@ def check_3ware_disks(item, params, info):
# declare the check to Check_MK
check_info['3ware_disks'] = \
(check_3ware_disks, "RAID 3ware disk %s", 0, inventory_3ware_disks)
+checkgroup_of['3ware_disks'] = "raid_disk"
diff --git a/checks/3ware_units b/checks/3ware_units
index 00859a5..8284343 100644
--- a/checks/3ware_units
+++ b/checks/3ware_units
@@ -47,7 +47,7 @@ def inventory_3ware_units(info):
return inventory
# check
-def check_3ware_units(item, param, info):
+def check_3ware_units(item, _no_params, info):
for line in info:
if line[0] == item:
unit_type = line[1]
@@ -77,3 +77,4 @@ def check_3ware_units(item, param, info):
# declare the check to Check_MK
check_info['3ware_units'] = \
(check_3ware_units, "RAID 3ware unit %s", 0, inventory_3ware_units)
+checkgroup_of['3ware_units'] = "raid"
diff --git a/checks/fjdarye.include b/checks/fjdarye.include
index 6eed9b7..877de9d 100644
--- a/checks/fjdarye.include
+++ b/checks/fjdarye.include
@@ -78,7 +78,7 @@ def fjdarye_disks_summary(info):
def inventory_fjdarye_disks_summary(info):
current_state = fjdarye_disks_summary(info)
if len(current_state) > 0:
- return [ (None, '', current_state) ]
+ return [ (None, current_state) ]
def fjdarye_disks_printstates(state):
return ", ".join(["%s: %s" % (s,c) for (s,c) in state.items()])
@@ -101,7 +101,7 @@ def check_fjdarye_disks_summary(index, expected_status, info):
# --------------------------------------------------------------------------------
# 2. Single disk version of check -> one check for each disk
def inventory_fjdarye_disks(info):
- return [ (int(index), '', repr(fjdarye_disks_status[int(status)])) for index,
status in info if int(status) != 3 ]
+ return [ (int(index), repr(fjdarye_disks_status[int(status)])) for index, status in
info if int(status) != 3 ]
def check_fjdarye_disks(index, expected_status, info):
for line in info:
@@ -115,4 +115,3 @@ def check_fjdarye_disks(index, expected_status, info):
return (3, "UNKNOWN - No status for disk number %d present" % index)
-# vim: tabstop=4 shiftwidth=4 expandtab
diff --git a/checks/fjdarye100_disks b/checks/fjdarye100_disks
index 65b1092..f50cd20 100644
--- a/checks/fjdarye100_disks
+++ b/checks/fjdarye100_disks
@@ -74,6 +74,7 @@ snmp_scan_functions['fjdarye100_disks.summary'] \
check_info['fjdarye100_disks'] = (check_fjdarye_disks, "Disk %s", 0,
inventory_fjdarye_disks)
check_includes['fjdarye100_disks'] = ["fjdarye.include"]
+checkgroup_of['fjdarye100_disks'] = "raid_disk"
# 1: fjdaryDiskIndex, 3: fjdaryDiskStatus
snmp_info['fjdarye100_disks'] =
(".1.3.6.1.4.1.211.1.21.1.100.2.19.2.1", [ 1, 3 ])
diff --git a/checks/fjdarye60_disks b/checks/fjdarye60_disks
index 57d7a89..9a61bff 100644
--- a/checks/fjdarye60_disks
+++ b/checks/fjdarye60_disks
@@ -38,6 +38,7 @@ snmp_scan_functions['fjdarye60_disks.summary'] \
check_info['fjdarye60_disks'] = (check_fjdarye_disks, "Disk %s", 0,
inventory_fjdarye_disks)
check_includes['fjdarye60_disks'] = ["fjdarye.include"]
snmp_info['fjdarye60_disks'] = (".1.3.6.1.4.1.211.1.21.1.60.2.12.2.1",
[ 1, 3 ])
+checkgroup_of['fjdarye60_disks'] = "raid_disk"
snmp_scan_functions['fjdarye60_disks'] \
= lambda oid: oid(".1.3.6.1.2.1.1.2.0") ==
".1.3.6.1.4.1.211.1.21.1.60"
diff --git a/checks/lsi b/checks/lsi
index bf2c2b7..f9966ba 100644
--- a/checks/lsi
+++ b/checks/lsi
@@ -46,7 +46,7 @@ def inventory_lsi(check_type, info):
else:
return [(id, '"%s"' % state) for (id, state) in disks]
-def check_lsi_array(item, params, info):
+def check_lsi_array(item, _no_params, info):
volumeid = -1
for line in info:
if line[0] == 'VolumeID':
@@ -75,4 +75,7 @@ def check_lsi_disk(item, target_state, info):
check_info['lsi.array'] = (check_lsi_array, "RAID array %s", 0, lambda
info: inventory_lsi('lsi.array', info))
+checkgroup_of['lsi.array'] = "raid"
+
check_info['lsi.disk'] = (check_lsi_disk, "RAID disk %s", 0, lambda
info: inventory_lsi('lsi.disk', info))
+checkgroup_of['lsi.disk'] = "raid_disk"
diff --git a/checks/md b/checks/md
index ce769fe..b211fcf 100644
--- a/checks/md
+++ b/checks/md
@@ -74,10 +74,10 @@ def inventory_md(info):
elif line[1] == 'blocks':
if line[-1] != "chunks": # ignore RAID 0 devices
disk_state = line[-1][1:-1]
- inventory.append( (device, '%s / %s' % (raid_state, disk_state),
None) )
+ inventory.append( (device, None) )
return inventory
-def check_md(item, params, info):
+def check_md(item, _no_params, info):
raid_state = ''
its_next = False
for line in info:
@@ -104,3 +104,4 @@ def check_md(item, params, info):
check_info['md'] = (check_md, "MD Softraid %s", 0, inventory_md)
+checkgroup_of['md'] = "raid"
diff --git a/checks/megaraid_pdisks b/checks/megaraid_pdisks
index 91ecd77..0cdf8c7 100644
--- a/checks/megaraid_pdisks
+++ b/checks/megaraid_pdisks
@@ -98,3 +98,4 @@ def check_megaraid_pdisks(item, target_state, info):
return (3, "UNKNOWN - No disk in encl/slot %s found" % item)
check_info['megaraid_pdisks'] = (check_megaraid_pdisks, "RAID PDisk
Adapt/Enc/Sl %s", 1, inventory_megaraid_pdisks)
+checkgroup_of['megaraid_pdisks'] = "raid_disk"
diff --git a/checks/mounts b/checks/mounts
index 54a7f4f..521023b 100644
--- a/checks/mounts
+++ b/checks/mounts
@@ -70,3 +70,4 @@ def check_mounts(item, targetopts, info):
check_info['mounts'] = ( check_mounts, "Mount options of %s", 0,
inventory_mounts)
+checkgroup_of['mounts'] = "fs_mount_options"
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 64085c7..d7c6337 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -242,6 +242,22 @@ checkgroups.append((
))
checkgroups.append((
+ "fs_mount_options",
+ _("Filesystem mount options (Linux/UNIX)"),
+ ListOfStrings(
+ title = _("Expected mount options"),
+ help = _("Specify all expected mount options here. If the list of "
+ "actually found options differs from this list, the check will go "
+ "warning or critical. Just the option <tt>commit</tt> is being
"
+ "ignored since it is modified by the power saving algorithms.")),
+ TextAscii(
+ title = _("Mount point"),
+ allow_empty = False),
+ "first"))
+
+
+
+checkgroups.append((
"systemtime",
_("System time offset"),
Tuple(
@@ -882,6 +898,32 @@ checkgroups.append((
"first"))
checkgroups.append((
+ "raid",
+ _("RAID: overal state"),
+ None,
+ TextAscii(
+ title = _("Name of the device"),
+ help = _("For Linux MD specify the device name without the "
+ "<tt>/dev/</tt>, e.g. <tt>md0</tt>, for
hardware raids "
+ "please refer to the manual of the actual check being
used.")),
+ "first"))
+
+checkgroups.append((
+ "raid_disk",
+ _("RAID: state of a single disk"),
+ TextAscii(
+ title = _("Target state"),
+ help = _("State the disk is expected to be in. Typical good states "
+ "are online, host spare, OK and the like. The exact way of how "
+ "to specify a state depends on the check and hard type being used.
"
+ "Please take examples from inventorized checks for reference.")),
+ TextAscii(
+ title = _("Number or ID of the disk"),
+ help = _("How the disks are named depends on the type of hardware being
"
+ "used. Please look at already inventorized checks for
examples.")),
+ "first"))
+
+checkgroups.append((
"room_temperature",
_("Room temperature (e.g. external thermal sensors in datacenters)"),
Tuple(