Module: check_mk
Branch: master
Commit: 368c06ff5d0962457ddd6b09428d16d548ba675f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=368c06ff5d0962…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Dec 2 11:22:42 2015 +0100
juniper_cpu: Fixed code formating
Conflicts:
checks/juniper_cpu
---
checks/juniper_cpu | 59 ++++++++++++++++++++++++++--------------------------
1 file changed, 29 insertions(+), 30 deletions(-)
diff --git a/checks/juniper_cpu b/checks/juniper_cpu
index 9d237dc..5278430 100644
--- a/checks/juniper_cpu
+++ b/checks/juniper_cpu
@@ -31,39 +31,38 @@ def inventory_juniper_cpu(info):
def check_juniper_cpu(item, params, info):
for line in info:
- if line[0] == item:
- util1, util5, util15 = map(int,line[1:])
- warn, crit = params
- label1, label5, label15 = "", "", ""
- state = 0
- if util1 >= crit:
- state = 2
- label1 = "(!!)"
- elif util1 >= warn:
- state = 1
- label1 = "(!)"
- if util5 >= crit:
- state = 2
- label5 = "(!!)"
- elif util5 >= warn:
- state = max(state,1)
- label5 = "(!)"
- if util15 >= crit:
- state = 2
- label15 = "(!!)"
- elif util15 >= warn:
- state = max(state,1)
- label15 = "(!)"
+ if line[0] == item:
+ util1, util5, util15 = map(int, line[1:])
+ warn, crit = params
+ label1, label5, label15 = "", "", ""
+ state = 0
+ if util1 >= crit:
+ state = 2
+ label1 = "(!!)"
+ elif util1 >= warn:
+ state = 1
+ label1 = "(!)"
+ if util5 >= crit:
+ state = 2
+ label5 = "(!!)"
+ elif util5 >= warn:
+ state = max(state,1)
+ label5 = "(!)"
+ if util15 >= crit:
+ state = 2
+ label15 = "(!!)"
+ elif util15 >= warn:
+ state = max(state,1)
+ label15 = "(!)"
- perf = [( "util1", util1, warn, crit ),
- ( "util5", util5, warn, crit ),
- ( "util15", util15, warn, crit )]
+ perf = [( "util1", util1, warn, crit ),
+ ( "util5", util5, warn, crit ),
+ ( "util15", util15, warn, crit )]
- message = "%d%% 1 min%s, %d%% 5 min%s, %d%% 15 min%s" % \
- ( util1, label1, util5, label5, util15, label15 )
- return state, message, perf
- return 3, "Information not found in output"
+ message = "%d%% 1 min%s, %d%% 5 min%s, %d%% 15 min%s" % \
+ ( util1, label1, util5, label5, util15, label15 )
+ return state, message, perf
check_info["juniper_cpu"] = {
"check_function" : check_juniper_cpu,