summaryrefslogtreecommitdiffstats
path: root/plugins-scripts
diff options
context:
space:
mode:
Diffstat (limited to 'plugins-scripts')
-rwxr-xr-xplugins-scripts/check_oracle.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/plugins-scripts/check_oracle.sh b/plugins-scripts/check_oracle.sh
index 22ba2bb..ba15dc8 100755
--- a/plugins-scripts/check_oracle.sh
+++ b/plugins-scripts/check_oracle.sh
@@ -212,6 +212,12 @@ and dbg.name='db block gets'
212and cg.name='consistent gets'; 212and cg.name='consistent gets';
213EOF` 213EOF`
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
217set pagesize 0 223set pagesize 0
@@ -219,6 +225,12 @@ select sum(lc.pins)/(sum(lc.pins)+sum(lc.reloads))*100
219from v\\$librarycache lc; 225from v\\$librarycache lc;
220EOF` 226EOF`
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
249where a.tablespace_name=b.tablespace_name and a.tablespace_name='${5}'; 261where a.tablespace_name=b.tablespace_name and a.tablespace_name='${5}';
250EOF` 262EOF`
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)}'`