Module: check_mk
Branch: master
Commit: 92eaa76066f0ba1122cb72f4f1f783d8c0439378
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=92eaa76066f0ba…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Wed Jan 21 14:31:14 2015 +0100
#1855 esx_systeminfo: new inventory check to retrieve info about the host operating system for ESX servers
---
.werks/1855 | 9 ++++++++
ChangeLog | 3 ++-
inventory/esx_systeminfo | 57 ++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 68 insertions(+), 1 deletion(-)
diff --git a/.werks/1855 b/.werks/1855
new file mode 100644
index 0000000..b633755
--- /dev/null
+++ b/.werks/1855
@@ -0,0 +1,9 @@
+Title: esx_systeminfo: new inventory check to retrieve info about the host operating system for ESX servers
+Level: 1
+Component: inv
+Compatible: compat
+Version: 1.2.7i1
+Date: 1421846988
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 3328700..58b428d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -48,8 +48,8 @@
NOTE: Please refer to the migration notes!
* 1525 viprinet_temp: Now uses new Temperature WATO rule...
NOTE: Please refer to the migration notes!
- * 1854 netscaler_tcp_conns: new check to monitor tcp connections on Citrix Netscaler Loadbalancer Appliances
* 1673 netapp_volumes: now able to configure levels by magic factor
+ * 1854 netscaler_tcp_conns: new check to monitor tcp connections on Citrix Netscaler Loadbalancer Appliances
* 1457 FIX: logins: new check renamed from "users" check...
NOTE: Please refer to the migration notes!
* 1762 FIX: lnx_thermal: Now ignoring trip points with level 0...
@@ -160,6 +160,7 @@
HW/SW-Inventory:
* 1846 Keep track of changes of software and hardware...
+ * 1855 esx_systeminfo: new inventory check to retrieve info about the host operating system for ESX servers
* 1851 FIX: win_exefiles: inventory check can now handle time stamps in us english locale
diff --git a/inventory/esx_systeminfo b/inventory/esx_systeminfo
new file mode 100644
index 0000000..79b66f4
--- /dev/null
+++ b/inventory/esx_systeminfo
@@ -0,0 +1,57 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+# Example output:
+# <<<esx_systeminfo>>>
+# vendor VMware, Inc.
+# name VMware ESXi
+# propertyCollector ha-property-collector
+# apiVersion 5.0
+# sessionManager ha-sessionmgr
+# osType vmnix-x86
+# version 5.0.0
+# build 914586
+# licenseManager ha-license-manager
+# perfManager ha-perfmgr
+# rootFolder ha-folder-root
+
+
+def inv_esx_systeminfo(info):
+ node = inv_tree("software.os.")
+ for line in info:
+ if line[0] == 'vendor':
+ node["vendor"] = " ".join(line[1:])
+ elif line[0] == 'name':
+ node["name"] = " ".join(line[1:])
+ elif line[0] == 'version':
+ node["version"] = " ".join(line[1:])
+ elif line[0] == 'osType':
+ node["type"] = " ".join(line[1:])
+ node["arch"] = "x86_64"
+
+inv_info['esx_systeminfo'] = {
+ "inv_function" : inv_esx_systeminfo,
+}
Module: check_mk
Branch: master
Commit: 664fb96b94e323e98995f2b8e5a55bde483d01ee
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=664fb96b94e323…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Jan 21 12:20:35 2015 +0100
fixed werk description
---
.werks/1672 | 2 +-
ChangeLog | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.werks/1672 b/.werks/1672
index 8459260..f4d18b0 100644
--- a/.werks/1672
+++ b/.werks/1672
@@ -1,4 +1,4 @@
-Title: Now able reclassify logwatch messages before forwarding them to the event console
+Title: Now able to reclassify logwatch messages before forwarding them to the event console
Level: 2
Component: ec
Compatible: compat
diff --git a/ChangeLog b/ChangeLog
index 84f5647..2b33758 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -152,7 +152,7 @@
Event Console:
* 1845 Keep record of original source IP address of a syslog message or SNMP trap...
* 1873 SEC: Escaping event text of event console messages correctly in views...
- * 1672 Now able reclassify logwatch messages before forwarding them to the event console...
+ * 1672 Now able to reclassify logwatch messages before forwarding them to the event console...
* 1839 FIX: Fix exception when notifying EC alert into monitoring for traps (because PID is missing)
* 1813 FIX: Fixed bug in event console rule editor when no contact groups configured
Module: check_mk
Branch: master
Commit: a9e2e60ed304083416a5b3350c6b5cda903c6622
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a9e2e60ed30408…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Jan 21 12:18:47 2015 +0100
#1672 Now able reclassify logwatch messages before forwarding them to the event console
You are now able to apply already existing logwatch patterns to the messages which
are sent to the event console. Each message can be reclassified to a different alert level
and even set to IGNORED, which causes a message not to be sent to the event console.
This pre-sorting might reduce the load of the event console.
Keep in mind that the logwatch pattern are configured by host and the logfile name.
These restrictions do also apply to the messages intented for the event console.
So you can configure a logwatch pattern specifially designed for a message from a certain logfile.
For example, you can reclassify any messages from a logfile <i>access.log</i> containing "C Login error" to
"I Login error". Any message of <i>access.log</i> containing the "Login error" pattern will therefore get ignored and
not sent to the event console.
---
.werks/1672 | 20 +++++++++++++
ChangeLog | 1 +
checks/logwatch | 51 ++++++++++++++++++++++++++++++++++
web/plugins/wato/check_parameters.py | 15 +++++++++-
4 files changed, 86 insertions(+), 1 deletion(-)
diff --git a/.werks/1672 b/.werks/1672
new file mode 100644
index 0000000..8459260
--- /dev/null
+++ b/.werks/1672
@@ -0,0 +1,20 @@
+Title: Now able reclassify logwatch messages before forwarding them to the event console
+Level: 2
+Component: ec
+Compatible: compat
+Version: 1.2.7i1
+Date: 1421838593
+Class: feature
+
+You are now able to apply already existing logwatch patterns to the messages which
+are sent to the event console. Each message can be reclassified to a different alert level
+and even set to IGNORED, which causes a message not to be sent to the event console.
+This pre-sorting might reduce the load of the event console.
+
+Keep in mind that the logwatch pattern are configured by host and the logfile name.
+These restrictions do also apply to the messages intented for the event console.
+So you can configure a logwatch pattern specifially designed for a message from a certain logfile.
+
+For example, you can reclassify any messages from a logfile <i>access.log</i> containing "C Login error" to
+"I Login error". Any message of <i>access.log</i> containing the "Login error" pattern will therefore get ignored and
+not sent to the event console.
diff --git a/ChangeLog b/ChangeLog
index f6f89bc..84f5647 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -152,6 +152,7 @@
Event Console:
* 1845 Keep record of original source IP address of a syslog message or SNMP trap...
* 1873 SEC: Escaping event text of event console messages correctly in views...
+ * 1672 Now able reclassify logwatch messages before forwarding them to the event console...
* 1839 FIX: Fix exception when notifying EC alert into monitoring for traps (because PID is missing)
* 1813 FIX: Fixed bug in event console rule editor when no contact groups configured
diff --git a/checks/logwatch b/checks/logwatch
index d4554f9..d24596d 100644
--- a/checks/logwatch
+++ b/checks/logwatch
@@ -584,8 +584,30 @@ def check_logwatch_ec(item, params, info):
messages = []
cur_time = syslog_time()
forwarded_logfiles = set([])
+
+ # Get the logwatch patterns if they are not already precompiled
+ if "logwatch_patterns" not in params:
+ logwatch_ec_precompile(g_hostname, None, params)
+
for logfile, lines in logs.items():
+ # Determine logwatch patterns specifically for this logfile
+ log_reclassify_patterns = []
+ for entry in params["logwatch_patterns"]:
+ patterns, log_items = entry
+ for log_item in log_items:
+ reg = regex(log_item)
+ if reg.search(logfile):
+ log_reclassify_patterns.extend(patterns)
+
for line in lines:
+ if log_reclassify_patterns:
+ counts = {} # unused...
+ level, text = line.split(" ", 1)
+ level = logwatch_reclassify(counts, log_reclassify_patterns, line[2:]) or level
+ if level == "I": # Ignored lines are not forwarded
+ continue
+
+
msg = '<%d>' % (facility + logwatch_to_prio(line[0]),)
msg += '%s %s %s: %s' % (cur_time, g_hostname, logfile, line[2:])
messages.append(msg)
@@ -650,6 +672,35 @@ def check_logwatch_ec(item, params, info):
return (2, 'Unable to forward messages to event console (%s). Lost %d messages.' %
(e, num_messages))
+def logwatch_ec_precompile(hostname, item, params):
+ if not params.get("logwatch_reclassify"):
+ params.update({"logwatch_patterns": []})
+ return params
+
+ if not serviceruleset_is_converted(logwatch_rules):
+ convert_service_ruleset(logwatch_rules)
+
+ tags = tags_of_host(hostname)
+ logwatch_patterns = []
+ # Filter out any logwatch_rules which do apply to to this host
+ # 1st filter: Do not use rules where the hostname does not match
+ # 2nd filter: Do not use rules with configured items where no item matches the
+ # "restrict_logfiles" condition (if applicable)
+ for rule in logwatch_rules:
+ patterns, hosts, rule_items = rule
+ if hostname in hosts:
+ if params.get("restrict_logfiles"):
+ for rule_item in rule_items:
+ if rule_item == "" or logwatch_ec_forwarding_enabled(params, rule_item):
+ logwatch_patterns.append( (map(lambda x: x[:2], patterns), rule_items) )
+ break
+ else:
+ logwatch_patterns.append( (map(lambda x: x[:2], patterns), rule_items) )
+ params.update({"logwatch_patterns": logwatch_patterns})
+ return params
+
+precompile_params['logwatch.ec'] = logwatch_ec_precompile
+
check_info['logwatch.ec'] = {
'check_function': check_logwatch_ec,
'inventory_function': inventory_logwatch_ec,
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index d65b304..d06f302 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -6503,8 +6503,21 @@ register_check_parameters(subgroup_applications,
"all of the logfiles listed here are reported by the monitored system."),
)
),
+ ('logwatch_reclassify',
+ Checkbox(
+ title = _("Reclassify messages before forwarding them to the EC"),
+ label = _("Apply logwatch patterns"),
+ help = _("If this option is enabled, the logwatch lines are first reclassified by the logwatch "
+ "patterns before they are sent to the event console. If you reclassify specific lines to "
+ "IGNORE they are not forwarded to the event console. This takes the burden from the "
+ "event console to process the message itself through all of its rulesets. The reclassifcation "
+ "of each line takes into account from which logfile the message originates. So you can create "
+ "logwatch reclassification rules specifically designed for a logfile <i>access.log</i>, "
+ "which do not apply to other logfiles."),
+ )
+ )
],
- optional_keys = ['restrict_logfiles', 'expected_logfiles'],
+ optional_keys = ['restrict_logfiles', 'expected_logfiles', 'logwatch_reclassify'],
),
],
default_value = '',
Module: check_mk
Branch: master
Commit: 24f0e93a3312c9bb2b432b76f20a67b1983bd082
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=24f0e93a3312c9…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Wed Jan 21 11:01:40 2015 +0100
WATO Multipatch Rules: Names of all Multipath Rules have been consolidated
---
web/plugins/wato/check_parameters.py | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 8ae9352..d65b304 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -4791,8 +4791,10 @@ register_check_parameters(
register_check_parameters(
subgroup_storage,
"multipath",
- _("Multipathing - health of a multipath LUN"),
+ _("Linux and Solaris Multipath Count"),
Integer(
+ help = _("This rules sets the expected number of active paths for a multipath LUN "
+ "on Linux and Solaris hosts"),
title = _("Expected number of active paths")),
TextAscii(
title = _("Name of the MP LUN"),
@@ -4811,12 +4813,13 @@ register_rule(
("use_alias", Checkbox(
title = _("Use the multipath alias as service name, if one is set"),
label = _("use alias"),
- help = _("If a multipath device has an alias then you can use that for specifying "
+ help = _("If a multipath device has an alias then you can use it for specifying "
"the device instead of the UUID. The alias will then be part of the service "
"description. The UUID will be output in the pluging outpout."))
),
],
- help = _('This rule controls the inventory of Multipath devices on Linux.'),
+ help = _("This rule controls if the UUID or alias is used in the service description during "
+ "inventory of Multipath devices on Linux."),
),
match = 'dict',
)
@@ -4824,8 +4827,10 @@ register_rule(
register_check_parameters(
subgroup_storage,
"multipath_count",
- _("Multipath Count"),
+ _("ESX Multipath Count"),
Alternative(
+ help = _("This rules sets the expected number of active paths for a multipath LUN "
+ "on ESX servers"),
title = _("Match type"),
elements = [
FixedValue(
@@ -4869,9 +4874,11 @@ register_check_parameters(
register_check_parameters(
subgroup_storage,
"hpux_multipath",
- _("Multipathing on HPUX - state of paths of a LUN"),
+ _("HPUX Multipath Count"),
Tuple(
title = _("Expected path situation"),
+ help = _("This rules sets the expected number of various paths for a multipath LUN "
+ "on HPUX servers"),
elements = [
Integer(title = _("Number of active paths")),
Integer(title = _("Number of standby paths")),