diff options
| -rwxr-xr-x | plugins-scripts/check_oracle.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/plugins-scripts/check_oracle.sh b/plugins-scripts/check_oracle.sh index 22ba2bb6..ba15dc85 100755 --- a/plugins-scripts/check_oracle.sh +++ b/plugins-scripts/check_oracle.sh | |||
| @@ -212,6 +212,12 @@ and dbg.name='db block gets' | |||
| 212 | and cg.name='consistent gets'; | 212 | and cg.name='consistent gets'; |
| 213 | EOF` | 213 | EOF` |
| 214 | 214 | ||
| 215 | if [ -n "`echo $result | grep ORA-`" ] ; then | ||
| 216 | error=` echo "$result" | grep "ORA-" | head -1` | ||
| 217 | echo "CRITICAL - $error" | ||
| 218 | exit $STATE_CRITICAL | ||
| 219 | fi | ||
| 220 | |||
| 215 | buf_hr=`echo $result | awk '{print int($1)}'` | 221 | buf_hr=`echo $result | awk '{print int($1)}'` |
| 216 | result=`sqlplus -s ${3}/${4}@${2} << EOF | 222 | result=`sqlplus -s ${3}/${4}@${2} << EOF |
| 217 | set pagesize 0 | 223 | set pagesize 0 |
| @@ -219,6 +225,12 @@ select sum(lc.pins)/(sum(lc.pins)+sum(lc.reloads))*100 | |||
| 219 | from v\\$librarycache lc; | 225 | from v\\$librarycache lc; |
| 220 | EOF` | 226 | EOF` |
| 221 | 227 | ||
| 228 | if [ -n "`echo $result | grep ORA-`" ] ; then | ||
| 229 | error=` echo "$result" | grep "ORA-" | head -1` | ||
| 230 | echo "CRITICAL - $error" | ||
| 231 | exit $STATE_CRITICAL | ||
| 232 | fi | ||
| 233 | |||
| 222 | lib_hr=`echo $result | awk '{print int($1)}'` | 234 | lib_hr=`echo $result | awk '{print int($1)}'` |
| 223 | 235 | ||
| 224 | if [ $buf_hr -le ${5} -o $lib_hr -le ${5} ] ; then | 236 | if [ $buf_hr -le ${5} -o $lib_hr -le ${5} ] ; then |
| @@ -249,6 +261,12 @@ from dba_free_space group by tablespace_name) B | |||
| 249 | where a.tablespace_name=b.tablespace_name and a.tablespace_name='${5}'; | 261 | where a.tablespace_name=b.tablespace_name and a.tablespace_name='${5}'; |
| 250 | EOF` | 262 | EOF` |
| 251 | 263 | ||
| 264 | if [ -n "`echo $result | grep ORA-`" ] ; then | ||
| 265 | error=` echo "$result" | grep "ORA-" | head -1` | ||
| 266 | echo "CRITICAL - $error" | ||
| 267 | exit $STATE_CRITICAL | ||
| 268 | fi | ||
| 269 | |||
| 252 | ts_free=`echo $result | awk '{print int($1)}'` | 270 | ts_free=`echo $result | awk '{print int($1)}'` |
| 253 | ts_total=`echo $result | awk '{print int($2)}'` | 271 | ts_total=`echo $result | awk '{print int($2)}'` |
| 254 | ts_pct=`echo $result | awk '{print int($3)}'` | 272 | ts_pct=`echo $result | awk '{print int($3)}'` |
