Module: check_mk
Branch: master
Commit: 4fef66a44dfd871c164571cc4030b3c4b0faa811
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4fef66a44dfd87…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Wed Aug 21 16:18:56 2013 +0200
new check for cisco ipsec tunnels added
---
checks/cisco_vpn_tunnel | 67 ++++++++++++++++++++++++++++++++++
web/plugins/wato/check_parameters.py | 38 +++++++++++++++++++
2 files changed, 105 insertions(+)
diff --git a/checks/cisco_vpn_tunnel b/checks/cisco_vpn_tunnel
new file mode 100644
index 0000000..828c20c
--- /dev/null
+++ b/checks/cisco_vpn_tunnel
@@ -0,0 +1,67 @@
+#!/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.
+
+# OID: 1.3.6.1.4.1.9.9.171.1.2.3.1.7.###
+# cikeTunRemoteValue
+# Description
+# "The value of the remote peer identity.
+# If the remote peer type is an IP Address, then this
+# is the IP Address used to identify the remote peer.
+# If the remote peer type is a host name, then
+# this is the host name used to identify the
+# remote peer."
+
+def check_cisco_vpn_tunnel(item, params, info):
+ if not info:
+ return 3, "SNMP Data for VPN Tunnel Missing"
+
+ tunnels = params.get('tunnels',[])
+ tunnel_alias = ""
+ tunnel_state = params.get('state',0)
+ if item in [tunnel[0] for tunnel in tunnels]:
+ if tunnel[1]:
+ tunnel_alias = " (%s)" % tunnel[1]
+ tunnel_state = tunnel[2]
+
+ extra_info = ""
+ state = 0
+ if [item] not in info:
+ extra_info = " - Tunnel is missing"
+ state = tunnel_state
+
+ result = "%s%s%s" % (item, tunnel_alias, extra_info)
+ return state, result
+
+check_info["cisco_vpn_tunnel"] = {
+ "check_function" : check_cisco_vpn_tunnel,
+ "inventory_function" : lambda info: [(item[0], None) for item in info],
+ "service_description" : "VPN Tunnel %s",
+ "has_perfdata" : False,
+ "group" : "vpn_tunnel",
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.1.0").lower().startswith("cisco adaptive security"),
+ "snmp_info" : ( ".1.3.6.1.4.1.9.9.171.1.2.3.1", [ 7 ] ),
+}
+
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 7e49bf3..bcf0b2a 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -1062,6 +1062,44 @@ register_check_parameters(
None
)
+register_check_parameters(
+ subgroup_networking,
+ "vpn_tunnel",
+ _("VPN Tunnel"),
+ Dictionary(
+ elements = [
+ ( "tunnels",
+ ListOf(
+ Tuple(
+ title = ("VPN Tunnel Endpoints"),
+ elements = [
+ IPv4Address(
+ title = _("IP-Address of Tunnel Endpoint"),
+ allow_empty = False,
+ ),
+ TextAscii(
+ title = _("Name of Tunnel"),
+ ),
+ MonitoringState(
+ default_value = 2,
+ title = _("State if this tunnel is not found"),
+ )]),
+ add_label = _("Add another Tunnel"),
+ movable = False,
+ title = _("VPN Tunnel"),
+ )),
+ ( "state",
+ MonitoringState(
+ title = _("Default state if inventorized, unregistered tunnel is not found"),
+ help = _("Default state if a tunnel, which was inventorized but is not listed in this rule, "
+ "is not longer present in the snmp data"),
+ ),
+ ),
+ ],
+ ),
+ TextAscii( title = _("IP-Address of Tunnel Endpoint")),
+ "first"
+)
register_check_parameters(
subgroup_networking,
Module: check_mk
Branch: master
Commit: cf9c14425541236fe69d13e6adab99b3ba1e249c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cf9c1442554123…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Aug 20 10:16:58 2013 +0200
notify.py: fixed bug with local notification spooling
---
ChangeLog | 1 +
modules/notify.py | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 7497da1..365a5f1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -68,6 +68,7 @@
Notifications:
* notify.py: Matching service level: Use the hosts service level if a
service has no service level set
+ * notify.py: fixed bug with local notification spooling
Multisite:
* User accounts can now be locked after a specified amount of auth
diff --git a/modules/notify.py b/modules/notify.py
index 5ac931f..4f5a12e 100644
--- a/modules/notify.py
+++ b/modules/notify.py
@@ -508,7 +508,7 @@ def notify_notify(context):
"that are prefixed with NOTIFY_\n")
sys.exit(1)
- if notification_spooling:
+ if notification_spool_to:
# Create spoolfile
target_site = "%s:%s" % notification_spool_to[0:2]
create_spoolfile({"context": context, "forward": target_site})