Module: check_mk
Branch: master
Commit: 440a45037a8989a1a9fca203924f3254ae417be3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=440a45037a8989…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Feb 8 12:56:14 2015 +0100
1991 emc_datadomain_temps: make configurable via WATO, add Perf-O-Meter
The check plugin <tt>emc_datadomain_temps</tt> has been converted to the
new standard implementation for all temperature checks. This means that
the check can now be configured via WATO with all available features
and also has a Perf-O-Meter. The price for this is that the name
of the service has been changed, e.g. from <tt>Temperature 1-1</tt> to
<tt>Temperature Chassis Ambient Enclosure 1</tt>. This makes it more
conveniant to write general rules, e.g. or all ambient sensors.
---
.werks/1991 | 15 +++++++++++++++
ChangeLog | 2 ++
checks/emc_datadomain_temps | 42 ++++++++++++++++++------------------------
checks/temperature.include | 16 ++++++++++++++--
4 files changed, 49 insertions(+), 26 deletions(-)
diff --git a/.werks/1991 b/.werks/1991
new file mode 100644
index 0000000..55f12dd
--- /dev/null
+++ b/.werks/1991
@@ -0,0 +1,15 @@
+Title: emc_datadomain_temps: make configurable via WATO, add Perf-O-Meter
+Level: 1
+Component: checks
+Compatible: incomp
+Version: 1.2.7i1
+Date: 1423395404
+Class: feature
+
+The check plugin <tt>emc_datadomain_temps</tt> has been converted to the
+new standard implementation for all temperature checks. This means that
+the check can now be configured via WATO with all available features
+and also has a Perf-O-Meter. The price for this is that the name
+of the service has been changed, e.g. from <tt>Temperature 1-1</tt> to
+<tt>Temperature Chassis Ambient Enclosure 1</tt>. This makes it more
+conveniant to write general rules, e.g. or all ambient sensors.
diff --git a/ChangeLog b/ChangeLog
index 1cb4ecc..5a83348 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -77,6 +77,8 @@
* 1860 df and other filesystem checks: process total fs size as perfdata...
* 1222 mbg_lantime_ng_state: Support for the new Meinberg Lantime MIB (MBG-LANTIME-NG-MIB)...
* 1961 akcp_exp_humidity, akcp_exp_smoke, akcp_exp_temp, akcp_exp_water: New checks to monitor AKCP securityProbe and expansion boards...
+ * 1991 emc_datadomain_temps: make configurable via WATO, add Perf-O-Meter...
+ NOTE: Please refer to the migration notes!
* 1457 FIX: logins: new check renamed from "users" check...
NOTE: Please refer to the migration notes!
* 1762 FIX: lnx_thermal: Now ignoring trip points with level 0...
diff --git a/checks/emc_datadomain_temps b/checks/emc_datadomain_temps
index e889635..987f30a 100644
--- a/checks/emc_datadomain_temps
+++ b/checks/emc_datadomain_temps
@@ -25,29 +25,22 @@
# Boston, MA 02110-1301 USA.
def inventory_emc_datadomain_temps(info):
- inventory = []
- for line in info:
- item = line[0]+"-"+line[1]
- inventory.append((item, None))
- return inventory
+ for encid, descr, reading, status in info:
+ item = descr + " Enclosure " + encid
+ yield item, {}
-def check_emc_datadomain_temps(item, _no_params, info):
- state_table = { "0": ("Failed", 1),
- "1": ("OK", 0),
- "2": ("Notfound", 1),
- "3": ("OverheatWarning", 1),
- "4": ("OverheatCritical", 2),
- }
- for line in info:
- if item == line[0]+"-"+line[1]:
- dev_temp = line[3]
- dev_descr = line[2]
- dev_state = line[4]
- dev_state_str = state_table.get(dev_state, ("Unknown",3))[0]
- dev_state_rc = state_table.get(dev_state, ("Unknown",3))[1]
- yield 0, "Temperature: %s °C (%s)" % (dev_temp, dev_descr), [('temp', dev_temp)]
- if dev_state_rc != 0:
- yield dev_state_rc, dev_state_str
+def check_emc_datadomain_temps(item, params, info):
+ state_table = {
+ "0": (2, "Failed"),
+ "1": (0, "OK"),
+ "2": (2, "Not found"),
+ "3": (1, "Overheat Warning"),
+ "4": (2, "Overheat Critical"),
+ }
+ for encid, descr, reading, status in info:
+ if item == descr + " Enclosure " + encid:
+ dev_status, state_name = state_table[status]
+ return check_temperature(float(reading), params, dev_status = int(dev_status), dev_status_name = state_name)
check_info["emc_datadomain_temps"] = {
@@ -55,15 +48,16 @@ check_info["emc_datadomain_temps"] = {
"inventory_function" : inventory_emc_datadomain_temps,
"service_description" : "Temperature %s",
"has_perfdata" : True,
+ "group" : "temperature",
"snmp_info" : (".1.3.6.1.4.1.19746.1.1.2.1.1.1",
[
1, # tempEnclosureID
- 2, # tempSensorIndex
4, # tempSensorDescription
5, # tempSensorCurrentValue
6, # tempSensorStatus
]
),
- "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.1.0").startswith("Data Domain OS")
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.1.0").startswith("Data Domain OS"),
+ "includes" : [ "temperature.include" ]
}
diff --git a/checks/temperature.include b/checks/temperature.include
index beeadc4..b80bc99 100644
--- a/checks/temperature.include
+++ b/checks/temperature.include
@@ -43,7 +43,8 @@ def celsius_to_fahrenheit(tempc):
# Note: you must not specify dev_status and dev_levels at the same time!
def check_temperature(reading, params, dev_unit = "c",
- dev_levels = None, dev_levels_lower = None, dev_status = None):
+ dev_levels = None, dev_levels_lower = None,
+ dev_status = None, dev_status_name = None):
def from_celsius(tempc, unit):
if unit == "f":
@@ -159,6 +160,7 @@ def check_temperature(reading, params, dev_unit = "c",
# Ignore device's own levels
if dlh == "usr":
warn, crit, warn_lower, crit_lower = usr_warn, usr_crit, usr_warn_lower, usr_crit_lower
+ dev_status = None
# Only use device's levels, ignore yours
elif dlh == "dev":
@@ -183,6 +185,7 @@ def check_temperature(reading, params, dev_unit = "c",
elif dlh == "usrdefault":
if usr_levels:
warn, crit = usr_levels
+ dev_status = None
else:
warn, crit = dev_warn, dev_crit
if usr_levels_lower:
@@ -192,7 +195,7 @@ def check_temperature(reading, params, dev_unit = "c",
# Use device's levels if present, otherwise yours
elif dlh == "devdefault":
- if dev_levels:
+ if dev_levels or dev_status != None:
warn, crit = dev_levels
else:
warn, crit = usr_warn, usr_crit
@@ -203,11 +206,20 @@ def check_temperature(reading, params, dev_unit = "c",
# Now finally compute status. Hooray!
status = check_temp_levels(temp, warn, crit, warn_lower, crit_lower)
+ if dev_status != None:
+ if dlh == "best":
+ status = min(status, dev_status)
+ else:
+ status = max(status, dev_status)
+
perfdata = [ ("temp", temp, warn, crit, warn_lower, crit_lower) ]
# Render actual temperature, e.g. "17.8 °F"
infotext = "%s %s" % (render_temp(temp), unitsym[output_unit])
+ if dev_status != None and dev_status_name:
+ infotext += ", %s" % dev_status_name
+
# In case of a non-OK status output the information about the levels
if status != 0:
usr_levelstext = ""
Module: check_mk
Branch: master
Commit: db63c3e22978c85bfb01a7e88e269524dfd9e36f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=db63c3e22978c8…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Feb 6 17:00:10 2015 +0100
fixed wording
---
.werks/1938 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.werks/1938 b/.werks/1938
index 0101891..72cc7d0 100644
--- a/.werks/1938
+++ b/.werks/1938
@@ -27,5 +27,5 @@ uses an additional parameter - the interface index - to make this service name u
<li>Upstream Channel 1393.3</li>
</ul>
-<b>Note:</b> This extended item name is only used if it is requires, means if there
+<b>Note:</b> This extended item name is only used if it is required, means if there
are duplicate ChannelId entries for this device.
fixed missing checks if channels had the same ChannelId
Message-ID: <54d4e4db.2tO1/8/zgGeV+5Ll%ab(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: 189ced6446cac685ee4974f5408ba30e11350a27
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=189ced6446cac6…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Feb 6 16:58:07 2015 +0100
#1938 FIX docsis_channels_upstream: fixed missing checks if channels had the same ChannelId
DOCSIS services used only the ChannelId as item name.
<ul>
<li>Upstream Channel 1</li>
<li>Upstream Channel 2</li>
<li>Upstream Channel 3</li>
</ul>
There are instances were this ChannelId is not unique, which causes the check
to loose some services. With this update the docsis_channels_upstream check now
uses an additional parameter - the interface index - to make this service name unique.
<ul>
<li>Upstream Channel 1337.1</li>
<li>Upstream Channel 1338.2</li>
<li>Upstream Channel 1343.3</li>
<li>Upstream Channel 1363.1</li>
<li>Upstream Channel 1373.2</li>
<li>Upstream Channel 1393.3</li>
</ul>
<b>Note:</b> This extended item name is only used if it is requires, means if there
are duplicate ChannelId entries for this device.
---
.werks/1938 | 31 +++++++++++++++++++++++++++++++
ChangeLog | 1 +
checks/docsis_channels_upstream | 4 +++-
3 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/.werks/1938 b/.werks/1938
new file mode 100644
index 0000000..0101891
--- /dev/null
+++ b/.werks/1938
@@ -0,0 +1,31 @@
+Title: docsis_channels_upstream: fixed missing checks if channels had the same ChannelId
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1423237560
+
+DOCSIS services used only the ChannelId as item name.
+<ul>
+<li>Upstream Channel 1</li>
+<li>Upstream Channel 2</li>
+<li>Upstream Channel 3</li>
+</ul>
+
+There are instances were this ChannelId is not unique, which causes the check
+to loose some services. With this update the docsis_channels_upstream check now
+uses an additional parameter - the interface index - to make this service name unique.
+
+<ul>
+<li>Upstream Channel 1337.1</li>
+<li>Upstream Channel 1338.2</li>
+<li>Upstream Channel 1343.3</li>
+<li>Upstream Channel 1363.1</li>
+<li>Upstream Channel 1373.2</li>
+<li>Upstream Channel 1393.3</li>
+</ul>
+
+<b>Note:</b> This extended item name is only used if it is requires, means if there
+are duplicate ChannelId entries for this device.
diff --git a/ChangeLog b/ChangeLog
index 9147bfa..1cb4ecc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -148,6 +148,7 @@
* 1936 FIX: check_form_submit: fixed crash on certain form fields with unnamed input elements
* 1960 FIX: akcp_sensor_drycontact: Service description prefix changed from "Device" to "Dry Contact"...
NOTE: Please refer to the migration notes!
+ * 1938 FIX: docsis_channels_upstream: fixed missing checks if channels had the same ChannelId...
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request, added mailto link for error report...
diff --git a/checks/docsis_channels_upstream b/checks/docsis_channels_upstream
index f93350f..6b9ce5e 100644
--- a/checks/docsis_channels_upstream
+++ b/checks/docsis_channels_upstream
@@ -41,9 +41,11 @@ def docsis_channels_upstream_convert(info):
else:
sig_info_dict = dict([ (x[0], x[1:]) for x in sig_info])
cm_info_dict = dict([ (x[0], x[1:]) for x in cm_info])
+ # If the channel id is not unique we also use the OID_END in the item name
+ is_unique = len(freq_info) == len(set(map(lambda x: x[1], freq_info)))
for line in freq_info:
endoid = line[0]
- cid = line[1]
+ cid = is_unique and line[1] or "%s.%s" % (line[0], line[1])
if line[2] != '0':
parsed[cid] = line[1:] + sig_info_dict[endoid] + cm_info_dict.get(endoid, [])
Module: check_mk
Branch: master
Commit: af283f49ec354dd386a5cef485157e41a52e3f4c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=af283f49ec354d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Feb 6 16:25:43 2015 +0100
#1981 FIX Not trying to render view in view editor when the view is not valid
---
.werks/1981 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/visuals.py | 2 +-
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/.werks/1981 b/.werks/1981
new file mode 100644
index 0000000..6a05f34
--- /dev/null
+++ b/.werks/1981
@@ -0,0 +1,10 @@
+Title: Not trying to render view in view editor when the view is not valid
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1423236294
+
+
diff --git a/ChangeLog b/ChangeLog
index 15c1368..9147bfa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -186,6 +186,7 @@
* 1989 FIX: Fix sorting of services in availability views
* 1978 FIX: Fixed linking to other views using "joined columns"...
* 1980 FIX: logwatch: Fixed exception when acknowledging errors of a single logfile on a single host
+ * 1981 FIX: Not trying to render view in view editor when the view is not valid
WATO:
* 1760 Added search form to manual checks page
diff --git a/web/htdocs/visuals.py b/web/htdocs/visuals.py
index e58c2ef..0d33ab8 100644
--- a/web/htdocs/visuals.py
+++ b/web/htdocs/visuals.py
@@ -742,7 +742,7 @@ def page_edit_visual(what, all_visuals, custom_field_handler = None,
html.button("try", _("Try out"))
html.end_form()
- if html.has_var("try") or html.has_var("search"):
+ if (html.has_var("try") or html.has_var("search")) and not html.has_user_errors():
html.set_var("search", "on")
if visual:
import bi