Module: check_mk
Branch: master
Commit: 1b605d38f28f0356d134fe52b2817a76f6dbd6a3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1b605d38f28f03…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Tue Oct 14 09:43:55 2014 +0200
#1184 FIX cisco_power: Fixed detection of item. In some cases the status information was part of the item
A reinventory is in some cases necessary. Please Check after the Update for {UNKOWN} states of checks of this check_type
---
.werks/1184 | 10 ++++++++++
ChangeLog | 2 ++
checks/cisco_power | 28 ++++++++++++++++++++--------
3 files changed, 32 insertions(+), 8 deletions(-)
diff --git a/.werks/1184 b/.werks/1184
new file mode 100644
index 0000000..1839e7f
--- /dev/null
+++ b/.werks/1184
@@ -0,0 +1,10 @@
+Title: cisco_power: Fixed detection of item. In some cases the status information was part of the item
+Level: 1
+Component: checks
+Compatible: incomp
+Version: 1.2.5i6
+Date: 1413272472
+Class: fix
+
+A reinventory is in some cases necessary. Please Check after the Update for {UNKOWN} states of checks of this check_type
+
diff --git a/ChangeLog b/ChangeLog
index 3e77fe0..d124b02 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -102,6 +102,8 @@
* 1114 FIX: bluecat_threads: no longer detected on wrong systems...
* 1116 FIX: megaraid_ldisk: now longer raises an exception for adapters with 'No Virtual Drive Configured'
* 1122 FIX: windows agent: unicode logfile monitoring: now able to detect incomplete written lines...
+ * 1184 FIX: cisco_power: Fixed detection of item. In some cases the status information was part of the item...
+ NOTE: Please refer to the migration notes!
Multisite:
* 1066 Implemented Dashboard Designer...
diff --git a/checks/cisco_power b/checks/cisco_power
index 863bf1e..a2cccf8 100644
--- a/checks/cisco_power
+++ b/checks/cisco_power
@@ -36,21 +36,33 @@ cisco_power_states = ('', 'normal', 'warning', 'critical',
cisco_power_source = ( '', 'unknown', 'ac', 'dc', 'externalPowerSupply', 'internalRedundant')
def inventory_cisco_power(info):
- # 5 in line[1] means cisco_power_states = notPresent
- return [ (line[0], '', '""') for line in info if 'RPS NotExist' not in line[0] and line[1] != '5' ]
+ for line in info:
+ # 5 in line[1] means cisco_power_states = notPresent
+ if 'RPS NotExist' not in line[0] and line[1] != '5':
+ # The field used here (ciscoEnvMonSupplyStatusDescr) can also
+ # contain a textual description of the current status.
+ # This tryes to remove that information
+ try:
+ item = line[0].split(',')[0]
+ except:
+ item = line[0]
+ yield item, None
-def check_cisco_power(item, params, info):
+def check_cisco_power(item, no_params, info):
for line in info:
- if line[0] == item:
+ try:
+ convert_item = line[0].split(',')[0]
+ except:
+ convert_item = line[0]
+ if convert_item == item:
state, source = map(saveint, line[1:3])
output = 'State: %s, Source: %s' % (cisco_power_states[state], cisco_power_source[source])
if state == 1:
- return (0, "%s" % output)
+ return 0, "%s" % output
elif state == 2:
- return (1, "%s" % output)
+ return 1, "%s" % output
else:
- return (2, "%s" % output)
- return (3, "item not found in snmp data")
+ return 2, "%s" % output
Module: check_mk
Branch: master
Commit: be5ddacefb5ec134204905854ed1047639e0cf1d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=be5ddacefb5ec1…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Mon Oct 13 14:13:59 2014 +0200
Spelling corrections
---
web/plugins/wato/check_parameters.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index c49ab8c..a8f7f27 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -528,9 +528,9 @@ register_rule(group + '/' + subgroup_inventory,
register_rule(group + '/' + subgroup_inventory,
varname = "sap_value_groups",
title = _('SAP Value Grouping Patterns'),
- help = _('The check <tt>sap.value</tt> normaly creates one service for each sap value '
- 'By defining grouping patterns you can switch to the check <tt>sap.value-groups</tt>. '
- 'That check monitors a list of SAP values at once. This is usefull if you have '
+ help = _('The check <tt>sap.value</tt> normally creates one service for each SAP value. '
+ 'By defining grouping patterns, you can switch to the check <tt>sap.value-groups</tt>. '
+ 'That check monitors a list of SAP values at once. This is useful if you have '
'a very big list of values which do you want to monitor'),
valuespec = ListOf(
Tuple(
Module: check_mk
Branch: master
Commit: 4346b1e2fb4311df9c155bdd2968a86ce6997cd6
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4346b1e2fb4311…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Oct 13 10:24:53 2014 +0200
Fixed another format error in Werk
---
.werks/984 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.werks/984 b/.werks/984
index 3e24a47..b030778 100644
--- a/.werks/984
+++ b/.werks/984
@@ -24,6 +24,6 @@ systems WATO still uses <tt>pickle</tt>, even with this fix.
<b>Note:</b> This change makes the current Check_MK versions incompatible
to older versions. In a mixed environment with old and new Check_MK versions or with old
and newer Python versions you have to force WATO to use the old
-unsafe method by setting <tt>wato_legacy_eval = True<tt> in <tt>multisite.mk</tt>.
+unsafe method by setting <tt>wato_legacy_eval = True</tt> in <tt>multisite.mk</tt>.
This can also be done with the new global WATO setting <i>Use unsafe legacy
encoding for distributed WATO</i>.
Module: check_mk
Branch: master
Commit: 1dbe7e788f0df88e993ba702d9f0a0f8e01afb26
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1dbe7e788f0df8…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Oct 13 10:04:41 2014 +0200
Fixed formatting in Werk
---
.werks/984 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.werks/984 b/.werks/984
index e80167f..3e24a47 100644
--- a/.werks/984
+++ b/.werks/984
@@ -17,7 +17,7 @@ this was modified as a security means from a former version, which used
documentation clearly state, "pickle" should be considered unsafe as well,
see: <tt>https://docs.python.org/2/library/pickle.html</tt>.</i>
-The fix replaces <tt>pickle<tt> with a module called <tt>ast</tt>. Unfortunately
+The fix replaces <tt>pickle</tt> with a module called <tt>ast</tt>. Unfortunately
this module is not available on Centos/RedHat 5.X and Debian 5. On these
systems WATO still uses <tt>pickle</tt>, even with this fix.
Module: check_mk
Branch: master
Commit: 2a023e81256027cb7d5c1fb38066aa62ee3d4962
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2a023e81256027…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Oct 10 13:43:10 2014 +0200
Removed commented out code
---
web/htdocs/visuals.py | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/web/htdocs/visuals.py b/web/htdocs/visuals.py
index 1f76acd..f81a77d 100644
--- a/web/htdocs/visuals.py
+++ b/web/htdocs/visuals.py
@@ -1007,20 +1007,6 @@ class VisualFilterList(ListOfMultiple):
def filter_names(self):
return self._filters.keys()
- # get the filters to be used from the value and the data from the filter
- # objects using the row data
- ## FIXME: This function does not deal with user input. It is just being
- ## used for creating links to views. Why is it here?
- ## def filter_variable_settings(self, value, row):
- ## vars = []
- ## for fname in value.keys():
- ## try:
- ## vars += self._filters[fname].variable_settings(row)
- ## except KeyError:
- ## # When the row misses at least one var for a filter ignore this filter completely
- ## pass
- ## return vars
-
# Realizes a Multisite/visual filter in a valuespec. It can render the filter form, get
# the filled in values and provide the filled in information for persistance.
class VisualFilter(ValueSpec):
Module: check_mk
Branch: master
Commit: c833b2edb1fc72625daf6c86411b34bda58f013c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c833b2edb1fc72…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Oct 10 13:38:46 2014 +0200
Approved fix
---
web/htdocs/views.py | 17 -----------------
1 file changed, 17 deletions(-)
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index d81eb5b..8ebe806 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -1975,23 +1975,6 @@ def link_to_view(content, row, view_name):
new_vars = filter_object.variable_settings(row)
vars += new_vars
- # FIXME: WDTCD (What Does This Contraption Do)?
- # Brauchen wir das hier? Aktuell macht das ein Problem: Wenn man in der View "allservices"
- # auf einen Gruppenkopf klickt - den Hostnamen, dann steckt in der Row der komplette Datensatz
- # zum ersten Service der Gruppe. Die new_vars erzeugen daraufhin einen Filter mit service_regex
- # mit dem ersten Service. In der Zielview bekommt man dann nur noch einen Service zu sehen,
- # und nicht alle von dem Host. Außerdem: VisualFilterList ist ein ValueSpec - zum Editieren
- # von Daten durch den Benutzer. Sollte das hier mißbraucht werden für ganz andere Zwecke?
- ## else:
- ## new_vars = visuals.VisualFilterList([info_key]).filter_variable_settings(view['context'], row)
- ## if "service_regex" in dict(new_vars):
- ## html.debug("VIEW-Titel", view["title"])
- ## html.debug('CONTEXT', view["context"])
- ## html.debug("NEW", new_vars)
- ## html.debug("row", row)
- ## raise 9
- ## vars += new_vars
-
do = html.var("display_options")
if do:
vars.append(("display_options", do))
Module: check_mk
Branch: master
Commit: eb726e2bbeda3ebabe82d950e2f16394a8fe342a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=eb726e2bbeda3e…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Oct 10 12:48:35 2014 +0200
Fix links to views in group headers
this comment removes some code that seems to
be useless.
---
web/htdocs/views.py | 24 ++++++++++++++++++++----
web/htdocs/visuals.py | 20 +++++++++++---------
2 files changed, 31 insertions(+), 13 deletions(-)
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index e0b6b0e..d81eb5b 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -1971,10 +1971,26 @@ def link_to_view(content, row, view_name):
for info_key in datasource['infos']:
if info_key in view['single_infos']:
for key in visuals.info_params(info_key):
- vars += visuals.get_filter(key).variable_settings(row)
-
- else:
- vars += visuals.VisualFilterList([info_key]).filter_variable_settings(view['context'], row)
+ filter_object = visuals.get_filter(key)
+ new_vars = filter_object.variable_settings(row)
+ vars += new_vars
+
+ # FIXME: WDTCD (What Does This Contraption Do)?
+ # Brauchen wir das hier? Aktuell macht das ein Problem: Wenn man in der View "allservices"
+ # auf einen Gruppenkopf klickt - den Hostnamen, dann steckt in der Row der komplette Datensatz
+ # zum ersten Service der Gruppe. Die new_vars erzeugen daraufhin einen Filter mit service_regex
+ # mit dem ersten Service. In der Zielview bekommt man dann nur noch einen Service zu sehen,
+ # und nicht alle von dem Host. Außerdem: VisualFilterList ist ein ValueSpec - zum Editieren
+ # von Daten durch den Benutzer. Sollte das hier mißbraucht werden für ganz andere Zwecke?
+ ## else:
+ ## new_vars = visuals.VisualFilterList([info_key]).filter_variable_settings(view['context'], row)
+ ## if "service_regex" in dict(new_vars):
+ ## html.debug("VIEW-Titel", view["title"])
+ ## html.debug('CONTEXT', view["context"])
+ ## html.debug("NEW", new_vars)
+ ## html.debug("row", row)
+ ## raise 9
+ ## vars += new_vars
do = html.var("display_options")
if do:
diff --git a/web/htdocs/visuals.py b/web/htdocs/visuals.py
index 1a2b118..1f76acd 100644
--- a/web/htdocs/visuals.py
+++ b/web/htdocs/visuals.py
@@ -1009,15 +1009,17 @@ class VisualFilterList(ListOfMultiple):
# get the filters to be used from the value and the data from the filter
# objects using the row data
- def filter_variable_settings(self, value, row):
- vars = []
- for fname in value.keys():
- try:
- vars += self._filters[fname].variable_settings(row)
- except KeyError:
- # When the row misses at least one var for a filter ignore this filter completely
- pass
- return vars
+ ## FIXME: This function does not deal with user input. It is just being
+ ## used for creating links to views. Why is it here?
+ ## def filter_variable_settings(self, value, row):
+ ## vars = []
+ ## for fname in value.keys():
+ ## try:
+ ## vars += self._filters[fname].variable_settings(row)
+ ## except KeyError:
+ ## # When the row misses at least one var for a filter ignore this filter completely
+ ## pass
+ ## return vars
# Realizes a Multisite/visual filter in a valuespec. It can render the filter form, get
# the filled in values and provide the filled in information for persistance.