[checkmk-commits] Check_MK Git: check_mk: temp check backup

git version control git at mathias-kettner.de
Fri Nov 9 17:43:23 CET 2012


Module: check_mk
Branch: master
Commit: 7cb160ff66adb9df76dbd176733b6886a1afc7a6
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7cb160ff66adb9df76dbd176733b6886a1afc7a6

Author: Florian Heigl <fh at mathias-kettner.de>
Date:   Fri Nov  9 17:43:17 2012 +0100

temp check backup

---

 checks/sym_brightmail_queues |  104 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 104 insertions(+), 0 deletions(-)

diff --git a/checks/sym_brightmail_queues b/checks/sym_brightmail_queues
new file mode 100644
index 0000000..ce0af81
--- /dev/null
+++ b/checks/sym_brightmail_queues
@@ -0,0 +1,104 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# |             ____ _               _        __  __ _  __           |
+# |            / ___| |__   ___  ___| | __   |  \/  | |/ /           |
+# |           | |   | '_ \ / _ \/ __| |/ /   | |\/| | ' /            |
+# |           | |___| | | |  __/ (__|   <    | |  | | . \            |
+# |            \____|_| |_|\___|\___|_|\_\___|_|  |_|_|\_\           |
+# |                                                                  |
+# | Copyright Mathias Kettner 2012             mk at 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.
+
+
+#.1.3.6.1.4.1.393.200.130.2.1.2.1 = INTEGER: 1
+#.1.3.6.1.4.1.393.200.130.2.1.2.2 = INTEGER: 1
+#.1.3.6.1.4.1.393.200.130.2.2.1.1.1.1 = INTEGER: 1
+#.1.3.6.1.4.1.393.200.130.2.2.1.1.1.2 = INTEGER: 2
+#.1.3.6.1.4.1.393.200.130.2.2.1.1.1.3 = INTEGER: 3
+#.1.3.6.1.4.1.393.200.130.2.2.1.1.2.1 = STRING: "delivery"
+#.1.3.6.1.4.1.393.200.130.2.2.1.1.2.2 = STRING: "inbound"
+#.1.3.6.1.4.1.393.200.130.2.2.1.1.2.3 = STRING: "outbound"
+#.1.3.6.1.4.1.393.200.130.2.2.1.1.3.1 = Gauge32: 0
+#.1.3.6.1.4.1.393.200.130.2.2.1.1.3.2 = Gauge32: 1
+#.1.3.6.1.4.1.393.200.130.2.2.1.1.3.3 = Gauge32: 0
+#.1.3.6.1.4.1.393.200.130.2.2.1.1.4.1 = Gauge32: 0
+#.1.3.6.1.4.1.393.200.130.2.2.1.1.4.2 = Gauge32: 0
+#.1.3.6.1.4.1.393.200.130.2.2.1.1.4.3 = Gauge32: 0
+#.1.3.6.1.4.1.393.200.130.2.2.1.1.5.1 = Gauge32: 4
+#.1.3.6.1.4.1.393.200.130.2.2.1.1.5.2 = Gauge32: 0
+#.1.3.6.1.4.1.393.200.130.2.2.1.1.5.3 = Gauge32: 0
+#.1.3.6.1.4.1.393.200.130.2.2.1.1.6.1 = Gauge32: 0
+#.1.3.6.1.4.1.393.200.130.2.2.1.1.6.2 = Gauge32: 0
+#.1.3.6.1.4.1.393.200.130.2.2.1.1.6.3 = Gauge32: 0
+#.1.3.6.1.4.1.393.200.130.2.2.1.1.7.1 = Gauge32: 0
+#.1.3.6.1.4.1.393.200.130.2.2.1.1.7.2 = Gauge32: 0
+#.1.3.6.1.4.1.393.200.130.2.2.1.1.7.3 = Gauge32: 0
+#.1.3.6.1.4.1.393.200.130.2.2.1.1.8.1 = Gauge32: 5
+#.1.3.6.1.4.1.393.200.130.2.2.1.1.8.2 = Gauge32: 0
+#.1.3.6.1.4.1.393.200.130.2.2.1.1.8.3 = Gauge32: 0
+
+
+brightmail_message_levels = { "deferredMessages" : (40, 100)}
+
+def inventory_sym_brightmail_queues(info):
+    inventory = []
+    for line in info:
+        inventory.append((line[0], "brightmail_message_levels"))
+    return inventory
+
+
+def check_sym_brightmail_queues(item, params, info):
+
+    state = 0
+
+    for line in info:
+        if line[0] == item:
+            Connections, dataRate, deferredMessages, \
+            messageRate, queueSize, queuedMessages = line[1:]
+            #for what in Connections, dataRate, deferredMessages, \
+            #messageRate, queueSize, queuedMessages ():
+            warn, crit = params.get("deferredMessages")
+            val = int(deferredMessages)
+            if   val >  crit:
+                state = (max(state, 2))
+            elif val >  warn:
+                state = (max(state, 2))
+            msg = "deferredMessages: %d" % val
+            return (state, nagios_state_names[state] +" - " + msg)
+            
+            
+
+    return (3, "UNKW - Check not implemented")
+
+
+check_info["sym_brightmail_queues"] = {
+     "check_function"           : check_sym_brightmail_queues,
+     "inventory_function"       : inventory_sym_brightmail_queues,
+     "service_description"      : "Queue %s",
+     "has_perfdata"             : False,
+     "snmp_scan_function"       : lambda oid: "el5_sms" in oid(".1.3.6.1.2.1.1.1.0").lower() and oid(".1.3.6.1.4.1.393.200.130.2.1.2.1"),
+     "snmp_info"                : (".1.3.6.1.4.1.393.200.130.2", [ 
+                                      "2.1.1.2", # InstanceDescr
+                                      "2.1.1.3", # Connections
+                                      "2.1.1.4", # dataRate
+                                      "2.1.1.5", # deferedMessages
+                                      "2.1.1.6", # messageRate
+                                      "2.1.1.7", # queueSize
+                                      "2.1.1.8", # queuedMessages
+                                  ])
+}



More information about the checkmk-commits mailing list