From e16d61fe10a77a17cc571b8fa16985a2f8ea8104 Mon Sep 17 00:00:00 2001 From: Adam Schubert Date: Sat, 1 Feb 2020 01:50:20 +0100 Subject: [PATCH] fix: Return correct exit code --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index e3cfe99..c7c4156 100644 --- a/main.go +++ b/main.go @@ -115,7 +115,7 @@ func checkLoad(event *types.Event) error { // Detect total level // 0=ok, 1=warn, 2=crit - var level int8 = 0 + var level int = 0 for i, v := range cpuLoadList { if v > crit[i] { if 2 > level { @@ -139,7 +139,7 @@ func checkLoad(event *types.Event) error { cpuLoadList[1], cpuLoadList[2]) io.WriteString(os.Stdout, msg) - os.Exit(2) + os.Exit(level) return nil }