Module: check_mk
Branch: master
Commit: 6316b43d11597bc1c60960b861d3a2a19ab1c813
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6316b43d11597b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Aug 4 09:50:15 2014 +0200
Fixed various problems when loading builtin dashboards of old format
---
web/htdocs/dashboard.py | 31 ++++++++++++++++++++++++++++---
web/plugins/sidebar/wato.py | 3 ++-
2 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/web/htdocs/dashboard.py b/web/htdocs/dashboard.py
index c95cb0e..cc13b0d 100644
--- a/web/htdocs/dashboard.py
+++ b/web/htdocs/dashboard.py
@@ -60,13 +60,14 @@ dashlet_min_size = 10, 10 # Minimum width and height of dashlets
# thus must be reinitialized everytime a language-change has
# been detected.
def load_plugins():
- global loaded_with_language, dashboards
+ global loaded_with_language, dashboards, builtin_dashboards_transformed
if loaded_with_language == current_language:
return
# Load plugins for dashboards. Currently these files
# just may add custom dashboards by adding to builtin_dashboards.
load_web_plugins("dashboard", globals())
+ builtin_dashboards_transformed = False
# This must be set after plugin loading to make broken plugins raise
# exceptions all the time and not only the first time (when the plugins
@@ -82,7 +83,7 @@ def load_plugins():
for name, board in builtin_dashboards.items():
config.declare_permission("dashboard.%s" % name,
board["title"],
- board["description"],
+ board.get("description", ""),
config.builtin_role_ids)
# Make sure that custom views also have permissions
@@ -98,14 +99,27 @@ def load_dashboards():
# referenced by url, e.g. dashboard['url'] = 'hoststats.py'
# FIXME: can be removed one day. Mark as incompatible change or similar.
def transform_builtin_dashboards():
+ global builtin_dashboards_transformed
+ if builtin_dashboards_transformed:
+ return # Only do this once
for name, dashboard in builtin_dashboards.items():
+ # Do not transform dashboards which are already in the new format
+ if 'context' in dashboard:
+ continue
+
+ # Transform the dashlets
for nr, dashlet in enumerate(dashboard['dashlets']):
if dashlet.get('url', '').startswith('dashlet_') and dashlet['url'].endswith('.py'):
+ # hoststats and servicestats
dashlet['type'] = dashlet['url'][8:-3]
del dashlet['url']
- elif dashlet.get('url', '') != '':
+
+ elif dashlet.get('url', '') != '' or dashlet.get('urlfunc'):
+ # Normal URL based dashlet
dashlet['type'] = 'url'
+
elif dashlet.get('view', '') != '':
+ # Transform views
# There might be more than the name in the view definition
view_name = dashlet['view'].split('&')[0]
@@ -113,6 +127,11 @@ def transform_builtin_dashboards():
load_view_into_dashlet(dashlet, nr, view_name)
del dashlet['view']
+ else:
+ raise MKGeneralException(_('Unable to transform dashlet %d of dashboard %s. '
+ 'You will need to migrate it on your own. Definition: %r' %
+ (nr, name, html.attrencode(dashlet))))
+
# the modification time of builtin dashboards can not be checked as on user specific
# dashboards. Set it to 0 to disable the modification chech.
dashboard.setdefault('mtime', 0)
@@ -122,6 +141,12 @@ def transform_builtin_dashboards():
dashboard['title'] = _('No title')
dashboard['show_title'] = False
+ dashboard.setdefault('context_type', 'global')
+ dashboard.setdefault('context', {})
+ dashboard.setdefault('topic', _('Overview'))
+ dashboard.setdefault('description', dashboard.get('title', ''))
+ builtin_dashboards_transformed = True
+
def load_view_into_dashlet(dashlet, nr, view_name):
import views
views.load_views()
diff --git a/web/plugins/sidebar/wato.py b/web/plugins/sidebar/wato.py
index 0583eb4..d584332 100644
--- a/web/plugins/sidebar/wato.py
+++ b/web/plugins/sidebar/wato.py
@@ -24,7 +24,7 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-import config, wato, views
+import config, wato, views, dashboard
# +----------------------------------------------------------------------+
# | __ ___ _____ ___ |
@@ -215,6 +215,7 @@ def render_wato_foldertree():
selected_topic, selected_target = config.load_user_file("foldertree", (_('Hosts'), 'allhosts'))
views.load_views()
+ dashboard.load_dashboards()
topic_views = visuals_by_topic(views.permitted_views().items() + dashboard.permitted_dashboards().items())
topics = [ (t, t) for t, s in topic_views ]
html.select("topic", topics, selected_topic, onchange = 'wato_tree_topic_changed(this)')
Module: check_mk
Branch: master
Commit: 1a070043e2ce66ba31176af8054c923222229e71
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1a070043e2ce66…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Fri Aug 1 15:38:28 2014 +0200
#0194 FIX raritan_pdu_inlet: Check now outputs the correct values
The complete checks has been rewritten cause of a few problems with the old version.
A re-inventory of all raritan pdu devices is needed after update.
---
.werks/194 | 11 +++++++++++
ChangeLog | 2 ++
checks/raritan_pdu_inlet | 6 +++---
checks/raritan_pdu_inlet.include | 4 +++-
4 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/.werks/194 b/.werks/194
new file mode 100644
index 0000000..07eb1a2
--- /dev/null
+++ b/.werks/194
@@ -0,0 +1,11 @@
+Title: raritan_pdu_inlet: Check now outputs the correct values
+Level: 1
+Component: checks
+Compatible: incomp
+Version: 1.2.5i6
+Date: 1406900223
+Class: fix
+
+The complete checks has been rewritten cause of a few problems with the old version.
+A re-inventory of all raritan pdu devices is needed after update.
+
diff --git a/ChangeLog b/ChangeLog
index 7aca901..31c01d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,8 @@
* 1090 FIX: zfsget: fixed exception which happened on incomplete zfs entries
* 0187 FIX: hp_proliant_power: Fixed Wato configuration
* 0192 FIX: oracle_rman_backups: Not longer try to make a inventory for broken plugin outputs
+ * 0194 FIX: raritan_pdu_inlet: Check now outputs the correct values...
+ NOTE: Please refer to the migration notes!
Multisite:
* 1066 Implemented Dashboard Designer...
diff --git a/checks/raritan_pdu_inlet b/checks/raritan_pdu_inlet
index a81c3c8..000d861 100644
--- a/checks/raritan_pdu_inlet
+++ b/checks/raritan_pdu_inlet
@@ -28,8 +28,8 @@ def raritan_pdu_inlet_convert(info):
# List of tuples, sorting like the snmp output,
# each tuple contains: capabilities, Unit, digits
translation = (
+ ( '2', 1 ),
( '1', 0 ),
- ( '2', 0 ),
( '3', 0 ),
( '4', 0 ),
( '-1', 2 ),
@@ -40,10 +40,10 @@ def raritan_pdu_inlet_convert(info):
for line in info:
y = 0
state = line[1]
- for value in line[2:]:
+ for value in line[1:]:
item = phases[i] + '-' + capabilities[translation[y][0]]
unit = translation[y][0]
- digits = translation[y][2]
+ digits = translation[y][1]
yield item, unit, digits, '1', state, value
y += 1
i += 1
diff --git a/checks/raritan_pdu_inlet.include b/checks/raritan_pdu_inlet.include
index b7bc570..8fab020 100644
--- a/checks/raritan_pdu_inlet.include
+++ b/checks/raritan_pdu_inlet.include
@@ -79,7 +79,9 @@ sensor_states = {
def inventory_raritan_pdu_inlet_generic(info):
for line in info:
- yield line[0], None
+ # Ignore closed sensor state
+ if line[4] != '1':
+ yield line[0], None
def check_raritan_pdu_inlet_generic(item, _no_params, info):
for line in info:
Module: check_mk
Branch: master
Commit: 7d8c5f6b5341a739ec105ad8759e96af0428bedc
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7d8c5f6b5341a7…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Aug 1 15:21:07 2014 +0200
#1070 printer_input/printer_output: New checks to monitor input/output sub-units of printers
These checks are meant to check whether or not there is enough paper in the input slots
and/or enough space in the output slots.
---
.werks/1070 | 10 ++
ChangeLog | 1 +
checkman/printer_input | 27 ++++++
checkman/printer_output | 27 ++++++
checks/printer_io | 168 ++++++++++++++++++++++++++++++++++
web/plugins/wato/check_parameters.py | 48 +++++++++-
6 files changed, 280 insertions(+), 1 deletion(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=7d8c5f6b53…
Module: check_mk
Branch: master
Commit: 67af7971b11dfe877b2afe5880a74d6296161c20
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=67af7971b11dfe…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Fri Aug 1 11:14:44 2014 +0200
docsis_signal_quality: Added Signal Noise
---
checkman/docsis_channels_downstream | 4 ++--
checkman/docsis_signal_quality | 10 ++++++----
checks/docsis_signal_quality | 19 ++++++++++++++++++-
web/plugins/wato/check_parameters.py | 9 ++++++++-
4 files changed, 34 insertions(+), 8 deletions(-)
diff --git a/checkman/docsis_channels_downstream b/checkman/docsis_channels_downstream
index 407e686..dd4a83e 100644
--- a/checkman/docsis_channels_downstream
+++ b/checkman/docsis_channels_downstream
@@ -7,8 +7,8 @@ description:
This check monitors currently only montiors the frequency for each channel in Mhz. Additional information are available but not yet implemented.
item:
- None
+ Channel ID
inventory:
- One service will be created
+ One service will be created for each channel
diff --git a/checkman/docsis_signal_quality b/checkman/docsis_signal_quality
index 2a6f2aa..2c5eedd 100644
--- a/checkman/docsis_signal_quality
+++ b/checkman/docsis_signal_quality
@@ -4,12 +4,14 @@ catalog: hw/network/docsis
license: GPL
distribution:
description:
- This check monitors the Forward Error correction rate on the docsis MIB.
- It is possible to set levels in percent for uncorrected and corrected packages.
+ This check monitors the Singal Quality. This includes
+ the Forward Error correction, and the Signal Noise.
+ It is possible to set levels in percent for uncorrected and corrected packages (FEC) and
+ levels for the Signal Quality in dB.
item:
- None
+ Channel ID like reported in SNMP Output
inventory:
- One service will be created
+ One service will be created for each Channel
diff --git a/checks/docsis_signal_quality b/checks/docsis_signal_quality
index 8f57ef4..6937c4e 100644
--- a/checks/docsis_signal_quality
+++ b/checks/docsis_signal_quality
@@ -36,6 +36,7 @@
factory_settings["docsis_signal_quality_default_levels"] = {
"corrected" : ( 25.0 , 30.0 ),
"uncorrected" : ( 25.0 , 30.0 ),
+ "signal_noise" : ( 50, 60 ), #dB
}
def inventory_docsis_signal_quality(info):
@@ -44,8 +45,23 @@ def inventory_docsis_signal_quality(info):
yield line[0], {}
def check_docsis_signal_quality( item, params, info):
- for entry, good, corrected, uncorrected in info:
+ for entry, good, corrected, uncorrected, signal_noise in info:
if entry == item:
+ # Signal Noise
+ noise_db = float(signal_noise) / 10
+ infotext = "Noise: %.2f dB" % noise_db
+ warn, crit = params['signal_noise']
+ levels = " (Warn/Crit at %s dB/ %s dB)" % ( warn, crit )
+ state = 0
+ if noise_db >= crit:
+ state = 2
+ infotext += levels
+ elif noise_db >= warn:
+ state = 2
+ infotext += levels
+ yield state, infotext, [ ('signal_noise', noise_db, warn, crit ) ]
+
+ # FEC
fec = {}
good, fec['corrected'], fec['uncorrected'] = map(float, [ good, corrected, uncorrected ])
fec['corrected_perc'] = ( fec['corrected'] / good ) * 100
@@ -73,6 +89,7 @@ check_info["docsis_signal_quality"] = {
2, #docsIfSigQUnerroreds
3, #docsIfSigQCorrecteds
4, #docsIfSigQUnerroreds
+ 5, #docsIfSigQSignalNoise
]),
"default_levels_variable" : "docsis_signal_quality_default_levels",
"group" : "docsis_signal_quality",
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index c5082a0..ba2a544 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -1318,9 +1318,16 @@ register_check_parameters(
register_check_parameters(
subgroup_networking,
'docsis_signal_quality',
- _("Docsis Forward error correction"),
+ _("Docsis Singal Quality"),
Dictionary(
elements = [
+ ( 'signal_noise', Tuple(
+ title = _("Levels for Signal Noise"),
+ elements = [
+ Integer( title = _("Warning at"), unit = "dB", default_value = 50),
+ Integer( title = _("Critical at"), unit = "dB", default_value = 60 ),
+ ]
+ )),
( 'corrected', Tuple(
title = _("Levels for corrected Packages"),
elements = [