From 8e481e4554b8b8685c4d0a817fa207c3ff51e7ff Mon Sep 17 00:00:00 2001 From: giudicelli Date: Sun, 8 Aug 2021 15:06:47 +0200 Subject: [PATCH 1/2] Bash fix --- bin/check-memory-percent.sh | 6 +++--- bin/check-memory.sh | 6 +++--- bin/check-swap.sh | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/check-memory-percent.sh b/bin/check-memory-percent.sh index ec73b79..bfd5897 100755 --- a/bin/check-memory-percent.sh +++ b/bin/check-memory-percent.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env /bin/sh # # Evaluate free system memory from Linux based systems based on percentage # This was forked from Sensu Community Plugins @@ -82,10 +82,10 @@ else output="system memory usage: $UsedPer%" fi -if (( $UsedPer >= $CRIT )); then +if [ $UsedPer -ge $CRIT ]; then echo "MEM CRITICAL - $output" exit 2 -elif (( $UsedPer >= $WARN )); then +elif [ $UsedPer -ge $WARN ]; then echo "MEM WARNING - $output" exit 1 else diff --git a/bin/check-memory.sh b/bin/check-memory.sh index 657a697..f06f787 100755 --- a/bin/check-memory.sh +++ b/bin/check-memory.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env /bin/sh # # Evaluate free system memory from Linux based systems. # @@ -63,10 +63,10 @@ else output="free system memory: $FREE_MEMORY MB" fi -if (( $FREE_MEMORY <= $CRIT )); then +if [ $FREE_MEMORY -le $CRIT ]; then echo "MEM CRITICAL - $output" exit 2 -elif (( $FREE_MEMORY <= $WARN )); then +elif [ $FREE_MEMORY -le $WARN ]; then echo "MEM WARNING - $output" exit 1 else diff --git a/bin/check-swap.sh b/bin/check-swap.sh index 83c3089..222e7d7 100755 --- a/bin/check-swap.sh +++ b/bin/check-swap.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env /bin/sh # # Evaluate swap memory usage from Linux based systems. # @@ -59,10 +59,10 @@ else output="used swap memory: $USED_SWAP MB" fi -if (( $USED_SWAP >= $CRIT )); then +if [ $USED_SWAP -ge $CRIT ]; then echo "SWAP CRITICAL - $output" exit 2 -elif (( $USED_SWAP >= $WARN )); then +elif [ $USED_SWAP -ge $WARN ]; then echo "SWAP WARNING - $output" exit 1 else From 5fef12961710b3bef50ccf96f5d14b85845c6d58 Mon Sep 17 00:00:00 2001 From: giudicelli Date: Mon, 9 Aug 2021 07:43:50 +0200 Subject: [PATCH 2/2] 4.1.2 --- lib/sensu-plugins-memory-checks/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sensu-plugins-memory-checks/version.rb b/lib/sensu-plugins-memory-checks/version.rb index 4641b17..c66a95c 100644 --- a/lib/sensu-plugins-memory-checks/version.rb +++ b/lib/sensu-plugins-memory-checks/version.rb @@ -4,7 +4,7 @@ module SensuPluginsMemoryChecks module Version MAJOR = 4 MINOR = 1 - PATCH = 1 + PATCH = 2 VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.') end