Module: check_mk
Branch: master
Commit: 4dce4403047589b3915ec77019e2a91f3dd27027
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4dce4403047589…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Wed Oct 22 22:00:54 2014 +0200
#0662 domino_mailqueues: new check to monitor mail queues in Lotus Domino
---
.werks/662 | 9 ++++
ChangeLog | 1 +
checkman/domino_mailqueues | 25 +++++++++++
checks/domino_mailqueues | 78 ++++++++++++++++++++++++++++++++++
web/plugins/wato/check_parameters.py | 30 +++++++++++++
5 files changed, 143 insertions(+)
diff --git a/.werks/662 b/.werks/662
new file mode 100644
index 0000000..412d24f
--- /dev/null
+++ b/.werks/662
@@ -0,0 +1,9 @@
+Title: domino_mailqueues: new check to monitor mail queues in Lotus Domino
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i6
+Date: 1414008002
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index d97ad77..46e6aa2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -72,6 +72,7 @@
* 1130 esx monitoring: agent_vsphere now retrieves additional data (used by
HW-inventory)...
* 1422 agent_vsphere: now able to configure where the power state of a vm or esx-host
should be assigned...
* 1442 ups_socomec_out_source: New check for checking the power source of out phases
for Socomec UPSs
+ * 0662 domino_mailqueues: new check to monitor mail queues in Lotus Domino
* 1051 FIX: tcp_conn_stats: fix missing performance data...
* 1142 FIX: winperf_ts_sessions: fix computation, check has never really worked
* 1090 FIX: zfsget: fixed exception which happened on incomplete zfs entries
diff --git a/checkman/domino_mailqueues b/checkman/domino_mailqueues
new file mode 100644
index 0000000..efd1512
--- /dev/null
+++ b/checkman/domino_mailqueues
@@ -0,0 +1,25 @@
+title: IBM Lotus Domino: Mail Queues
+agents: snmp
+catalog: app/lotusnotes
+license: GPL
+distribution: check_mk
+description:
+ This check uses snmp to extract the number of mails present in various
+ mail queues of the Lotus Domino Mail Server. Warning and critical levels
+ may be configured for each of the queues.
+
+item:
+ The names of the mail queues as given in the Lotus Notes SNMP MIB.
+
+inventory:
+ The names of the mail queues are predefined in the check. If the corresponding
+ oid is found, the corresponding mail queue is inventorized.
+
+[configuration]
+domino_mailqueues_defaults (dict)
+
+[parameters]
+parameters (dict): The parameters can be given in a dictionary based syntax
+ with the single element below.
+
+{"queue_length"}: a tuple of warning and critical levels
diff --git a/checks/domino_mailqueues b/checks/domino_mailqueues
new file mode 100644
index 0000000..f09f56e
--- /dev/null
+++ b/checks/domino_mailqueues
@@ -0,0 +1,78 @@
+#!/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.
+
+factory_settings["domino_mailqueues_defaults"] = {
+ "queue_length": ( 300, 350 )
+}
+
+domino_mailqueues = {
+ 1: ( "lnDeadMail", "Dead Mails" ), # lnDeadMail
+ 6: ( "lnWaitingMail", "Waiting Mails" ), # lnWaitingMail
+ 21: ( "lnMailHold", "Mails on Hold" ), # lnMailHold
+ 31: ( "lnMailTotalPending", "Total Pending Mails" ), #
lnMailTotalPending
+ 34: ( "InMailWaitingforDNS", "Mails waiting for DNS" ), #
InMailWaitingforDNS
+}
+
+def inventory_domino_mailqueues(info):
+ inventory = []
+ for line in info:
+ val = int(line[0][0].split(".")[12])
+ if val in domino_mailqueues.keys():
+ inventory.append(( domino_mailqueues[val][0],
"domino_mailqueues_defaults" ))
+ return inventory
+
+def check_domino_mailqueues(item, params, info):
+ for line in info:
+ val = int(line[0][0].split(".")[12])
+ if item == domino_mailqueues[val][0]:
+ reading = int(line[0][1])
+ warn, crit = params.get("queue_length")
+ infotext = "%d Mails in %s Queue" % \
+ (reading, domino_mailqueues[val][1])
+ levels = " (Warn/Crit at %s/%s)" % ( warn, crit )
+ perfdata = [ ( "mails", reading, warn, crit ) ]
+ state = 0
+ if reading >= crit:
+ state = 2
+ infotext += levels
+ elif reading >= warn:
+ state = 1
+ infotext += levels
+ return state, infotext, perfdata
+
+ return 3, "no information found"
+
+check_info["domino_mailqueues"] = {
+ "check_function" : check_domino_mailqueues,
+ "inventory_function" : inventory_domino_mailqueues,
+ "service_description" : "Domino %s",
+ "has_perfdata" : True,
+ "default_levels_variable" : "domino_mailqueues_defaults",
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0")
== ".1.3.6.1.4.1.311.1.1.3.1.2",
+ "snmp_info" : map(lambda x:
(".1.3.6.1.4.1.334.72.1.1.4", [OID_STRING, x]),
+ domino_mailqueues.keys()),
+ "group" : "domino_mailqueues"
+}
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 00f3de0..7d34671 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -6836,3 +6836,33 @@ register_check_parameters(
),
"first", False
)
+
+register_check_parameters(
+ subgroup_applications,
+ "domino_mailqueues",
+ _("Lotus Domino Mail Queues"),
+ Dictionary(
+ elements = [
+ ( "queue_length",
+ Tuple(
+ title = _("Number of Mails in Queue"),
+ elements = [
+ Integer(title = _("warning if above"), default_value = 300
),
+ Integer(title = _("critical if above"), default_value = 350
),
+ ]
+ )),
+ ],
+ required_keys = [ 'queue_length' ],
+ ),
+ DropdownChoice(
+ choices = [
+ ('lnDeadMail', _('Mails in Dead Queue')),
+ ('lnWaitingMail', _('Mails in Waiting Queue')),
+ ('lnMailHold', _('Mails in Hold Queue')),
+ ('lnMailTotalPending', _('Total Pending Mails')),
+ ('InMailWaitingforDNS', _('Mails Waiting for DNS Queue')),
+ ],
+ title = _("Domino Mail Queue Names"),
+ ),
+ "first"
+)