diff options
Diffstat (limited to 'plugins-scripts/t')
0 files changed, 0 insertions, 0 deletions
diff --git a/plugins-scripts/check_oracle.sh b/plugins-scripts/check_oracle.sh index bfd9e8f..b14ec50 100755 --- a/plugins-scripts/check_oracle.sh +++ b/plugins-scripts/check_oracle.sh | |||
@@ -112,7 +112,7 @@ if [ -z "$ORACLE_HOME" ] ; then | |||
112 | ORACLE_HOME=`IFS=: | 112 | ORACLE_HOME=`IFS=: |
113 | while read -r SID ORACLE_HOME junk; | 113 | while read -r SID ORACLE_HOME junk; |
114 | do | 114 | do |
115 | if [ "$SID" = "$2" -o "$SID" = "*" ] ; then | 115 | if [ "$SID" = "$2" ] || [ "$SID" = "*" ] ; then |
116 | echo "$ORACLE_HOME"; | 116 | echo "$ORACLE_HOME"; |
117 | exit; | 117 | exit; |
118 | fi; | 118 | fi; |
@@ -121,10 +121,10 @@ if [ -z "$ORACLE_HOME" ] ; then | |||
121 | done | 121 | done |
122 | fi | 122 | fi |
123 | # Last resort | 123 | # Last resort |
124 | [ -z "$ORACLE_HOME" -a -d "$PROGPATH"/oracle ] && ORACLE_HOME=$PROGPATH/oracle | 124 | [ -z "$ORACLE_HOME" ] && [ -d "$PROGPATH"/oracle ] && ORACLE_HOME=$PROGPATH/oracle |
125 | 125 | ||
126 | if [ "$cmd" != "--db" ]; then | 126 | if [ "$cmd" != "--db" ]; then |
127 | if [ -z "$ORACLE_HOME" -o ! -d "$ORACLE_HOME" ] ; then | 127 | if [ -z "$ORACLE_HOME" ] || [ ! -d "$ORACLE_HOME" ] ; then |
128 | echo "Cannot determine ORACLE_HOME for sid $2" | 128 | echo "Cannot determine ORACLE_HOME for sid $2" |
129 | exit "$STATE_UNKNOWN" | 129 | exit "$STATE_UNKNOWN" |
130 | fi | 130 | fi |
@@ -243,11 +243,11 @@ EOF` | |||
243 | lib_hr=$(echo "$result" | awk '/^[0-9\. \t]+$/ {print int($1)}') | 243 | lib_hr=$(echo "$result" | awk '/^[0-9\. \t]+$/ {print int($1)}') |
244 | lib_hrx=$(echo "$result" | awk '/^[0-9\. \t]+$/ {print $1}') | 244 | lib_hrx=$(echo "$result" | awk '/^[0-9\. \t]+$/ {print $1}') |
245 | 245 | ||
246 | if [ "$buf_hr" -le "${5}" -o "$lib_hr" -le "${5}" ] ; then | 246 | if [ "$buf_hr" -le "${5}" ] || [ "$lib_hr" -le "${5}" ] ; then |
247 | 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" | 247 | 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" |
248 | exit "$STATE_CRITICAL" | 248 | exit "$STATE_CRITICAL" |
249 | fi | 249 | fi |
250 | if [ "$buf_hr" -le "${6}" -o "$lib_hr" -le "${6}" ] ; then | 250 | if [ "$buf_hr" -le "${6}" ] || [ "$lib_hr" -le "${6}" ] ; then |
251 | 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" | 251 | 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" |
252 | exit "$STATE_WARNING" | 252 | exit "$STATE_WARNING" |
253 | fi | 253 | fi |
@@ -283,7 +283,7 @@ EOF` | |||
283 | ts_total=$(echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print int($2)}') | 283 | ts_total=$(echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print int($2)}') |
284 | ts_pct=$(echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print int($3)}') | 284 | ts_pct=$(echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print int($3)}') |
285 | ts_pctx=$(echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print $3}') | 285 | ts_pctx=$(echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print $3}') |
286 | if [ "$ts_free" -eq 0 -a "$ts_total" -eq 0 -a "$ts_pct" -eq 0 ] ; then | 286 | if [ "$ts_free" -eq 0 ] && [ "$ts_total" -eq 0 ] && [ "$ts_pct" -eq 0 ] ; then |
287 | echo "No data returned by Oracle - tablespace $5 not found?" | 287 | echo "No data returned by Oracle - tablespace $5 not found?" |
288 | exit "$STATE_UNKNOWN" | 288 | exit "$STATE_UNKNOWN" |
289 | fi | 289 | fi |