Module: check_mk
Branch: master
Commit: e3e6ec1700f90d9b0777de2e5f6c56976e2db756
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e3e6ec1700f90d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Apr 8 09:36:23 2013 +0200
FIX: Syslog server is now able to parse RFC 5424 syslog messages
---
ChangeLog | 4 ++-
mkeventd/bin/mkeventd | 57 +++++++++++++++++++++++++++++++++---------------
2 files changed, 42 insertions(+), 19 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 75cbff4..c5c5e3e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -94,7 +94,6 @@
Checks & Agents:
* FIX: blade_bx_load: remove invalid WATO group
-
Notifications:
* FIX: Removing GRAPH_CODE in html mails when not available
* Using plugin argument 1 for path to pnp4nagios index php to render graphs
@@ -107,6 +106,9 @@
* FIX: Fix several cases where WATO rule analyser did not hilite all matching rules
* Added tcp port parameter to SSL certificate check (Thanks to Marcel Schulte)
+ Event Console:
+ * FIX: Syslog server is now able to parse RFC 5424 syslog messages
+
1.2.2b7:
Checks & Agents:
* FIX: postfix_mailq: fix labels in WATO rule, set correct default levels
diff --git a/mkeventd/bin/mkeventd b/mkeventd/bin/mkeventd
index 5f6b6e8..5e3049c 100755
--- a/mkeventd/bin/mkeventd
+++ b/mkeventd/bin/mkeventd
@@ -1432,6 +1432,25 @@ class EventServer:
if "set_contact" in rule and "contact" not in event:
event["contact"] = replace_groups(rule["set_contact"], event.get("contact", ""), groups)
+ def parse_syslog_info(self, line):
+ event = {}
+ # Replaced ":" by ": " here to make tags with ":" possible. This
+ # is needed to process logs generated by windows agent logfiles
+ # like "c://test.log".
+ tag, message = line.split(": ", 1)
+ event["text"] = message.strip()
+
+ if '[' in tag:
+ app, pid = tag.split('[', 1)
+ pid = pid.rstrip(']')
+ else:
+ app = tag
+ pid = 0
+
+ event["application"] = app
+ event["pid"] = pid
+ return event
+
def parse_monitoring_info(self, line):
event = {}
# line starts with '@'
@@ -1460,7 +1479,7 @@ class EventServer:
# Variant 1: plain syslog message without priority/facility:
# May 26 13:45:01 Klapprechner CRON[8046]: message....
- # Variant 2: syslog message including facility (RFC 3360)
+ # Variant 2: syslog message including facility (RFC 3164)
# <78>May 26 13:45:01 Klapprechner CRON[8046]: message....
# Variant 3: local Nagios alert posted by mkevent -n
@@ -1469,7 +1488,14 @@ class EventServer:
# Variant 4: remote Nagios alert posted by mkevent -n -> syslog
# <154>Jul 9 17:28:32 Klapprechner @1341847712;5;Contact Info; MyHost My Service: CRIT - This che
- # Variant 2,3,4
+ # Variant 5: syslog message (RFC 5424)
+ # Timestamp is RFC3339 with additional restrictions:
+ # - The "T" and "Z" characters in this syntax MUST be upper case.
+ # - Usage of the "T" character is REQUIRED.
+ # - Leap seconds MUST NOT be used.
+ # <166>2013-04-05T13:49:31.685Z esx Vpxa: message....
+
+ # Variant 2,3,4,5
if line.startswith('<'):
i = line.find('>')
prio = int(line[1:i])
@@ -1486,6 +1512,15 @@ class EventServer:
if line.startswith("@"):
event.update(self.parse_monitoring_info(line))
+ # Variant 5
+ elif len(line) > 24 and line[10] == 'T':
+ # There is no 3339 parsing built into python. We do ignore subseconds and timezones
+ # here. This is seems to be ok for the moment - sorry. Please drop a note if you
+ # got a good solutuion for this.
+ rfc3339_part, event['host'], line = line.split(' ', 2)
+ event['time'] = time.mktime(time.strptime(rfc3339_part[:19], '%Y-%m-%dT%H:%M:%S'))
+ event.update(self.parse_syslog_info(line))
+
# Variant 1,2,4
else:
month_name, day, timeofday, host, rest = line.split(None, 4)
@@ -1497,25 +1532,11 @@ class EventServer:
# Variant 1, 2
else:
- # Replaced ":" by ": " here to make tags with ":" possible. This
- # is needed to process logs generated by windows agent logfiles
- # like "c://test.log".
- tag, message = rest.split(": ", 1)
- event["text"] = message.strip()
-
- if '[' in tag:
- app, pid = tag.split('[', 1)
- pid = pid.rstrip(']')
- else:
- app = tag
- pid = 0
-
- event["application"] = app
- event["pid"] = pid
+ event.update(self.parse_syslog_info(rest))
month = EventServer.month_names[month_name]
day = int(day)
-
+
# Nasty: the year is not contained in the message. We cannot simply
# assume that the message if from the current year.
lt = time.localtime()
Module: check_mk
Branch: master
Commit: 75631cfffb400e0582bc1c09c369cce47180ea04
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=75631cfffb400e…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Apr 7 18:27:48 2013 +0200
ipmi: remove obsolete exception handler
---
checks/ipmi | 56 +++++++++++++++++++++++++++-----------------------------
1 files changed, 27 insertions(+), 29 deletions(-)
diff --git a/checks/ipmi b/checks/ipmi
index 9282fd9..6814ba5 100644
--- a/checks/ipmi
+++ b/checks/ipmi
@@ -143,36 +143,34 @@ def check_ipmi_summarized(info):
count = 0
ambient_count = 0
ambient_sum = 0.0
- try:
- for name, val, unit, status, unrec_low, crit_low, \
- warn_low, warn_high, crit_high, unrec_high in info:
- # Skip datasets which have no valid data (zero value, no unit and state nc)
- if val == '0.000' and unit == 'unspecified' and status == 'nc':
- continue
-
- if ipmi_ignore_entry(name, status):
- continue
-
- text = "%s is %s" % (name, val)
- if unit != 'unspecified':
- text += ' %s' % unit
- count += 1
- if status == 'nc':
- worst_status = max(worst_status, 1)
- warn_texts.append(text)
- elif status == 'nr' and ipmi_ignore_nr:
+
+ for name, val, unit, status, unrec_low, crit_low, \
+ warn_low, warn_high, crit_high, unrec_high in info:
+ # Skip datasets which have no valid data (zero value, no unit and state nc)
+ if val == '0.000' and unit == 'unspecified' and status == 'nc':
+ continue
+
+ if ipmi_ignore_entry(name, status):
+ continue
+
+ text = "%s is %s" % (name, val)
+ if unit != 'unspecified':
+ text += ' %s' % unit
+ count += 1
+ if status == 'nc':
+ worst_status = max(worst_status, 1)
+ warn_texts.append(text)
+ elif status == 'nr' and ipmi_ignore_nr:
+ pass
+ elif status != 'ok':
+ worst_status = 2
+ crit_texts.append(text)
+ if "amb" in name or "Ambient" in name:
+ try:
+ ambient_count += 1
+ ambient_sum += float(val)
+ except:
pass
- elif status != 'ok':
- worst_status = 2
- crit_texts.append(text)
- if "amb" in name or "Ambient" in name:
- try:
- ambient_count += 1
- ambient_sum += float(val)
- except:
- pass
- except:
- return (3, "invalid or incomplete output from agent")
if ambient_count > 0:
Module: check_mk
Branch: master
Commit: 66b963357b145694ce67ce411347cd9377322f08
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=66b963357b1456…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Apr 7 12:55:50 2013 +0200
Fixed typo in man page
---
checkman/hp_eml_sum | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/checkman/hp_eml_sum b/checkman/hp_eml_sum
index b37ae31..978d5b1 100644
--- a/checkman/hp_eml_sum
+++ b/checkman/hp_eml_sum
@@ -9,4 +9,4 @@ description:
work with other models. It uses information provided by the SEMI-MIB.
inventory:
- The check supports automatic inventory. Each system gets one summary checks.
+ The check supports automatic inventory. Each system gets one summary check.