Skip to content

Commit

Permalink
fix: Return correct exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
Salamek committed Feb 1, 2020
1 parent 066052a commit e16d61f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}

0 comments on commit e16d61f

Please sign in to comment.