Module: check_mk
Branch: master
Commit: 5d2da32a19eb2a011c6d21eba183f7a724b2360f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5d2da32a19eb2a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 9 09:24:11 2013 +0100
FIX Old log entries were shown in event history first
In previous versions, when the event history views had a limit
applied, like it is configured by default, it happened that
too old entries were read first. When reaching the limit of entries,
the processing stopped and newer events were ignored.
The order of the log files during processing has now been changed.
---
.werks/303 | 13 +++++++++++++
ChangeLog | 1 +
mkeventd/bin/mkeventd | 9 +++++++++
3 files changed, 23 insertions(+)
diff --git a/.werks/303 b/.werks/303
new file mode 100644
index 0000000..4d15567
--- /dev/null
+++ b/.werks/303
@@ -0,0 +1,13 @@
+Title: Old log entries were shown in event history first
+Level: 1
+Component: ec
+Version: 1.2.3i8
+Date: 1386577048
+Class: fix
+
+In previous versions, when the event history views had a limit
+applied, like it is configured by default, it happened that
+too old entries were read first. When reaching the limit of entries,
+the processing stopped and newer events were ignored.
+
+The order of the log files during processing has now been changed.
diff --git a/ChangeLog b/ChangeLog
index ad88c7f..18881cd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,7 @@
Event Console:
* 0301 Handling messages of special syslog format correctly...
+ * 0303 FIX: Old log entries were shown in event history first...
1.2.3i7:
diff --git a/mkeventd/bin/mkeventd b/mkeventd/bin/mkeventd
index df5aac8..1e5665e 100755
--- a/mkeventd/bin/mkeventd
+++ b/mkeventd/bin/mkeventd
@@ -521,6 +521,15 @@ def get_event_history(filters, limit):
timestamps = [ int(fn[:-4]) for fn in os.listdir(log_dir)
if fn.endswith(".log") ]
timestamps.sort()
+ # Use the later logfiles first, to get the newer log entries
+ # first. When a limit is reached, the newer entries should
+ # be processed in most cases. We assume that now.
+ # To keep a consistent order of log entries, we should care
+ # about sorting the log lines in reverse, but that seems to
+ # already be done by the GUI, so we don't do that twice. Skipping
+ # this # will lead into some lines of a single file to be limited in
+ # wrong order. But this should be better than before.
+ timestamps.reverse()
for ts in timestamps:
if limit != None and limit <= 0:
break
Module: check_mk
Branch: master
Commit: 4243c5ad51737d4c3d72de73fec3dd32bdb635de
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4243c5ad51737d…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Dec 8 17:44:10 2013 +0100
FIX Fix exception in WATO host editor on custom tag without topic
When you've defined a host tag group in WATO that has no topic,
then the host edit dialog would be interrupted with an exception.
A simple workaround to this is to alwasy define a topic.
The problem has now been fixed. It had shortly been introduced by fixing a
problem appearing when you used a slash in the name of a tag group.
---
.werks/57 | 13 +++++++++++++
ChangeLog | 3 +++
web/htdocs/wato.py | 2 +-
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/.werks/57 b/.werks/57
new file mode 100644
index 0000000..c09024b
--- /dev/null
+++ b/.werks/57
@@ -0,0 +1,13 @@
+Title: Fix exception in WATO host editor on custom tag without topic
+Level: 2
+Component: wato
+Version: 1.2.3i8
+Date: 1386520925
+Class: fix
+
+When you've defined a host tag group in WATO that has no topic,
+then the host edit dialog would be interrupted with an exception.
+A simple workaround to this is to alwasy define a topic.
+
+The problem has now been fixed. It had shortly been introduced by fixing a
+problem appearing when you used a slash in the name of a tag group.
diff --git a/ChangeLog b/ChangeLog
index fb37ec6..5a71a95 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,9 @@
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
+ WATO:
+ * 0057 FIX: Fix exception in WATO host editor on custom tag without topic...
+
Reporting & Availability:
* 0018 New option for displaying a legend for the colors used in the timeline...
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 9f8c1dc..b6bdaf8 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -5096,7 +5096,7 @@ def declare_host_tag_attributes():
if len(entry) >= 4:
depends_on_tags = entry[3]
- if topic is None:
+ if not topic:
topic = _('Host tags')
declare_host_attribute(
Module: check_mk
Branch: master
Commit: b12c796a58efa9ddea2d0e6ca90882aeac138037
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b12c796a58efa9…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Dec 6 10:09:07 2013 +0100
Handling messages of special syslog format correctly
The syslog RFCs allow different formats of syslog messages. The
message parsing code in the event console does support several
formats and should be able to deal with all formats allowed by
the specifications. However, one format was not supported in
past versions. Those messages were simply dropped and only seen
in the logs of the event console, when rule execution debugging
is enabled.
These log entries look as follows:
<tt><5>SYSTEM_INFO: [WLAN-1] Performing Background Scan : channel 12, active, 28 TU</tt>
The specific part here is the missing date/time and missing hostname
information, which is sent by most syslog clients. The parser has been
changed to be able to parse this format. The event console adds the
current date/time to the event and the IP address of the sending
client as host information.
---
.werks/301 | 24 +++++++++++++++++++
ChangeLog | 3 +++
mkeventd/bin/mkeventd | 62 ++++++++++++++++++++++++++++++++++---------------
3 files changed, 70 insertions(+), 19 deletions(-)
diff --git a/.werks/301 b/.werks/301
new file mode 100644
index 0000000..1b19f1e
--- /dev/null
+++ b/.werks/301
@@ -0,0 +1,24 @@
+Title: Handling messages of special syslog format correctly
+Level: 1
+Component: ec
+Version: 1.2.3i8
+Date: 1386320542
+Class: feature
+
+The syslog RFCs allow different formats of syslog messages. The
+message parsing code in the event console does support several
+formats and should be able to deal with all formats allowed by
+the specifications. However, one format was not supported in
+past versions. Those messages were simply dropped and only seen
+in the logs of the event console, when rule execution debugging
+is enabled.
+
+These log entries look as follows:
+
+<tt><5>SYSTEM_INFO: [WLAN-1] Performing Background Scan : channel 12, active, 28 TU</tt>
+
+The specific part here is the missing date/time and missing hostname
+information, which is sent by most syslog clients. The parser has been
+changed to be able to parse this format. The event console adds the
+current date/time to the event and the IP address of the sending
+client as host information.
diff --git a/ChangeLog b/ChangeLog
index 7ba75cf..fb37ec6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,9 @@
Reporting & Availability:
* 0018 New option for displaying a legend for the colors used in the timeline...
+ Event Console:
+ * 0301 Handling messages of special syslog format correctly...
+
1.2.3i7:
Core & Setup:
diff --git a/mkeventd/bin/mkeventd b/mkeventd/bin/mkeventd
index 6e90fe2..df5aac8 100755
--- a/mkeventd/bin/mkeventd
+++ b/mkeventd/bin/mkeventd
@@ -991,22 +991,23 @@ class EventServer:
# Accept new connection on event unix socket
if self._eventsocket in readable:
- client_socket, addr_info = self._eventsocket.accept()
- client_sockets[client_socket.fileno()] = (client_socket, "")
+ client_socket, address = self._eventsocket.accept()
+ client_sockets[client_socket.fileno()] = (self._eventsocket.accept(), address, "")
# Same for the TCP syslog socket
if self._syslog_tcp and self._syslog_tcp in readable:
- client_socket, addr_info = self._syslog_tcp.accept()
- client_sockets[client_socket.fileno()] = (client_socket, "")
+ client_socket, address = self._syslog_tcp.accept()
+ client_sockets[client_socket.fileno()] = (client_socket, address, "")
# Read data from existing event unix socket connections
- for fd, (cs, previous_data) in client_sockets.items():
+ for fd, (cs, address, previous_data) in client_sockets.items():
if fd in readable:
# Receive next part of data
try:
new_data = cs.recv(4096)
except:
new_data = ""
+ address = None
# Put together with incomplete messages from last time
data = previous_data + new_data
@@ -1018,19 +1019,19 @@ class EventServer:
# Do we have any complete messages?
if '\n' in data:
complete, rest = data.rsplit("\n", 1)
- self.process_raw_lines(complete + "\n")
+ self.process_raw_lines(complete + "\n", address)
else:
rest = data # keep for next time
# Only complete messages
else:
if data:
- self.process_raw_lines(data)
+ self.process_raw_lines(data, address)
rest = ""
# Connection still open?
if new_data:
- client_sockets[fd] = (cs, rest)
+ client_sockets[fd] = (cs, address, rest)
else:
cs.close()
del client_sockets[fd]
@@ -1068,7 +1069,7 @@ class EventServer:
# Read events from builtin syslog server
if self._syslog != None and self._syslog.fileno() in readable:
- self.process_raw_lines(self._syslog.recv(4096))
+ self.process_raw_lines(*self._syslog.recvfrom(4096))
# Read events from builtin snmptrap server
if self._snmptrap != None and self._snmptrap.fileno() in readable:
@@ -1108,7 +1109,7 @@ class EventServer:
g_perfcounters.count_time("processing", elapsed)
# Takes several lines of messages, handles encoding and processes them separated
- def process_raw_lines(self, data):
+ def process_raw_lines(self, data, address = None):
lines = data.splitlines()
for line in lines:
line = line.rstrip()
@@ -1119,7 +1120,7 @@ class EventServer:
line = line.decode("latin-1")
if line:
- self.process_raw_data(self.process_line, line)
+ self.process_raw_data(self.process_line, (line, address))
def do_housekeeping(self):
with lock_eventstatus:
@@ -1450,11 +1451,14 @@ class EventServer:
syslog_facilities[facility], syslog_priorities[priority], count,
(100.0 * count / float(total_count))))
- def process_line(self, line):
+ def process_line(self, (line, address)):
line = line.rstrip()
if g_config["debug_rules"]:
- log(u"Processing message '%s'" % line)
- self.process_event(self.parse_event(line))
+ if address:
+ log(u"Processing message from %r: '%s'" % (address, line))
+ else:
+ log(u"Processing message '%s'" % line)
+ self.process_event(self.parse_event(line, address))
def process_event(self, event):
# Rule optimizer
@@ -1748,7 +1752,7 @@ class EventServer:
return backedhost
- def parse_event(self, line):
+ def parse_event(self, line, address):
event = {}
try:
# Variant 1: plain syslog message without priority/facility:
@@ -1770,7 +1774,15 @@ class EventServer:
# - Leap seconds MUST NOT be used.
# <166>2013-04-05T13:49:31.685Z esx Vpxa: message....
- # Variant 2,3,4,5
+ # Variant 6: syslog message without date / host:
+ # <5>SYSTEM_INFO: [WLAN-1] Triggering Background Scan
+
+ # 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
if line.startswith('<'):
i = line.find('>')
prio = int(line[1:i])
@@ -1796,6 +1808,15 @@ class EventServer:
event['time'] = time.mktime(time.strptime(rfc3339_part[:19], '%Y-%m-%dT%H:%M:%S'))
event.update(self.parse_syslog_info(line))
+ # Variant 6
+ elif len(line.split(': ', 1)[0].split(' ')) == 1:
+ event.update(self.parse_syslog_info(line))
+ # There is no datetime information in the message, use current time
+ event['time'] = time.time()
+ # There is no host information, use the provided address
+ if address and type(address) == tuple:
+ event["host"] = address[0]
+
# Variant 1,2,4
else:
month_name, day, timeofday, host, rest = line.split(None, 4)
@@ -1825,8 +1846,6 @@ class EventServer:
# A further problem here: we do not now wether the message is in DST or not
event["time"] = time.mktime((year, month, day, hours, minutes, seconds, 0, 0, lt.tm_isdst))
-
-
except Exception, e:
if g_config["debug_rules"]:
log('Got non-syslog message "%s" (%s)' % (line, e) )
@@ -1840,7 +1859,12 @@ class EventServer:
"time" : time.time(),
}
- event["host"] = self.translate_hostname(event["host"])
+ try:
+ event["host"] = self.translate_hostname(event["host"])
+ except Exception, e:
+ if g_config["debug_rules"]:
+ log('Unable to parse host "%s" (%s)' % (event.get("host"), e))
+ event["host"] = ""
if g_config["debug_rules"]:
log('Parsed message:\n' +
Module: check_mk
Branch: master
Commit: 2df9e4ed4b221d1743d05a2cc048d33231438133
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2df9e4ed4b221d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Dec 5 17:10:43 2013 +0100
FIX cisco_fru_power: Trying not to inventorize not plugged in FRUs
In the previous version, the check did inventorize all FRUs reported
by the device. The devices also send information for slots which have
no FRU plugged in. This change tries to ignore all not plugged in slots.
---
.werks/300 | 10 ++++++++++
ChangeLog | 1 +
checks/cisco_fru_power | 4 +++-
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/.werks/300 b/.werks/300
new file mode 100644
index 0000000..fb2c8ec
--- /dev/null
+++ b/.werks/300
@@ -0,0 +1,10 @@
+Title: cisco_fru_power: Trying not to inventorize not plugged in FRUs
+Level: 1
+Component: checks
+Version: 1.2.3i8
+Date: 1386259723
+Class: fix
+
+In the previous version, the check did inventorize all FRUs reported
+by the device. The devices also send information for slots which have
+no FRU plugged in. This change tries to ignore all not plugged in slots.
diff --git a/ChangeLog b/ChangeLog
index 36bb941..26ebb28 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
1.2.3i8:
Checks & Agents:
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
+ * 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
1.2.3i7:
diff --git a/checks/cisco_fru_power b/checks/cisco_fru_power
index b2e50b6..2f57a24 100644
--- a/checks/cisco_fru_power
+++ b/checks/cisco_fru_power
@@ -31,6 +31,8 @@
# .1.3.6.1.4.1.9.9.13.1.5.1.4.1 1
# .1.3.6.1.4.1.9.9.13.1.5.1.4.2 2
+# FRU = Field Replacable Unit
+
# OID 1.3.6.1.4.1.9.9.117.1.1.2.1.2
# Type PowerOperType
# 1:offEnvOther
@@ -63,7 +65,7 @@ power_oper_type = ('', 'offEnvOther', 'on', 'offAdmin', 'offDenied',
power_admin_type = ( '', 'on', 'off', 'inlineAuto', 'inlineOn', 'powercycle')
def inventory_cisco_fru_power(info):
- return [ (line[0], None ) for line in info ]
+ return [ (line[0], None ) for line in info if saveint(line[2]) != 1 ]
def check_cisco_fru_power(item, params, info):
for line in info:
Module: check_mk
Branch: master
Commit: 35e34b51d225a497224b8d5793958ec58184d2ce
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=35e34b51d225a4…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Thu Dec 5 15:21:37 2013 +0100
FIX services: Fixed bug with service inventory defined in main.mk
There was an error message while inventory when using main.mk based config.
---
.werks/103 | 8 ++++++++
ChangeLog | 3 +++
2 files changed, 11 insertions(+)
diff --git a/.werks/103 b/.werks/103
new file mode 100644
index 0000000..d7d15c1
--- /dev/null
+++ b/.werks/103
@@ -0,0 +1,8 @@
+Title: services: Fixed bug with service inventory defined in main.mk
+Level: 1
+Component: checks
+Version: 1.2.3i8
+Date: 1386253170
+Class: fix
+
+There was an error message while inventory when using main.mk based config.
diff --git a/ChangeLog b/ChangeLog
index 1e40047..460e80d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
1.2.3i8:
+ Checks & Agents:
+ * 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
+
Reporting & Availability:
* 0018 New option for displaying a legend for the colors used in the timeline...