Module: check_mk
Branch: master
Commit: 9431ff40d5a7637bcdebc8c878135cfbd097e81b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9431ff40d5a763…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Mar 19 13:44:18 2015 +0100
Revert "#2060 FIX check_mk perfometer metrics: fixed exception and two new functions"
This reverts commit 1657f0bf4967d795cac4ed710b0bfd790e2bdbca.
---
.werks/2060 | 14 --------------
ChangeLog | 1 -
web/htdocs/metrics.py | 10 +++-------
3 files changed, 3 insertions(+), 22 deletions(-)
diff --git a/.werks/2060 b/.werks/2060
deleted file mode 100644
index 4951a37..0000000
--- a/.werks/2060
+++ /dev/null
@@ -1,14 +0,0 @@
-Title: check_mk perfometer metrics: fixed exception and two new functions
-Level: 1
-Component: checks
-Compatible: compat
-Version: 1.2.7i1
-Date: 1426761345
-Class: fix
-
-Fixed an exception in dictionary perfometers when no labels were set.
-
-The "total" key in a dictionary perfometer can now be set to a fixed value.
-
-The new key "hide_label" in a dictionary perfometer hides any text.
-This might be useful in stacked/dual perfometers.
diff --git a/ChangeLog b/ChangeLog
index acd966d..7f22dfc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -265,7 +265,6 @@
* 2058 FIX: ucs_bladecenter_fans.temp, ucs_bladecenter_psu.chassis_temp: fixed broken temperature checks (nagios only)...
* 2059 FIX: ucs_bladecenter_if: fixed exception when fibrechannel interfaces were not configured...
* 1233 FIX: Fixed fileinfo check for solaris in case of missing files
- * 2060 FIX: check_mk perfometer metrics: fixed exception and two new functions...
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request, added mailto link for error report...
diff --git a/web/htdocs/metrics.py b/web/htdocs/metrics.py
index fa5b41b..b5e2279 100644
--- a/web/htdocs/metrics.py
+++ b/web/htdocs/metrics.py
@@ -513,15 +513,13 @@ def build_perfometer(perfometer, translated_metrics):
summed += value
if "total" in perfometer:
- if type(perfometer["total"]) in [ int, float ]:
- total = perfometer["total"]
- else:
- total, unit, color = evaluate(perfometer["total"], translated_metrics)
+ total, unit, color = evaluate(perfometer["total"], translated_metrics)
else:
total = summed
if total == 0:
entry.append((100.0, "#ffffff"))
+
else:
for ex in perfometer["segments"]:
value, unit, color = evaluate(ex, translated_metrics)
@@ -540,11 +538,9 @@ def build_perfometer(perfometer, translated_metrics):
unit = unit_info[unit_name]
label = unit["render"](summed)
else: # absolute
- value, unit, color = evaluate(perfometer["segments"][0], translated_metrics)
+ value, unit, color = evaluate(metrics_expressions[0], translated_metrics)
label = unit["render"](summed)
- if perfometer.get("hide_label", False):
- label = ""
return label, stack
Module: check_mk
Branch: master
Commit: 3cc74624f5fb5f17b988b11fc7d1aab15a6335d1
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3cc74624f5fb5f…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Thu Mar 19 11:46:41 2015 +0100
#1235 Added notification plugin for Braintwoer SMS Gateways
The plugin can be found in doc/treasures/notifications/ and need to be copied to ~/local/share/check_mk/notifications.
Also you need to setup the credentials and a hostname inside the script.
---
.werks/1235 | 11 +++++++++++
ChangeLog | 1 +
2 files changed, 12 insertions(+)
diff --git a/.werks/1235 b/.werks/1235
new file mode 100644
index 0000000..ec4c726
--- /dev/null
+++ b/.werks/1235
@@ -0,0 +1,11 @@
+Title: Added notification plugin for Braintwoer SMS Gateways
+Level: 1
+Component: notifications
+Compatible: compat
+Version: 1.2.7i1
+Date: 1426761898
+Class: feature
+
+The plugin can be found in doc/treasures/notifications/ and need to be copied to ~/local/share/check_mk/notifications.
+Also you need to setup the credentials and a hostname inside the script.
+
diff --git a/ChangeLog b/ChangeLog
index 906ad9c..bdc810a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -371,6 +371,7 @@
* 1213 New Notification macros $SERVICEFORURL$ and $HOSTFORURL$...
* 2041 Notification Spooler can now handle incoming and outgoing persistent TCP connections...
* 2135 Allow to filter notification contacts based on values of custom macros...
+ * 1235 Added notification plugin for Braintwoer SMS Gateways...
* 1661 FIX: mknotifyd: improved performance when receiving forwarded notifications
* 1664 FIX: mknotifyd: further performance improvements for notification forwarding
* 1205 FIX: RBN: Fixed match contactgroup condition...
fixed exception and two new functions
Message-ID: <550aa77f.nlhzrn1TpA2xIQiR%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: 1657f0bf4967d795cac4ed710b0bfd790e2bdbca
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1657f0bf4967d7…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Mar 19 11:39:47 2015 +0100
#2060 FIX check_mk perfometer metrics: fixed exception and two new functions
Fixed an exception in dictionary perfometers when no labels were set.
The "total" key in a dictionary perfometer can now be set to a fixed value.
The new key "hide_label" in a dictionary perfometer hides any text.
This might be useful in stacked/dual perfometers.
---
.werks/2060 | 14 ++++++++++++++
ChangeLog | 1 +
web/htdocs/metrics.py | 10 +++++++---
3 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/.werks/2060 b/.werks/2060
new file mode 100644
index 0000000..4951a37
--- /dev/null
+++ b/.werks/2060
@@ -0,0 +1,14 @@
+Title: check_mk perfometer metrics: fixed exception and two new functions
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1426761345
+Class: fix
+
+Fixed an exception in dictionary perfometers when no labels were set.
+
+The "total" key in a dictionary perfometer can now be set to a fixed value.
+
+The new key "hide_label" in a dictionary perfometer hides any text.
+This might be useful in stacked/dual perfometers.
diff --git a/ChangeLog b/ChangeLog
index 99a9904..ba45437 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -265,6 +265,7 @@
* 2058 FIX: ucs_bladecenter_fans.temp, ucs_bladecenter_psu.chassis_temp: fixed broken temperature checks (nagios only)...
* 2059 FIX: ucs_bladecenter_if: fixed exception when fibrechannel interfaces were not configured...
* 1233 FIX: Fixed fileinfo check for solaris in case of missing files
+ * 2060 FIX: check_mk perfometer metrics: fixed exception and two new functions...
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request, added mailto link for error report...
diff --git a/web/htdocs/metrics.py b/web/htdocs/metrics.py
index b5e2279..fa5b41b 100644
--- a/web/htdocs/metrics.py
+++ b/web/htdocs/metrics.py
@@ -513,13 +513,15 @@ def build_perfometer(perfometer, translated_metrics):
summed += value
if "total" in perfometer:
- total, unit, color = evaluate(perfometer["total"], translated_metrics)
+ if type(perfometer["total"]) in [ int, float ]:
+ total = perfometer["total"]
+ else:
+ total, unit, color = evaluate(perfometer["total"], translated_metrics)
else:
total = summed
if total == 0:
entry.append((100.0, "#ffffff"))
-
else:
for ex in perfometer["segments"]:
value, unit, color = evaluate(ex, translated_metrics)
@@ -538,9 +540,11 @@ def build_perfometer(perfometer, translated_metrics):
unit = unit_info[unit_name]
label = unit["render"](summed)
else: # absolute
- value, unit, color = evaluate(metrics_expressions[0], translated_metrics)
+ value, unit, color = evaluate(perfometer["segments"][0], translated_metrics)
label = unit["render"](summed)
+ if perfometer.get("hide_label", False):
+ label = ""
return label, stack
Module: check_mk
Branch: master
Commit: 56e1213d9223c5efe64be7583d909848d24b6ec0
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=56e1213d9223c5…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Mar 19 10:51:23 2015 +0100
When forwarding logwatch log entries to the event console between timezones, the
time of the local time of sending system was used to forward the log entries
without caring about the time zone.
We changed the forwarding code to use unix timestamps for solving the problems
with timezones during forwarding.
You will need to update your event console in order to be able to receive the
new formated messages from remote systems. We recommend to first update your
event console system and then update the sending system.
Conflicts:
ChangeLog
checks/logwatch
---
.werks/2151 | 19 +++++++++++++++++++
ChangeLog | 1 +
checks/logwatch | 12 +++---------
mkeventd/bin/mkeventd | 13 +++++++++++--
4 files changed, 34 insertions(+), 11 deletions(-)
diff --git a/.werks/2151 b/.werks/2151
new file mode 100644
index 0000000..68f2a43
--- /dev/null
+++ b/.werks/2151
@@ -0,0 +1,19 @@
+Title: Fixed wrong time in events when forwarding logwatch to EC between timezones
+Level: 1
+Component: ec
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1426758431
+
+When forwarding logwatch log entries to the event console between timezones, the
+time of the local time of sending system was used to forward the log entries
+without caring about the time zone.
+
+We changed the forwarding code to use unix timestamps for solving the problems
+with timezones during forwarding.
+
+You will need to update your event console in order to be able to receive the
+new formated messages from remote systems. We recommend to first update your
+event console system and then update the sending system.
diff --git a/ChangeLog b/ChangeLog
index 2491f3f..99a9904 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -403,6 +403,7 @@
* 1865 FIX: mkeventd: fixed exception when executing a shell script as action
* 2133 FIX: Fix visualization of global EC setting for Rule Optimizer...
* 2139 FIX: Fix exception in Event Console when archiving events with match groups and non ASCII characters
+ * 2151 FIX: Fixed wrong time in events when forwarding logwatch to EC between timezones...
HW/SW-Inventory:
* 1846 Keep track of changes of software and hardware...
diff --git a/checks/logwatch b/checks/logwatch
index fa7750d..2387785 100644
--- a/checks/logwatch
+++ b/checks/logwatch
@@ -517,12 +517,6 @@ def logwatch_to_prio(level):
else:
return 4
-def syslog_time():
- localtime = time.localtime()
- day = int(time.strftime("%d", localtime)) # strip leading 0
- value = time.strftime("%b %%d %H:%M:%S", localtime)
- return value % day
-
def inventory_logwatch_ec(info):
forwarded_logs, not_forwarded_logs = logwatch_select_forwarded(info)
if forwarded_logs:
@@ -585,7 +579,8 @@ def check_logwatch_ec(item, params, info):
# <facility+priority> timestamp hostname logfile: message
facility = params.get('facility', 17) << 3 # default to "local1"
messages = []
- cur_time = syslog_time()
+ cur_time = int(time.time())
+
forwarded_logfiles = set([])
# Get the logwatch patterns if they are not already precompiled
@@ -620,9 +615,8 @@ def check_logwatch_ec(item, params, info):
rclfd_to_ignore += 1
continue
-
msg = '<%d>' % (facility + logwatch_to_prio(rclfd_level or line[0]),)
- msg += '%s %s %s: %s' % (cur_time, g_hostname, logfile, line[2:])
+ msg += '@%s %s %s: %s' % (cur_time, g_hostname, logfile, line[2:])
messages.append(msg)
forwarded_logfiles.add(logfile)
diff --git a/mkeventd/bin/mkeventd b/mkeventd/bin/mkeventd
index aa00f3e..d505460 100755
--- a/mkeventd/bin/mkeventd
+++ b/mkeventd/bin/mkeventd
@@ -2143,12 +2143,15 @@ class EventServer:
# Variant 6: syslog message without date / host:
# <5>SYSTEM_INFO: [WLAN-1] Triggering Background Scan
+ #Varian 7: logwatch.ec event forwarding
+ # <78>@1341847712 Klapprechner /var/log/syslog: message....
+
# FIXME: Would be better to parse the syslog messages in another way:
# Split the message by the first ":", then split the syslog header part
# and detect which information are present. Take a look at the syslog RFCs
# for details.
- # Variant 2,3,4,5,6
+ # Variant 2,3,4,5,6,7
if line.startswith('<'):
i = line.find('>')
prio = int(line[1:i])
@@ -2161,8 +2164,14 @@ class EventServer:
event["facility"] = 1 # user
event["priority"] = 5 # notice
+ # Variant 7
+ if line[0] == '@' and line[11] == ' ':
+ timestamp, event['host'], line = line.split(' ', 2)
+ event['time'] = float(timestamp[1:])
+ event.update(self.parse_syslog_info(line))
+
# Variant 3
- if line.startswith("@"):
+ elif line.startswith("@"):
event.update(self.parse_monitoring_info(line))
# Variant 5
Module: check_mk
Branch: master
Commit: 6d601a265a93f7d6c8714b23bd00f07a6f0e5f60
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6d601a265a93f7…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Mar 19 10:42:25 2015 +0100
#2140 Remove PNP Timeranges from range selection, put these ranges directly into the list
The selection of a time range for PNP graphs contained one entry <i>PNP View</i> and a submenu
for <i>4 Hours</i>, <i>25 Hours</i>, etc. These entries have been moved directly into the
list and are now also available for the availability and reporting modules.
---
.werks/2140 | 11 +++++++++++
ChangeLog | 1 +
web/htdocs/valuespec.py | 37 ++++++++++++++++++-------------------
web/plugins/views/painters.py | 4 ++--
4 files changed, 32 insertions(+), 21 deletions(-)
diff --git a/.werks/2140 b/.werks/2140
new file mode 100644
index 0000000..b7b719e
--- /dev/null
+++ b/.werks/2140
@@ -0,0 +1,11 @@
+Title: Remove PNP Timeranges from range selection, put these ranges directly into the list
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.7i1
+Date: 1426758052
+Class: feature
+
+The selection of a time range for PNP graphs contained one entry <i>PNP View</i> and a submenu
+for <i>4 Hours</i>, <i>25 Hours</i>, etc. These entries have been moved directly into the
+list and are now also available for the availability and reporting modules.
diff --git a/ChangeLog b/ChangeLog
index c1075e7..a324fef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -277,6 +277,7 @@
* 1937 cpu.loads: performance graph now displays number of CPUs
* 2040 Allow commands for setting downtimes and acknowledging on BI aggregates...
* 2042 Services are now sorted in a natural way, this affects services containing numbers...
+ * 2140 Remove PNP Timeranges from range selection, put these ranges directly into the list...
* 1781 FIX: Fix broken grouping by host/service group in availability
* 1783 FIX: Finish the view "History of Scheduled Downtimes"...
* 1206 FIX: Hostname not longer shown as column in host views
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index f992060..37194f8 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -2139,6 +2139,12 @@ class Timerange(CascadingDropdown):
]
kwargs['choices'] += [
+ ( "4h", _("The last 4 hours")),
+ ( "25h", _("The last 25 hours")),
+ ( "7d", _("The last 7 days")),
+ ( "31d", _("The last 31 days")),
+ ( "365d", _("The last 365 days")),
+
( "d0", _("Today") ),
( "d1", _("Yesterday") ),
@@ -2209,6 +2215,18 @@ class Timerange(CascadingDropdown):
midnight = time.mktime(broken)
until_time = now
+ if rangespec[0].isdigit(): # 4h, 365d
+ count = int(rangespec[:-1])
+ s = rangespec[-1]
+ if s == 'd':
+ seconds = count * 86400
+ title = _("Last %d days") % count
+ else:
+ seconds = count * 3600
+ title = _("Last %d hours") % count
+ from_time = now - seconds
+ return (from_time, now), title
+
if rangespec[0] == 'd': # this/last Day
from_time = time.mktime(broken)
titles = _("Today"), _("Yesterday")
@@ -2249,25 +2267,6 @@ class Timerange(CascadingDropdown):
from_broken[0] -= 1
return (time.mktime(from_broken), until_time), titles[1]
-class PNPTimerange(Timerange):
- def __init__(self, **kwargs):
- choosable = [
- ("0", _("4 Hours")), ("1", _("25 Hours")),
- ("2", _("One Week")), ("3", _("One Month")),
- ("4", _("One Year")),
- ]
-
- if kwargs.get('allow_all', True):
- choosable.append(("", _("All")))
-
- kwargs['choices'] = [
- ('pnp_view', _("PNP View"), DropdownChoice(
- default_value = '1',
- choices = choosable,
- )),
- ]
- Timerange.__init__(self, **kwargs)
-
# A selection of various date formats
def DateFormat(**args):
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index 6b66dde..fb049e4 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -75,8 +75,8 @@
import bi # needed for aggregation icon
multisite_painter_options["pnp_timerange"] = {
- 'valuespec' : PNPTimerange(
- title = _("PNP Timerange"),
+ 'valuespec' : Timerange(
+ title = _("Graph Timerange"),
default_value = None,
include_time = True,
)
Module: check_mk
Branch: master
Commit: 0e94671be62c40f32a0c3e7888054c426398fc2b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0e94671be62c40…
Author: Sven Rueß <sr(a)mathias-kettner.de>
Date: Thu Mar 19 10:25:24 2015 +0100
#1953 FIX Fixed processing of html processing in input fields
If you enter html entities in input fields, the value will be saved correctly.
If you open the rule for editing again, the value will be interpreted. This
replaces html entities with the interpreted character. If you save the rule
now, all html entities will be lost.
One example:
C+:
You enter .
Will be replaced with . (Dot)
C-:
This bug was reported by a customer who have used check_http for finding html
entities in a webpage.
---
.werks/1953 | 22 ++++++++++++++++++++++
ChangeLog | 1 +
web/htdocs/htmllib.py | 2 +-
3 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/.werks/1953 b/.werks/1953
new file mode 100644
index 0000000..7108557
--- /dev/null
+++ b/.werks/1953
@@ -0,0 +1,22 @@
+Title: Fixed processing of html processing in input fields
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1426752106
+
+If you enter html entities in input fields, the value will be saved correctly.
+If you open the rule for editing again, the value will be interpreted. This
+replaces html entities with the interpreted character. If you save the rule
+now, all html entities will be lost.
+
+One example:
+C+:
+You enter .
+Will be replaced with . (Dot)
+C-:
+
+This bug was reported by a customer who have used check_http for finding html
+entities in a webpage.
diff --git a/ChangeLog b/ChangeLog
index 906ad9c..6fa04e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -319,6 +319,7 @@
* 2145 FIX: LDAP-Sync: Handling user ids with special characters more user friendly...
* 2149 FIX: LDAP: The diagnostic log has been changed to use a fixed path...
* 2150 FIX: Reworked internal logging mechanism...
+ * 1953 FIX: Fixed processing of html processing in input fields...
WATO:
* 1760 Added search form to manual checks page
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 50de04e..624941e 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -1315,7 +1315,7 @@ class html:
elif ty not in [str, unicode]: # also possible: type Exception!
value = "%s" % value # Note: this allows Unicode. value might not have type str now
- return value.replace('"', """).replace("<", "<").replace(">", ">")
+ return value.replace("&", "&").replace('"', """).replace("<", "<").replace(">", ">")
# This function returns a str object, never unicode!
# Beware: this code is crucial for the performance of Multisite!