Module: check_mk
Branch: master
Commit: 20b3c8d3d933a926eb2add71745a6145f51e131e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=20b3c8d3d933a9…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Apr 12 14:40:27 2011 +0200
FIX: hp_procurve_memory: fix syntax error in man page
---
ChangeLog | 1 +
checkman/hp_procurve_mem | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9eafd03..35e91de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -45,6 +45,7 @@
* FIX: decru_*: added snmp scan functions
* FIX: heartbeat_rscstatus handles empty agent output correctly
* FIX: hp_procurve_cpu: fix synatx error in man page
+ * FIX: hp_procurve_memory: fix syntax error in man page
* printer_supply: Changed order of tests. When a printer reports -3 this
is used before the check if maxlevel is -2.
* printer_supply: Skipping inventory of supplies which have current value
diff --git a/checkman/hp_procurve_mem b/checkman/hp_procurve_mem
index 791bc6f..435ff0b 100644
--- a/checkman/hp_procurve_mem
+++ b/checkman/hp_procurve_mem
@@ -25,5 +25,5 @@ critical (int): Memory usage percentage at which a critical level is triggered.
[configuration]
hp_procurve_mem_default_levels (int, int): Default levels used by inventorized checks.
-This variable is preset to {(80, 90)}.
+ This variable is preset to {(80, 90)}.
Module: check_mk
Branch: master
Commit: 0d9f21a8a1b25fa1b2da2a20a1ee48ae29eeca63
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0d9f21a8a1b25f…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Apr 12 14:15:44 2011 +0200
FIX: fix problems due to new FIX of endoids
---
modules/snmp.py | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/modules/snmp.py b/modules/snmp.py
index b7a25c3..6c592be 100644
--- a/modules/snmp.py
+++ b/modules/snmp.py
@@ -224,7 +224,8 @@ def get_snmp_table(hostname, ip, oid_info):
if index_column != -1:
index_rows = []
# Take end-oids of non-index columns as indices
- for o, value in columns[max_len_col][1]:
+ fetchoid, max_column = columns[max_len_col]
+ for o, value in max_column:
if index_format == OID_END:
eo = extract_end_oid(columns[max_len_col][0], o)
index_rows.append((o, eo))
@@ -232,16 +233,16 @@ def get_snmp_table(hostname, ip, oid_info):
index_rows.append((o, o))
else:
index_rows.append((o, oid_to_bin(o)))
- columns[index_column] = index_rows
+ columns[index_column] = fetchoid, index_rows
# prepend suboid to first column
if suboid and len(columns) > 0:
- first_column = columns[0]
+ fetchoid, first_column = columns[0]
new_first_column = []
for o, val in first_column:
new_first_column.append((o, str(suboid) + "." + str(val)))
- columns[0] = new_first_column
+ columns[0] = fetchoid, new_first_column
# Swap X and Y axis of table (we want one list of columns per item)
# Here we have to deal with a nasty problem: Some brain-dead devices
Module: check_mk
Branch: master
Commit: 9d59bfdbdcd62d61d6de189933d27c9a98922e85
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9d59bfdbdcd62d…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Apr 12 14:07:15 2011 +0200
FIX: snmp: fix detection of missing OIDs
END-OIDs are now not any longer assumed to consist of one
component but we take the complete part after the scan prefix
as END OIDs. This avoids the creation of completely empty lines
like ['', ''] when in the MIB the indices of entries consist
of more than one component (like in apc_symmetra_temp).
We are not yet sure if this patch has a negative influence
in other not-yet tested situations...
---
ChangeLog | 1 +
modules/snmp.py | 48 +++++++++++++++++++++++++++++-------------------
2 files changed, 30 insertions(+), 19 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index da59213..875bd0b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
1.1.11i1:
Core, Setup, etc.:
* FIX: fix computation of weight when averaging
+ * FIX: fix detection of missing OIDs (led to empty lines)
* SNMP scan functions can now call oid(".1.3.6.1.4.1.9.9.13.1.3.1.3.*")
That will return the *first* OID beginning with .1.3.6.1.4.1.9.9.13.1.3.1.3
* New config option: Set check_submission = "file" in order to write
diff --git a/modules/snmp.py b/modules/snmp.py
index 227f9f7..b7a25c3 100644
--- a/modules/snmp.py
+++ b/modules/snmp.py
@@ -156,6 +156,15 @@ def snmpwalk_on_suboid(hostname, ip, oid):
raise MKSNMPError("SNMP Error on %s" % ip)
return rowinfo
+def extract_end_oid(prefix, complete):
+ return complete[len(prefix):].lstrip('.')
+
+# sort OID strings numerically
+def cmp_oids(o1, o2):
+ i1 = map(int, o1.split('.'))
+ i2 = map(int, o2.split('.'))
+ return cmp(i1, i2)
+
def get_snmp_table(hostname, ip, oid_info):
# oid_info is either ( oid, columns ) or
# ( oid, suboids, columns )
@@ -206,19 +215,19 @@ def get_snmp_table(hostname, ip, oid_info):
else:
rowinfo = snmpwalk_on_suboid(hostname, ip, fetchoid)
- if len(rowinfo) > 0 or True:
- columns.append(rowinfo)
- number_rows = len(rowinfo)
- if len(rowinfo) > max_len:
- max_len = len(rowinfo)
- max_len_col = colno
+ columns.append((fetchoid, rowinfo))
+ number_rows = len(rowinfo)
+ if len(rowinfo) > max_len:
+ max_len = len(rowinfo)
+ max_len_col = colno
if index_column != -1:
index_rows = []
# Take end-oids of non-index columns as indices
- for o, value in columns[max_len_col]:
+ for o, value in columns[max_len_col][1]:
if index_format == OID_END:
- index_rows.append((o, o.split('.')[-1]))
+ eo = extract_end_oid(columns[max_len_col][0], o)
+ index_rows.append((o, eo))
elif index_format == OID_STRING:
index_rows.append((o, o))
else:
@@ -242,29 +251,30 @@ def get_snmp_table(hostname, ip, oid_info):
# First compute the complete list of end-oids appearing in the output
# by looping all results and putting the endoids to a flat list
- #
- # The list needs to be sorted to prevent problems when the first
- # column has missing values in the middle of the tree.
endoids = []
- for column in columns:
+ for fetchoid, column in columns:
for o, value in column:
- endoid = int(o.rsplit('.', 1)[-1])
+ endoid = extract_end_oid(fetchoid, o)
if endoid not in endoids:
endoids.append(endoid)
- endoids.sort()
+
+ # The list needs to be sorted to prevent problems when the first
+ # column has missing values in the middle of the tree. Since we
+ # work with strings of numerical components, a simple string sort
+ # is not correct. 1.14 must come after 1.2!
+ endoids.sort(cmp = cmp_oids)
# Now fill gaps in columns where some endois are missing
new_columns = []
- for column in columns:
+ for fetchoid, column in columns:
i = 0
new_column = []
# Loop all lines to fill holes in the middle of the list. All
- # columns check the the following lines for the correct endoid. If
+ # columns check the following lines for the correct endoid. If
# an endoid differs empty values are added until the hole is filled
for o, value in column:
- beginoid, endoid = o.rsplit('.', 1)
- endoid = int(endoid)
- while i < len(endoids) and endoids[i] != endoid:
+ eo = extract_end_oid(fetchoid, o)
+ while i < len(endoids) and endoids[i] != eo:
new_column.append("") # (beginoid + '.' +endoids[i], "" ) )
i += 1
new_column.append(value)
Module: check_mk
Branch: master
Commit: 8f5a7e44a9a12af8e163f65203abb669b0839c0f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8f5a7e44a9a12a…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Apr 12 12:07:44 2011 +0200
FIX: fix crash when saving services after migration from old version
---
ChangeLog | 1 +
modules/check_mk.py | 8 ++++++++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1b4848d..da59213 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -21,6 +21,7 @@
* Added new component BI to Multisite.
WATO:
+ * FIX: fix crash when saving services after migration from old version
* Allow moving hosts from one to another config file
Checks & Agents:
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 189f944..440672c 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -3684,6 +3684,14 @@ def automation_parse_autochecks_file(hostname):
line = line.strip()
if not line.startswith("("):
continue
+
+ # drop everything after potential '#' (from older versions)
+ i = line.rfind('#')
+ if i > 0: # make sure # is not contained in string
+ rest = line[i:]
+ if '"' not in rest and "'" not in rest:
+ line = line[:i].strip()
+
if line.endswith(","):
line = line[:-1]
line = line[1:-1] # drop brackets
Module: check_mk
Branch: master
Commit: 882209fb5c596b406068e6478ebcea1b516838cb
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=882209fb5c596b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Apr 12 08:28:49 2011 +0200
ipmi: allow to ignore certain sensors
This is done via ipmi_ignored_sensors. See man page
of ipmi for details.
---
ChangeLog | 1 +
checkman/ipmi | 24 +++++++++++++++++-------
checks/ipmi | 45 +++++++++++++++++++++++++++++++++++++++++----
3 files changed, 59 insertions(+), 11 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b524bc2..66d3f27 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -67,6 +67,7 @@
* if/if64: also show perf-o-meter if speed is unknown
* f5_bigip_pool: status of F5 BIP/ip load balancing pools
* f5_bigip_vserver: status of F5 BIP/ip virtual servers
+ * ipmi: new configuration variable ipmi_ignored_sensors (see man page)
1.1.10:
diff --git a/checkman/ipmi b/checkman/ipmi
index 9ca3b46..1c9c249 100644
--- a/checkman/ipmi
+++ b/checkman/ipmi
@@ -7,16 +7,19 @@ description:
This check makes use of the output of a working {ipmitool} on
a Linux system. If the kernel properly supports IPMI and {ipmitool}
is installed, then the agent will output the current state of
- power supplies, cooling devices and temperatures. This check makes
+ power supplies, cooling devices, temperatures and other devices
+ avaiable via IPMI. This check makes
sure that all those devices are working properly.
- Fortunately, IPMI provides not only the current sensor values
- but also their state, so no levels need to be configured for
- this checks.
+ Fortunately, IPMI provides not only the current sensor values but also
+ their state, so no levels need to be configured for this checks.
- This check provides a summarized mode, where all sensors
- appear as one summary check per host and a detailed mode
- with one check per sensor.
+ This check provides a summarized mode, where all sensors appear as one
+ summary check per host and a detailed mode with one check per sensor.
+
+ Please note: on some systems IPMI reports sensors in a non-ok state wheras
+ actually no problem exists. As of version 1.1.11i1 these sensors can be
+ ignored with the configuration variable {ipmi_ignored_sensors}.
item:
{"Summary"} for summary mode, the name of the IPMI item
@@ -44,9 +47,16 @@ examples:
# Make inventory produce detailed IPMI checks
ipmi_summarize = False
+ # Ignore certain types of sensors
+ ipmi_ignored_sensors = [ "Power_Meter", "Virtual_Fan" ]
+
[configuration]
ipmi_ignore_nr (boolean): If set to {True}, sensors
with the state {nr} will be ignored. Default is {False}.
ipmi_summarize (boolean): If set to {False}, the inventory
will create a separate service for each IPMI device. Default
is {True}.
+ipmi_ignored_sensors(list): A list of sensors names that should
+ be ignored when doing inventory (for non-summarized mode) or
+ during check for summarized mode). The check does a {prefix}
+ match on the names.
diff --git a/checks/ipmi b/checks/ipmi
index 3b12ac8..b5c5d08 100644
--- a/checks/ipmi
+++ b/checks/ipmi
@@ -26,6 +26,7 @@
# Example of output from ipmi:
+# <<<ipmi>>>
# ambienttemp 25.800 degrees_C ok na na na 34.800 40.200 na
# bulk.v12-0-s0 11.940 Volts ok na 10.200 na na 13.800 na
# bulk.v3_3-s0 3.360 Volts ok na 3.000 na na 3.600 na
@@ -47,6 +48,7 @@
# p0.v_vdd 1.332 Volts ok 0.792 0.900 0.996 1.596 1.692 1.800
# Yet another host (HP DL 360G5)
+# <<<ipmi>>>
# UID_Light 0.000 unspecified ok na na 0.000 na na na
# Int._Health_LED 0.000 unspecified ok na na 0.000 na na na
# Ext._Health_LED 0.000 unspecified ok na na 0.000 na na na
@@ -68,6 +70,21 @@
# Temp_7 30.000 degrees_C ok na na -64.000 na na na
# Power_Meter 180.000 Watts cr na na 384.000 na na na
+# And this host has some false-criticals (PowerMeter, VirtualFan)
+# <<<ipmi>>>
+# Temp_1 17.000 degrees_C ok 0.000 0.000 0.000 40.000 42.000 46.000
+# Temp_2 40.000 degrees_C ok 0.000 0.000 0.000 0.000 82.000 83.000
+# Temp_3 44.000 degrees_C ok 0.000 0.000 0.000 0.000 82.000 83.000
+# Temp_4 52.000 degrees_C ok 0.000 0.000 0.000 0.000 87.000 92.000
+# Temp_5 46.000 degrees_C ok 0.000 0.000 0.000 0.000 85.000 90.000
+# Temp_6 55.000 degrees_C ok 0.000 0.000 0.000 0.000 85.000 90.000
+# Temp_7 51.000 degrees_C ok 0.000 0.000 0.000 0.000 85.000 90.000
+# Temp_8 58.000 degrees_C ok 0.000 0.000 0.000 0.000 78.000 83.000
+# Temp_9 74.000 degrees_C ok 0.000 0.000 0.000 0.000 110.000 115.000
+# Temp_10 31.000 degrees_C ok 0.000 0.000 0.000 0.000 60.000 65.000
+# Virtual_Fan 19.600 unspecified nc na na na na na na
+# Power_Meter 236.000 Watts cr na na na na na na
+
# IPMI has two operation modes:
# 1. detailed
@@ -79,12 +96,23 @@
ipmi_summarize = True
ipmi_ignore_nr = False # set to True in order to ignore entries with state 'nr'
+ipmi_ignored_sensors = [] # example: [ "Power_Meter", "Virtual_Fan" ]
+
+def ipmi_ignore_entry(name, state):
+ if ipmi_ignore_nr and state == 'nr':
+ return True
+ for e in ipmi_ignored_sensors:
+ if name.startswith(e):
+ return True
+ return False
def inventory_ipmi(checkname, info):
if ipmi_summarize and len(info) > 0:
- return [ ( "Summary", None, None ) ]
+ return [ ( "Summary", None ) ]
else:
- return [ ( line[0], line[1], None ) for line in info if not ipmi_ignore_nr or line[3] != 'nr' ]
+ return [ ( line[0], None )
+ for line in info
+ if not ipmi_ignore_entry(line[0], line[3]) ]
def check_ipmi(item, params, info):
if item == "Summary":
@@ -94,7 +122,8 @@ def check_ipmi(item, params, info):
def check_ipmi_detailed(item, info):
try:
- for name,val,unit,status,unrec_low,crit_low,warn_low,warn_high,crit_high,unrec_high in info:
+ for name, val, unit, status, unrec_low, crit_low, \
+ warn_low, warn_high, crit_high, unrec_high in info:
if name == item:
perfdata = [ (name, val + unit) ] # TODO: add warn and crit levels
if status == 'ok':
@@ -115,7 +144,11 @@ def check_ipmi_summarized(info):
ambient_count = 0
ambient_sum = 0.0
try:
- for name,val,unit,status,unrec_low,crit_low,warn_low,warn_high,crit_high,unrec_high in info:
+ for name, val, unit, status, unrec_low, crit_low, \
+ warn_low, warn_high, crit_high, unrec_high in info:
+ if ipmi_ignore_entry(name, status):
+ continue
+
text = "%s is %s %s" % (name, val, unit)
count += 1
if status == 'nc':
@@ -155,4 +188,8 @@ def check_ipmi_summarized(info):
return (worst_status, "%s - %s" % (statname, infotext), perfdata)
check_info['ipmi'] = (check_ipmi, "IPMI Sensor %s", 1, inventory_ipmi)
+
+# Make sure, configuration variables needed during check time are present
+# in precompiled code
check_config_variables.append("ipmi_ignore_nr")
+check_config_variables.append("ipmi_ignored_sensors")
Module: check_mk
Branch: master
Commit: 1a19cef045f432dbddba985a308eb59625a3aecf
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1a19cef045f432…
Author: Florian Heigl <fh(a)mathias-kettner.de>
Date: Fri Apr 8 17:39:49 2011 +0200
added f5 basic checks
---
ChangeLog | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 6bd976f..3be9e57 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -39,6 +39,7 @@
* FIX: bluecoat_sensors: Using scale parameter provided by the host for reported values
* FIX: fjdarye60_devencs, fjdarye60_disks.summary: added snmp scan functions
* FIX: decru_*: added snmp scan functions
+ * FIX: heartbeat_rscstatus handles empty agent output correctly
* printer_supply: Changed order of tests. When a printer reports -3 this
is used before the check if maxlevel is -2.
* printer_supply: Skipping inventory of supplies which have current value
@@ -63,7 +64,8 @@
* if/if64: also output performance data if operstate not as expected
* if/if64: scan function now also detects devices where the first port
* if/if64: also show perf-o-meter if speed is unknown
- * FIX: heartbeat_rscstatus handles empty agent output correctly
+ * f5_bigip_pool: status of F5 BIP/ip load balancing pools
+ * f5_bigip_vserver: status of F5 BIP/ip virtual servers
1.1.10: