Module: check_mk
Branch: master
Commit: 53b91be06265157ebc9f4681e312cc52860c9dd3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=53b91be0626515…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Sep 16 16:39:54 2016 +0200
3861 Introduced open event limit mechanism for protecting against message storms
The Event Console has been extended to be able to protect agains message storms which can
either result in too high load and also in out of memory situations.
Because there can be multiple kind of message storms like one device which sends a lot of messages
or many different devices sending equal messages, we introduced different limits to match them.
There are the following limits:
<ul>
<li>Limit by host: You can limit the number of open events created by a single host . This is meant to
prevent you from message storms created by one device. Once the limit is reached, the Event Console
will block all future incoming messages sent by this host until the number of open events has been
reduced to be below this limit. In the moment the limit is reached, the Event Console will notify
the configured contacts of the host.</li>
<li>Limit by rule: You can limit the number of open events created by a single rule here. This is meant to
prevent you from too generous rules creating a lot of events. Once the limit is reached, the Event Console will stop the rule
creating new open events until the number of open events has been reduced to be below this limit. In the
moment the limit is reached, the Event Console will notify the configured contacts of the rule or create a notification
with empty contact information.</li>
<li>Overall limit: To protect you against a continously growing list of open events created by
different hosts or rules, you can configure this overall limit of open events. All currently open
events are counted and once the limit is reached, no further events will be opened which means that
new incoming messages will be dropped. In the moment the limit is reached, the Event Console will
create a notification with empty contact information.
</li>
</ul>
Each of those limits can be configured to different values. By default the limit is set to
1000 for the host and rule based limit and 10000 for the overall limit. Please check carefully
whether or not these defaults are OK for you. But they should be way enough for most environments
since you really should never have so many open events in the Event Console open.
But if you need to change those limits, you can change them in the global settings of the Event
Console to fit your needs.
Additionally, you can configure the actions the Event Console should perform once the limit is
reached instead of the overflow event and notification creation as described above. Another action
is for example delete the oldest event (of a host, rule or overall).
---
.werks/3861 | 48 ++++
ChangeLog | 1 +
agents/check_mk_agent.linux | 12 +-
bin/mkeventd | 431 ++++++++++++++++++++++++++----
checkman/mkeventd_status | 15 ++
checks/mkeventd_status | 146 ++++++++++
lib/defines.py | 5 +
livestatus/src/TableEventConsoleStatus.cc | 60 ++++-
tests/mkeventd/test_mkeventd_status.py | 82 ++++++
tests/testlib/__init__.py | 117 ++++++++
web/htdocs/valuespec.py | 1 +
web/plugins/metrics/check_mk.py | 80 ++++++
web/plugins/wato/mkeventd.py | 92 +++++++
13 files changed, 1028 insertions(+), 62 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=53b91be062…
Module: check_mk
Branch: master
Commit: d8afdf11fba39bffd21d2e652908ee1be67e1a0b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d8afdf11fba39b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Sep 16 17:38:01 2016 +0200
livestatus_status: refactored parse function
---
checks/livestatus_status | 27 +++++++++++++--------------
1 file changed, 13 insertions(+), 14 deletions(-)
diff --git a/checks/livestatus_status b/checks/livestatus_status
index 8d50d4c..48ebf63 100644
--- a/checks/livestatus_status
+++ b/checks/livestatus_status
@@ -49,19 +49,19 @@ factory_settings["livestatus_status_default_levels"] = {
def parse_livestatus_status(info):
parsed = {}
- n = 0
- while n < len(info):
- site = info[n][0][1:-1]
- if n == len(info) - 1 or info[n+1][0].startswith('['):
- # Handle the case if the check running in cluster
- if site not in parsed.keys():
- parsed[site] = None # Site is down
- n += 1
- else:
- headers = info[n+1]
- values = info[n+2]
- parsed[site] = dict(zip(headers, values))
- n += 3
+ site, headers = None, None
+ for line in info:
+ if line and line[0][0] == "[" and line[0][-1] == "]":
+ site = line[0][1:-1]
+ parsed[site] = None # Site is marked as down until overwritten later
+
+ elif site:
+ if headers == None:
+ headers = line
+ else:
+ parsed[site] = dict(zip(headers, line))
+ headers = None
+
return parsed
@@ -69,7 +69,6 @@ def inventory_livestatus_status(parsed):
return [ (site, {}) for (site, status) in parsed.items() if status != None ]
-
def check_livestatus_status(item, params, parsed):
if item not in parsed:
return
Module: check_mk
Branch: master
Commit: a11b8970e9f7b994857ff55cd637053f8518484e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a11b8970e9f7b9…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Fri Sep 16 14:23:36 2016 +0200
3839 filehandler: added new plugin for monitoring file handles in linux
This new plugin reads file handles provided by /proc/sys/fs/file-nr and
puts them in relation of each other.
Thresholds of this check can be configured. Defaults are on 80/90%.
---
.werks/3839 | 11 ++++++
ChangeLog | 1 +
agents/plugins/mk_filehandler | 33 +++++++++++++++++
checkman/filehandler | 16 +++++++++
checks/filehandler | 70 ++++++++++++++++++++++++++++++++++++
web/plugins/metrics/check_mk.py | 10 ++++++
web/plugins/wato/check_parameters.py | 20 +++++++++++
7 files changed, 161 insertions(+)
diff --git a/.werks/3839 b/.werks/3839
new file mode 100644
index 0000000..b5a6d24
--- /dev/null
+++ b/.werks/3839
@@ -0,0 +1,11 @@
+Title: filehandler: added new plugin for monitoring file handles in linux
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i1
+Date: 1474028116
+Class: feature
+
+This new plugin reads file handles provided by /proc/sys/fs/file-nr and
+puts them in relation of each other.
+Thresholds of this check can be configured. Defaults are on 80/90%.
diff --git a/ChangeLog b/ChangeLog
index 910e8e1..a36def0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -164,6 +164,7 @@
* 3803 netapp_api_connection: reports any errors happened during the collection of data...
* 3859 check_mail_loop.vbs: New MRPE script to perform a mail loop check via Outlook MAPI...
* 3838 hitachi_hus_dku & hitachi_hus_dkc: more detailed output even if everything is in state OK...
+ * 3839 filehandler: added new plugin for monitoring file handles in linux...
* 3073 FIX: windows agent: relative paths to mrpe scripts are now treated as relative to the agent installation directory...
* 3061 FIX: mk_jolokia: Fixed debugging of the agent plugin
* 3074 FIX: windows agent: fixed incorrect values for 32-bit performance counters
diff --git a/agents/plugins/mk_filehandler b/agents/plugins/mk_filehandler
new file mode 100755
index 0000000..64668e7
--- /dev/null
+++ b/agents/plugins/mk_filehandler
@@ -0,0 +1,33 @@
+#!/bin/bash
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2014 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-
+# tails. 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.
+
+FILE=/proc/sys/fs/file-nr
+
+echo '<<<filehandler>>>'
+if [ -a $FILE ]; then
+ cat $FILE
+fi
+
diff --git a/checkman/filehandler b/checkman/filehandler
new file mode 100644
index 0000000..1f50c79
--- /dev/null
+++ b/checkman/filehandler
@@ -0,0 +1,16 @@
+title: Total and used filehandles on system
+agents: linux
+catalog: os/kernel
+license: GPL
+distribution: check_mk
+description:
+ This check measures the current used fileshandles and sets it
+ in relation to the maximum.
+
+ Upper default levels are set to 80, 90 %. These levels are configurable.
+
+perfdata:
+ The percentage of used filehandles.
+
+inventory:
+ One service is created.
diff --git a/checks/filehandler b/checks/filehandler
new file mode 100644
index 0000000..c3c2f1a
--- /dev/null
+++ b/checks/filehandler
@@ -0,0 +1,70 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2014 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-
+# tails. 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.
+
+
+# Measures total allocated file handles.
+# The output displays
+# - the number of allocated file handles
+# - the number of allocatedly used file handles (with the 2.4 kernel); or
+# the number of allocatedly unused file handles (with the 2.6 kernel)
+# - the maximum files handles that can be allocated
+# (can also be found in /proc/sys/fs/file-max)
+# Example output of '/proc/sys/fs/file-nr':
+# <<<filehandler>>>
+# 9376 0 817805
+
+
+factory_settings['filehandler_default_levels'] = {
+ 'levels': (80.0, 90.0)
+}
+
+def inventory_filehandler(info):
+ return [ ( None, {} ) ]
+
+def check_filehandler(_no_item, params, info):
+ allocated, used_or_unused, maximum = info[0]
+ state = 0
+ perc = float(allocated) / float(maximum) * 100.0
+ infotext = '%.1f%% used (%s of %s file handles)' % (perc, allocated, maximum)
+ warn, crit = params['levels']
+
+ if perc >= crit:
+ state = 2
+ elif perc >= warn:
+ state = 1
+ if state > 0:
+ infotext += ' (warn/crit at %.1f%%/%.1f%%)' % (warn, crit)
+
+ return state, infotext, [ ( 'filehandler_perc', perc, warn, crit ) ]
+
+check_info['filehandler'] = {
+ 'check_function' : check_filehandler,
+ 'inventory_function' : inventory_filehandler,
+ 'service_description' : 'Filehandler',
+ 'has_perfdata' : True,
+ 'default_levels_variable' : 'filehandler_default_levels',
+ 'group' : 'filehandler',
+}
diff --git a/web/plugins/metrics/check_mk.py b/web/plugins/metrics/check_mk.py
index 51739e4..ca69bf9 100644
--- a/web/plugins/metrics/check_mk.py
+++ b/web/plugins/metrics/check_mk.py
@@ -3630,6 +3630,11 @@ metric_info["dns_nxdomain"] = {
"color" : "34/a",
}
+metric_info["filehandler_perc"] = {
+ "title" : _("Used file handles"),
+ "unit" : "%",
+ "color" : "#4800ff",
+}
#.
# .--Checks--------------------------------------------------------------.
@@ -5572,6 +5577,11 @@ perfometer_info.append({
# all segments
})
+perfometer_info.append({
+ "type" : "linear",
+ "segments" : [ "filehandler_perc" ],
+ "total" : 100.0,
+})
#.
# .--Graphs--------------------------------------------------------------.
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index a4cd01f..d75cc39 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -2740,6 +2740,26 @@ register_check_parameters(
match_type = "dict",
)
+register_check_parameters(
+ subgroup_storage,
+ "filehandler",
+ _("Filehandler"),
+ Dictionary(
+ elements = [
+ ( "levels", Tuple(
+ title = _("Levels"),
+ default_value = (80.0, 90.0),
+ elements = [
+ Percentage(title = _("Warning at"), unit = _("%")),
+ Percentage(title = _("Critical at"), unit = _("%"))
+ ]
+ ),
+ ),
+ ]
+ ),
+ None,
+ match_type = "dict"
+)
#.
# .--Unsorted--(Don't create new stuff here!)----------------------------.
Module: check_mk
Branch: master
Commit: d5741193af117c583a2f6878fa0e54c6d8c9fd43
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d5741193af117c…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Fri Sep 16 14:01:52 2016 +0200
3838 hitachi_hus_dku & hitachi_hus_dkc: more detailed output even if everything is in state OK
The outputs of these Checks are more verbose even if there is no failure
of one or more components. So now it is always transparent which components
are checked an in which state they are.
---
.werks/3838 | 11 +++++
ChangeLog | 1 +
checkman/hitachi_hus_dkc | 6 +--
checkman/hitachi_hus_dku | 9 ++--
checks/hitachi_hus.include | 116 +++++++++++++++++++++++++++++++++++++++++++++
checks/hitachi_hus_dkc | 50 ++-----------------
checks/hitachi_hus_dku | 47 ++----------------
7 files changed, 143 insertions(+), 97 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=d5741193af…