Module: check_mk
Branch: master
Commit: 7cd44638e960bd15e1fdfabfb949881623f05507
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7cd44638e960bd…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Mon Sep 8 17:12:33 2014 +0200
#1179 bluecat_dhcp: New Check for DHCP Service on bluecat adonis devices.
---
.werks/1179 | 9 +++++++
ChangeLog | 5 ++--
checkman/bluecat_dhcp | 15 ++++++++++++
checks/bluecat_dhcp | 63 +++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 90 insertions(+), 2 deletions(-)
diff --git a/.werks/1179 b/.werks/1179
new file mode 100644
index 0000000..416cb39
--- /dev/null
+++ b/.werks/1179
@@ -0,0 +1,9 @@
+Title: bluecat_dhcp: New Check for DHCP Service on bluecat adonis devices.
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i6
+Date: 1410189124
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 71d9669..39768ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -43,9 +43,10 @@
* 1176 winperf_msx_queues: The list of counters for inventory can now be configured
host based using wato
* 0656 brocade_fcport: inventory rule can now choose upon physical und operations
states as well, state choices were also updated
* 1177 Hivemanger: New agent to check hivemanager devices
- * 1178 arris_cmts_mem: New check for Memory usage on arris cmts modules.
- * 1383 oracle_asm_diskgroup: Account for offline disks and required mirror free
space
+ * 1383 oracle_asm_diskgroup: Account for offline disks and required mirror free
space...
NOTE: Please refer to the migration notes!
+ * 1178 arris_cmts_mem: New check for Memory usage on arris cmts modules.
+ * 1179 bluecat_dhcp: New Check for DHCP Service on bluecat adonis devices.
* 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/bluecat_dhcp b/checkman/bluecat_dhcp
new file mode 100644
index 0000000..13b5c52
--- /dev/null
+++ b/checkman/bluecat_dhcp
@@ -0,0 +1,15 @@
+title: Bluecat Adonis DHCP State
+agents: snmp
+catalog: hw/network/bluecat
+license: GPL
+distribution: check_mk
+description:
+ This Check monitors the OperState of the DHCP Service on bluecat adonis devices.
+ The Check will return {OK} if the Service is running, {CRITICAL} if the state is fault,
{WARNING} in each other case.
+ The number of successful DHCP leases issued per second is return as information.
+
+inventory:
+ One service will be created
+
+perfdata:
+ One value is returned: The number of DHCP leases per second
diff --git a/checks/bluecat_dhcp b/checks/bluecat_dhcp
new file mode 100644
index 0000000..aeae782
--- /dev/null
+++ b/checks/bluecat_dhcp
@@ -0,0 +1,63 @@
+#!/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 from agent:
+# Put here the example output from your TCP-Based agent. If the
+# check is SNMP-Based, then remove this section
+
+def inventory_bluecat_dhcp(info):
+ return [(None, None)]
+
+def check_bluecat_dhcp(item, _no_params, info):
+ oper_state, leases_sec = map(int, info[0])
+ oper_states = {
+ 1 : "running normally",
+ 2 : "not running",
+ 3 : "currently starting",
+ 4 : "currently stopping",
+ 5 : "fault"
+
+ }
+ state = 0
+ if oper_state in [ 2, 3, 4 ]:
+ state = 1
+ elif oper_state == 5:
+ state = 2
+ yield state, "DHCP is %s" % oper_states[oper_state]
+ yield 0, '%s Leases per second' % leases_sec, [ ('leases', leases_sec
) ]
+
+check_info["bluecat_dhcp"] = {
+ "check_function" : check_bluecat_dhcp,
+ "inventory_function" : inventory_bluecat_dhcp,
+ "service_description" : "DHCP",
+ "has_perfdata" : False,
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0")
== ".1.3.6.1.4.1.13315.2.1",
+ "snmp_info" : (".1.3.6.1.4.1.13315.3.1.1.2.1", [
+ 1, # dhcpOperState
+ 3, #
dhcpLeaseStatsSuccess
+ ])
+}
+