aboutsummaryrefslogtreecommitdiff
path: root/plugins-scripts/check_oracle.sh
diff options
context:
space:
mode:
authorGravatar Jan Wagner <waja@cyconet.org> 2017-01-06 18:39:51 +0100
committerGravatar Jan Wagner <waja@cyconet.org> 2017-01-06 18:39:51 +0100
commit8294af907bd8482a86df749f562b7ec09e3faeed (patch)
tree2f2c117f1e44f9cef363a5c74ff703933d836e13 /plugins-scripts/check_oracle.sh
parent9d8e973b93f261cbb52f5cb944f2e074c348290d (diff)
downloadmonitoring-plugins-8294af907bd8482a86df749f562b7ec09e3faeed.tar.gz
Fixing shellcheck SC2166
Diffstat (limited to 'plugins-scripts/check_oracle.sh')
-rwxr-xr-xplugins-scripts/check_oracle.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins-scripts/check_oracle.sh b/plugins-scripts/check_oracle.sh
index bfd9e8f0..b14ec50e 100755
--- a/plugins-scripts/check_oracle.sh
+++ b/plugins-scripts/check_oracle.sh
@@ -112,7 +112,7 @@ if [ -z "$ORACLE_HOME" ] ; then
ORACLE_HOME=`IFS=:
while read -r SID ORACLE_HOME junk;
do
- if [ "$SID" = "$2" -o "$SID" = "*" ] ; then
+ if [ "$SID" = "$2" ] || [ "$SID" = "*" ] ; then
echo "$ORACLE_HOME";
exit;
fi;
@@ -121,10 +121,10 @@ if [ -z "$ORACLE_HOME" ] ; then
done
fi
# Last resort
-[ -z "$ORACLE_HOME" -a -d "$PROGPATH"/oracle ] && ORACLE_HOME=$PROGPATH/oracle
+[ -z "$ORACLE_HOME" ] && [ -d "$PROGPATH"/oracle ] && ORACLE_HOME=$PROGPATH/oracle
if [ "$cmd" != "--db" ]; then
- if [ -z "$ORACLE_HOME" -o ! -d "$ORACLE_HOME" ] ; then
+ if [ -z "$ORACLE_HOME" ] || [ ! -d "$ORACLE_HOME" ] ; then
echo "Cannot determine ORACLE_HOME for sid $2"
exit "$STATE_UNKNOWN"
fi
@@ -243,11 +243,11 @@ EOF`
lib_hr=$(echo "$result" | awk '/^[0-9\. \t]+$/ {print int($1)}')
lib_hrx=$(echo "$result" | awk '/^[0-9\. \t]+$/ {print $1}')
- if [ "$buf_hr" -le "${5}" -o "$lib_hr" -le "${5}" ] ; then
+ if [ "$buf_hr" -le "${5}" ] || [ "$lib_hr" -le "${5}" ] ; then
echo "${2} CRITICAL - Cache Hit Rates: $lib_hrx% Lib -- $buf_hrx% Buff|lib=$lib_hrx%;${6};${5};0;100 buffer=$buf_hrx%;${6};${5};0;100"
exit "$STATE_CRITICAL"
fi
- if [ "$buf_hr" -le "${6}" -o "$lib_hr" -le "${6}" ] ; then
+ if [ "$buf_hr" -le "${6}" ] || [ "$lib_hr" -le "${6}" ] ; then
echo "${2} WARNING - Cache Hit Rates: $lib_hrx% Lib -- $buf_hrx% Buff|lib=$lib_hrx%;${6};${5};0;100 buffer=$buf_hrx%;${6};${5};0;100"
exit "$STATE_WARNING"
fi
@@ -283,7 +283,7 @@ EOF`
ts_total=$(echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print int($2)}')
ts_pct=$(echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print int($3)}')
ts_pctx=$(echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print $3}')
- if [ "$ts_free" -eq 0 -a "$ts_total" -eq 0 -a "$ts_pct" -eq 0 ] ; then
+ if [ "$ts_free" -eq 0 ] && [ "$ts_total" -eq 0 ] && [ "$ts_pct" -eq 0 ] ; then
echo "No data returned by Oracle - tablespace $5 not found?"
exit "$STATE_UNKNOWN"
fi