Module: check_mk
Branch: master
Commit: 316532c7870d19ecf4434555242b3e743abbff05
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=316532c7870d19…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Aug 22 14:57:09 2011 +0200
text_area: show error, add default value, content quoting
---
.bugs/15 | 17 ++++++++++++++---
.bugs/261 | 8 ++++++++
.bugs/313 | 10 +++++++---
.bugs/46 | 13 +++++++++++++
.bugs/97 | 11 ++++++++++-
web/htdocs/check_mk.css | 2 +-
web/htdocs/htmllib.py | 20 +++++++++++++++-----
web/htdocs/views.py | 8 +++++---
8 files changed, 73 insertions(+), 16 deletions(-)
diff --git a/.bugs/15 b/.bugs/15
index 9117096..30e9aa5 100644
--- a/.bugs/15
+++ b/.bugs/15
@@ -1,13 +1,24 @@
Title: Counter-Wrap: bei service aggregation fehlen Checks
Component: core
+State: wontfix
+Class: nastiness
+Date: 2010-12-21 12:14:07
Benefit: 1
-State: open
Cost: 3
-Date: 2010-12-21 12:14:07
-Class: nastiness
+Fun: 0
Wenn ein Counter Wrap passiert und der check selbst die Exception
nicht abfängt, dann wird das Ergebnis nicht an Nagios weitergeleitet.
Der Service wird auch nicht in die aggregierten Services eines Summary Hosts
aufgenommen. Das kann dazu führen, dass die Anzahl der Services in einem
Summary-Host variabel ist.
+
+Das Problem ist, dass das Problem nur schwer zu lösen ist. Man müsste ja
+den aktuellen Status der fehlenden Checks per Livestatus ermitteln, was
+natürlich ein viel zu großer Häck wäre, der nicht in Frage kommt.
+
+Daher: wir lassen das Problem bestehen. Die Service Aggregation ist
+ohnehin ein Auslaufmodell, dass mit zunehmend stabilem BI überflüssig
+ist und früher oder später rausfliegt.
+
+2011-08-22 14:20:05: changed state open -> wontfix
diff --git a/.bugs/261 b/.bugs/261
index 21fb7e5..9482830 100644
--- a/.bugs/261
+++ b/.bugs/261
@@ -11,3 +11,11 @@ uses a different scheme for the service description. Make
all checks use "Temperature %s". Also use a common PNP-template
that handles a missing WARN/CRIT. Maybe use a common code base,
if this makes sense.
+
+We also need a tool for renaming service descriptions later on
+without loosing history data. That way we have a migration
+path - at least for OMD. This includes:
+
+- Events in Nagios log files
+- RRDs
+- ???
diff --git a/.bugs/313 b/.bugs/313
index 55b9918..b60d155 100644
--- a/.bugs/313
+++ b/.bugs/313
@@ -1,12 +1,16 @@
Title: htmllib: text_area does not have default value
Component: multisite
+State: done
+Class: nastiness
+Date: 2011-07-22 10:48:50
Benefit: 1
-State: open
Cost: 1
-Date: 2011-07-22 10:48:50
-Class: nastiness
+Fun: 0
The function htmllib.text_area should accept a default value,
just as all other input elements. Furthermore the quoting
for > and < is missing. And yet furthermore the complain about
a bad user input is not visualized.
+
+2011-08-22 14:56:49: changed state open -> done
+All three topics fixed.
diff --git a/.bugs/46 b/.bugs/46
index 49cd147..838b7f2 100644
--- a/.bugs/46
+++ b/.bugs/46
@@ -19,3 +19,16 @@ Visualisierung machen.
Kernel (Context switches) und diskstat ist bereits umgestellt.
Unklar, was noch fehlt. Aktuell fällt mir z.B. die Linux-NICS
ein. Winperf auch?
+
+winperf --> Macht nix: wird durch winperf_* ersetzt
+diskstat.include --> Macht nix: nur noch für den legacy modus
+fc_brocade_port --> Macht nix: wird durch brocade_fcport ersetzt
+fc_brocade_port_detailed --> Macht nix: wird durch brocade_fcport ersetzt
+netctr --> Macht nix: wird durch lnx_if abgelöst
+vms_netif --> Macht nix: verwendet eh kaum jemand
+
+Bleiben drei Checks:
+
+aironet_errors
+statgrab_disk
+statgrab_net
diff --git a/.bugs/97 b/.bugs/97
index f2cedac..572e8a1 100644
--- a/.bugs/97
+++ b/.bugs/97
@@ -2,10 +2,19 @@ Title: Restart nagios on OMD - use OMD method
Component: core
Benefit: 1
State: open
-Cost: 1
+Cost: 2
Date: 2011-01-22 13:53:40
Class: cleanup
When doing a restart of Nagios or a config check while running
under OMD, then better not call the start scripts directly, but
use omd to do this 'omd restart nagios'.
+
+Solution: if we detect OMD then do not use the value from defaults,
+but directly call 'omd re{start,load} core'.
+
+Problem is: I've just fixed a problem in OMD (2011-08-22), that
+makes 'omd restart core' work in the first place.
+
+--> better wait a time until all Check_MK users surely use
+ OMD versions that have that fix.
diff --git a/web/htdocs/check_mk.css b/web/htdocs/check_mk.css
index 372faae..7ba718b 100644
--- a/web/htdocs/check_mk.css
+++ b/web/htdocs/check_mk.css
@@ -970,7 +970,7 @@ table.boxlayout td.boxcolumn {
}
-.inputerror input {
+.inputerror input, .inputerror textarea {
background-color: #f84;
}
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 2b12878..4183ae6 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -63,8 +63,8 @@ class uriinfo:
if i[0] not in omit ])
-# Encode HTML attributes: replace " with " This code
-# is slow.
+# Encode HTML attributes: replace " with ", also replace
+# < and >. This code is slow.
def attrencode(value):
if type(value) == int:
return str(value)
@@ -72,6 +72,10 @@ def attrencode(value):
for c in value:
if c == '"':
new += """
+ elif c == '<':
+ new += "<"
+ elif c == '>':
+ new += ">"
else:
new += c
return new
@@ -337,9 +341,15 @@ class html:
self.write(html)
self.form_vars.append(varname)
- def text_area(self, varname, rows):
- value = self.req.vars.get(varname, "")
- self.write("<textarea
name=\"%s\">%s</textarea>\n" % (varname, value))
+ def text_area(self, varname, deflt="", rows=8):
+ value = self.req.vars.get(varname, deflt)
+ error = self.user_errors.get(varname)
+ if error:
+ self.write("<x class=inputerror>")
+ self.write("<textarea
name=\"%s\">%s</textarea>\n" % (varname, attrencode(value)))
+ if error:
+ self.write("</x>")
+ self.set_focus(varname)
self.form_vars.append(varname)
def sorted_select(self, varname, options, deflt="", onchange=None):
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 4f11b50..74be45a 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -384,7 +384,9 @@ def page_edit_views(msg=None):
view = html.multisite_views[(owner, viewname)]
if owner == html.req.user or (view["public"] and (owner == ""
or config.user_may(owner, "publish_views"))):
if first:
- html.write("<tr><th>Name</th><th>Title /
Description</th><th>Owner</th><th>Public</th><th>linked</th><th>Datasource</th><th></th></tr>\n")
+ html.write("<tr><th>Name</th><th>Title /
Description</th>"
+
"<th>Owner</th><th>Public</th><th>linked</th>"
+
"<th>Datasource</th><th></th></tr>\n")
first = False
html.write("<tr><td class=legend>%s</td>" %
viewname)
html.write("<td class=content>")
@@ -394,7 +396,7 @@ def page_edit_views(msg=None):
html.write(view["title"])
description = view.get("description")
if description:
- html.write("<br><div
class=viewdescription>%s</div>" % description)
+ html.write("<br><div
class=viewdescription>%s</div>" % htmllib.attrencode(description))
html.write("</td>")
if owner == "":
ownertxt = "<i>builtin</i>"
@@ -534,7 +536,7 @@ def page_edit_view():
html.write("</td></tr>\n")
html.write("<tr><td class=legend>" + _("Description")
+ "</td><td class=content>")
- html.text_area("view_description", 4)
+ html.text_area("view_description", "", 4)
html.write("</td></tr>\n")
# Larger sections are foldable and closed by default