Module: check_mk
Branch: master
Commit: 566a9bd63b1e87331fd1a225ed253eb5141a5674
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=566a9bd63b1e87…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Aug 24 13:32:40 2015 +0200
#2520 New check genua_vpn: monitors the VPN state of a genuscreen VPN appliance
This check monitors the VPN state of a genuscreen VPN appliance which supports
patchlevel 5.1
---
.werks/2520 | 10 +++++++
ChangeLog | 3 +-
checkman/genua_vpn | 13 ++++++++
checks/genua_vpn | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 110 insertions(+), 1 deletion(-)
diff --git a/.werks/2520 b/.werks/2520
new file mode 100644
index 0000000..898b46e
--- /dev/null
+++ b/.werks/2520
@@ -0,0 +1,10 @@
+Title: New check genua_vpn: monitors the VPN state of a genuscreen VPN appliance
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i3
+Date: 1440415836
+Class: feature
+
+This check monitors the VPN state of a genuscreen VPN appliance which supports
+patchlevel 5.1
diff --git a/ChangeLog b/ChangeLog
index 95bc102..95ac6c4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -53,11 +53,12 @@
* 2419 windows agent: is now downward compatible to win2k
* 2517 mem.linux: Now able to handle hardware corrupted error via WATO rule...
* 1281 Microsoft Azure special agent (treasures)...
- * 1283 hyperv_checkpoints,hyperv_vmstatus: Checkpoints and Integration Services Check
for HyperV VMs...
* 2420 mk_db2.aix: now able to monitor partitioned databases...
* 2530 ups_modulys_alarms ups_modulys_battery ups_modulys_battery_temp
ups_modulys_inphase ups_modulys_outphase: New checks for the Socomec Modulys UPS
* 2518 veritas_vcs: New check which monitors the Veritas Cluster Service...
* 2519 check_mk_agent.linux: New section for a Veritas Cluster Service...
+ * 1283 hyperv_checkpoints,hyperv_vmstatus: Checkpoints and Integration Services Check
for HyperV VMs...
+ * 2520 New check genua_vpn: monitors the VPN state of a genuscreen VPN appliance...
* 2315 FIX: windows agent: BOM replacement, fixed incorrect byte offset...
* 2316 FIX: windows agent: fix garbled output of cached agent plugins...
* 2358 FIX: check_mk_agent.solaris: more correct computation of zfs used space...
diff --git a/checkman/genua_vpn b/checkman/genua_vpn
new file mode 100644
index 0000000..ba35bc7
--- /dev/null
+++ b/checkman/genua_vpn
@@ -0,0 +1,13 @@
+title: Genuscreen: VPN state
+agents: snmp
+catalog: hw/network/genua
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the VPN state on genuscreen VPN appliance (version 5.1).
+
+item:
+ The VPN id.
+
+inventory:
+ One service per VPN is created.
diff --git a/checks/genua_vpn b/checks/genua_vpn
new file mode 100644
index 0000000..1d9f168
--- /dev/null
+++ b/checks/genua_vpn
@@ -0,0 +1,85 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2015 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.
+
+# .1.3.6.1.4.1.3717.2.1.3.1.1.1 1
+# .1.3.6.1.4.1.3717.2.1.3.1.1.2 2
+# .1.3.6.1.4.1.3717.2.1.3.1.1.3 3
+# .1.3.6.1.4.1.3717.2.1.3.1.1.4 4
+# .1.3.6.1.4.1.3717.2.1.3.1.2.1 gc2.momatec.de
+# .1.3.6.1.4.1.3717.2.1.3.1.2.2 gc1-bsge.vrznrw.de
+# .1.3.6.1.4.1.3717.2.1.3.1.2.3 gc1-bochum.vrznrw.de
+# .1.3.6.1.4.1.3717.2.1.3.1.2.4 gc1-hamm.vrznrw.de
+# .1.3.6.1.4.1.3717.2.1.3.1.3.1
+# .1.3.6.1.4.1.3717.2.1.3.1.3.2 10.99.15.250
+# .1.3.6.1.4.1.3717.2.1.3.1.3.3 10.99.13.250
+# .1.3.6.1.4.1.3717.2.1.3.1.3.4 10.99.14.250
+# .1.3.6.1.4.1.3717.2.1.3.1.4.1 172.30.230.24/32
+# .1.3.6.1.4.1.3717.2.1.3.1.4.2 172.30.230.24/32
+# .1.3.6.1.4.1.3717.2.1.3.1.4.3 172.30.230.24/32
+# .1.3.6.1.4.1.3717.2.1.3.1.4.4 172.30.230.24/32
+# .1.3.6.1.4.1.3717.2.1.3.1.5.1 192.168.100.0/24
+# .1.3.6.1.4.1.3717.2.1.3.1.5.2 10.100.15.0/24
+# .1.3.6.1.4.1.3717.2.1.3.1.5.3 10.100.13.0/24
+# .1.3.6.1.4.1.3717.2.1.3.1.5.4 10.100.14.0/24
+# .1.3.6.1.4.1.3717.2.1.3.1.6.1 2
+# .1.3.6.1.4.1.3717.2.1.3.1.6.2 2
+# .1.3.6.1.4.1.3717.2.1.3.1.6.3 2
+# .1.3.6.1.4.1.3717.2.1.3.1.6.4 2
+
+def inventory_genua_vpn(info):
+ return [ (line[0], None) for line in info ]
+
+
+def check_genua_vpn(item, params, info):
+ for vpn_id, hostname_opposite, ip_opposite, vpn_private, vpn_remote, vpn_state in
info:
+ if vpn_id == item:
+ ip_info = ""
+ if ip_opposite:
+ ip_info += " (%s)" % ip_opposite
+
+ infotext = "Hostname: %s%s, VPN private: %s, VPN remote: %s" % \
+ (hostname_opposite, ip_info, vpn_private, vpn_remote)
+
+ if vpn_state == '2':
+ return 0, "Connected, %s" % infotext
+ else:
+ return 2, "Disconnected, %s" % infotext
+
+
+check_info['genua_vpn'] = {
+ 'inventory_function' : inventory_genua_vpn,
+ 'check_function' : check_genua_vpn,
+ 'service_description' : 'VPN %s',
+ 'snmp_info' : (".1.3.6.1.4.1.3717.2.1.3.1", [
+ "1", # vpn id
+ "2", # hostname opposite
+ "3", # ip opposite
+ "4", # vpn private
+ "5", # vpn remote
+ "6", # vpn status (2:OK, 1:FAULT)
+ ]),
+ 'snmp_scan_function' : lambda oid: "genuscreen" in
oid(".1.3.6.1.2.1.1.1.0").lower(),
+}