max_states not set
Message-ID: <51fa6134.Y5DBZZyo87qK6Qd5%ab(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: 7d6f6b8087c55cbb7d884917fc45d45482ac0ca3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7d6f6b8087c55c…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Aug 1 15:22:58 2013 +0200
fixed: exception when min_states / max_states not set
---
checks/win_netstat | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/checks/win_netstat b/checks/win_netstat
index 1f03b39..3f8d874 100644
--- a/checks/win_netstat
+++ b/checks/win_netstat
@@ -110,7 +110,7 @@ def check_win_netstat(item, params, info):
state = 0
extra_info = ""
- if params["min_states"]:
+ if params.get("min_states"):
min_warn, min_crit = params["min_states"]
if found <= min_crit:
state = max(state, 2)
@@ -119,7 +119,7 @@ def check_win_netstat(item, params, info):
state = max(state, 1)
extra_info += '(!) Minimum at %d ' % min_warn
- if params["max_states"]:
+ if params.get("max_states"):
max_warn, max_crit = params["max_states"]
if found >= max_crit:
state = max(state, 2)