Module: check_mk
Branch: master
Commit: bbdeba4940607bea9bebeb3338d283e5651a5fe5
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bbdeba4940607b…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Mon Nov 2 14:44:34 2015 +0100
#2707 winperf_processor: can now be configured to warn if a single cpu core exceeds a utilization threshold for a while
This is the same feature as werk #2529, now for windows hosts.
---
.werks/2707 | 9 ++++++
ChangeLog | 1 +
agents/windows/build_version | 2 +-
agents/windows/check_mk_agent-64.exe | Bin 829952 -> 830464 bytes
agents/windows/check_mk_agent-64.unversioned.exe | Bin 829952 -> 830464 bytes
agents/windows/check_mk_agent.cc | 19 ++++++++-----
agents/windows/check_mk_agent.exe | Bin 748032 -> 748544 bytes
agents/windows/check_mk_agent.msi | Bin 1835520 -> 1837056 bytes
agents/windows/check_mk_agent.unversioned.exe | Bin 748032 -> 748544 bytes
agents/windows/install_agent-64.exe | Bin 383088 -> 383220 bytes
agents/windows/install_agent.exe | Bin 373956 -> 374150 bytes
agents/windows/plugins/mk_dhcp_enabled.bat | 6 ++--
agents/windows/wmiHelper.cc | 32 ++++++++++++++++++++++
agents/windows/wmiHelper.h | 4 +++
checks/cpu_util.include | 19 ++++++++++++-
checks/winperf_processor | 2 +-
web/plugins/wato/check_parameters.py | 15 ++++++++++
17 files changed, 96 insertions(+), 13 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=bbdeba4940…
Module: check_mk
Branch: master
Commit: bd01cab593b7aecf7b7956de4d50729821bd4c39
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bd01cab593b7ae…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Nov 2 10:59:49 2015 +0100
#2720 nullmailer_mailq: New check for monitoring the outgoing mail queue of Nullmailer
This check monitors the number of mails in the deferred / outgoing mail queue of
the Nullmailer daemon.
---
.werks/2720 | 10 ++++++
ChangeLog | 1 +
agents/check_mk_agent.linux | 12 +++++--
checkman/nullmailer_mailq | 22 ++++++++++++
checks/nullmailer_mailq | 79 +++++++++++++++++++++++++++++++++++++++++++
5 files changed, 122 insertions(+), 2 deletions(-)
diff --git a/.werks/2720 b/.werks/2720
new file mode 100644
index 0000000..6184753
--- /dev/null
+++ b/.werks/2720
@@ -0,0 +1,10 @@
+Title: nullmailer_mailq: New check for monitoring the outgoing mail queue of Nullmailer
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1446458345
+Class: feature
+
+This check monitors the number of mails in the deferred / outgoing mail queue of
+the Nullmailer daemon.
diff --git a/ChangeLog b/ChangeLog
index f9e481b..feb388e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,7 @@
NOTE: Please refer to the migration notes!
* 2441 NetApp 7Mode: Now able to monitor reserved snapshot space for volumes
* 2444 lnx_if: now able to detect interfaces which "break" during runtime...
+ * 2720 nullmailer_mailq: New check for monitoring the outgoing mail queue of Nullmailer...
* 2660 FIX: fixed windows agent using the wrong working directory...
* 2664 FIX: ps: Speedup in situation with many matching processes...
* 2661 FIX: windows agent: fixed incomplete process list...
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index d8f2488..84071c8 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -507,8 +507,7 @@ if type cl_status > /dev/null 2>&1; then
fi
# Postfix mailqueue monitoring
-#
-# we determine the number of mails and their size in several postfix mail queues
+# Determine the number of mails and their size in several postfix mail queues
if type postconf >/dev/null ; then
postfix_queue_dir=$(postconf -h queue_directory 2>/dev/null)
@@ -533,6 +532,15 @@ then
qmail-qstat
fi
+# Nullmailer queue monitoring
+if type nullmailer-send >/dev/null && [ -d /var/spool/nullmailer/queue ]
+then
+ echo '<<<nullmailer_mailq>>>'
+ COUNT=$(find /var/spool/nullmailer/queue -type f | wc -l)
+ SIZE=$(du -s /var/spool/nullmailer/queue | awk '{print $1 }')
+ echo "$SIZE $COUNT"
+fi
+
# Check status of OMD sites and Check_MK Notification spooler
if type omd >/dev/null
then
diff --git a/checkman/nullmailer_mailq b/checkman/nullmailer_mailq
new file mode 100644
index 0000000..a88fb22
--- /dev/null
+++ b/checkman/nullmailer_mailq
@@ -0,0 +1,22 @@
+title: Length of the nullmailer mailqueue
+agents: linux
+catalog: app/nullmailer
+license: GPL
+distribution: check_mk
+description:
+
+ This check monitors the number of deferred mails in the outgoing mail
+ queue, as sent by the linux agent of Check_MK.
+
+ This check creates one service per host which represents the state
+ of the outgoing mailqueue.
+
+ The check will result in WARNING/CRITICAL states when the number of items
+ in the queues have reached the defined thresholds.
+
+perfdata:
+ Two variables for each queue: the number of messages and the
+ total size of the messages in the queue in bytes.
+
+inventory:
+ On each system which provides the {nullmailer-send} command one service is created.
diff --git a/checks/nullmailer_mailq b/checks/nullmailer_mailq
new file mode 100644
index 0000000..7c9f5b2
--- /dev/null
+++ b/checks/nullmailer_mailq
@@ -0,0 +1,79 @@
+#!/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-
+# 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 agent output:
+# <<<nullmailer_mailq>>>
+# 8 1
+
+factory_settings['nullmailer_mailq_default_levels'] = {
+ "deferred" : (10, 20),
+}
+
+def inventory_nullmailer_mailq(info):
+ return [(None, {})]
+
+def check_nullmailer_mailq(_no_item, params, info):
+ if type(params) != dict:
+ params = {
+ "deferred" : params,
+ }
+
+ if not info:
+ return
+
+ warn, crit = params["deferred"]
+ size_bytes, length = map(int, info[0])
+
+ state = 0
+ output = ""
+ perfdata = [ ("length", length), ("size", size_bytes) ]
+
+ if length == 0:
+ output = "Mailqueue is empty"
+ else:
+ output = "Mailqueue length is %d" % length
+
+ if length >= crit:
+ state = 2
+ elif length >= warn:
+ state = 1
+ if state:
+ output += " (warn/crit at %d/%d)" % (warn, crit)
+
+ if length != 0:
+ output += " having a size of %s" % \
+ (get_bytes_human_readable(size_bytes))
+
+ return state, output, perfdata
+
+check_info["nullmailer_mailq"] = {
+ 'check_function' : check_nullmailer_mailq,
+ 'inventory_function' : inventory_nullmailer_mailq,
+ 'service_description' : 'Nullmailer Queue',
+ 'default_levels_variable' : 'nullmailer_mailq_default_levels',
+ 'group' : 'mailqueue_length',
+ 'has_perfdata' : True,
+}