Module: check_mk
Branch: master
Commit: a379fa8a76e339ea11a1d1680cd48bf47fd15abf
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a379fa8a76e339…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Thu Aug 27 16:33:43 2015 +0200
#1288 cisco_vpn_tunnel: Added Metrics for trafic, please beware:
It can be possible that the check reports wrong values. There is maybe a mismatch in the
the cisco mib documentation for in and out octets.
If you have an advice, please contact me.
---
.werks/1288 | 11 +++++++++++
ChangeLog | 1 +
checks/cisco_vpn_tunnel | 24 +++++++++++++++++++-----
3 files changed, 31 insertions(+), 5 deletions(-)
diff --git a/.werks/1288 b/.werks/1288
new file mode 100644
index 0000000..72bc254
--- /dev/null
+++ b/.werks/1288
@@ -0,0 +1,11 @@
+Title: cisco_vpn_tunnel: Added Metrics for trafic, please beware:
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i3
+Date: 1440685847
+Class: feature
+
+It can be possible that the check reports wrong values. There is maybe a mismatch in the
the cisco mib documentation for in and out octets.
+If you have an advice, please contact me.
+
diff --git a/ChangeLog b/ChangeLog
index b55dbc7..ea874d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -66,6 +66,7 @@
* 2423 interface checks: now able to configure absolute levels for error packets...
* 1286 blade_bx_powerfan: Discovery ignores not present fans now
* 2424 esx_vsphere_counters: improved handling when data is missing...
+ * 1288 cisco_vpn_tunnel: Added Metrics for trafic, please beware:...
* 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/checks/cisco_vpn_tunnel b/checks/cisco_vpn_tunnel
index ce3e997..f70a256 100644
--- a/checks/cisco_vpn_tunnel
+++ b/checks/cisco_vpn_tunnel
@@ -48,10 +48,20 @@ def check_cisco_vpn_tunnel(item, params, info):
alias = "[%s] " % tunnel_alias
tunnel_not_found_state = not_found_state
- if [item] not in info:
- return tunnel_not_found_state, "%sTunnel is missing" % alias
- else:
- return 0, "%sTunnel is OK" % alias
+ for tunnel, in_octets, out_octets in info:
+ if tunnel == item:
+ this_time = time.time()
+ in_octets_sec = get_rate("cisco_vpn_tunnel_in" + item, this_time,
int(in_octets))
+ out_octets_sec = get_rate("cisco_vpn_tunnel_out" + item, this_time,
int(out_octets))
+ perfdata = [
+ ("if_in_octets", in_octets_sec ),
+ ("if_out_octets", out_octets_sec),
+ ]
+ return 0, "%sTunnel is OK (In: %s/s Out: %s/s)" % \
+ (alias, get_bytes_human_readable(in_octets_sec*8),
get_bytes_human_readable(out_octets_sec*8)), \
+ perfdata
+
+ return tunnel_not_found_state, "%sTunnel is missing" % alias
check_info["cisco_vpn_tunnel"] = {
@@ -61,5 +71,9 @@ check_info["cisco_vpn_tunnel"] = {
"group" : "vpn_tunnel",
"snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.1.0").lower().startswith("cisco adaptive
security") \
or "vpn 3000 concentrator" in
oid(".1.3.6.1.2.1.1.1.0").lower(),
- "snmp_info" : ( ".1.3.6.1.4.1.9.9.171.1.2.3.1", [ 7 ]
),
+ "snmp_info" : ( ".1.3.6.1.4.1.9.9.171.1.2.3.1", [ 7,
+ 19, # In Octets
+ 27, # Out Octets
+ ] ),
+ "has_perfdata" : True,
}