Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bash fix #112

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bin/check-memory-percent.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions bin/check-memory.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env /bin/sh
#
# Evaluate free system memory from Linux based systems.
#
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions bin/check-swap.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env /bin/sh
#
# Evaluate swap memory usage from Linux based systems.
#
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/sensu-plugins-memory-checks/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module SensuPluginsMemoryChecks
module Version
MAJOR = 4
MINOR = 1
PATCH = 1
PATCH = 2

VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
end
Expand Down