Module: check_mk
Branch: master
Commit: 3546e868b0f945fa195a1c82c54b2b1d86e939ed
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3546e868b0f945…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Wed Nov 6 10:53:13 2013 +0100
cicsco_vpn_tunntel: Changed behavior in case of missing tunnel
---
checks/cisco_vpn_tunnel | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/checks/cisco_vpn_tunnel b/checks/cisco_vpn_tunnel
index 1e59206..1086bdf 100644
--- a/checks/cisco_vpn_tunnel
+++ b/checks/cisco_vpn_tunnel
@@ -40,17 +40,20 @@ def check_cisco_vpn_tunnel(item, params, info):
tunnels = params.get('tunnels',[])
tunnel_alias = ""
- tunnel_state = params.get('state',0)
+ if not params.get('state'):
+ tunnel_wort_state = 2
+ else:
+ tunnel_worst_state = params.get('state')
if item in [tunnel[0] for tunnel in tunnels]:
if tunnel[1]:
tunnel_alias = " (%s)" % tunnel[1]
- tunnel_state = tunnel[2]
+ tunnel_worst_state = tunnel[2]
extra_info = ""
state = 0
if [item] not in info:
extra_info = " - Tunnel is missing"
- state = tunnel_state
+ state = tunnel_worst_state
result = "%s%s%s" % (item, tunnel_alias, extra_info)
return state, result