summaryrefslogtreecommitdiffstats
path: root/plugins-scripts
diff options
context:
space:
mode:
Diffstat (limited to 'plugins-scripts')
-rwxr-xr-xplugins-scripts/check_oracle.sh27
1 files changed, 24 insertions, 3 deletions
diff --git a/plugins-scripts/check_oracle.sh b/plugins-scripts/check_oracle.sh
index 3064db90..6bdafcf5 100755
--- a/plugins-scripts/check_oracle.sh
+++ b/plugins-scripts/check_oracle.sh
@@ -210,15 +210,29 @@ select (1-(pr.value/(dbg.value+cg.value)))*100 \
210from v\\$sysstat pr, v\\$sysstat dbg, v\\$sysstat cg \ 210from v\\$sysstat pr, v\\$sysstat dbg, v\\$sysstat cg \
211where pr.name = 'physical reads' \ 211where pr.name = 'physical reads' \
212 and dbg.name='db block gets' \ 212 and dbg.name='db block gets' \
213 and cg.name='consistent gets'; ` 213 and cg.name='consistent gets';
214EOF`
215
216 if [ -n "`echo $result | grep ORA-`" ] ; then
217 error=` echo "$result" | grep "ORA-" | head -1`
218 echo "CRITICAL - $error"
219 exit $STATE_CRITICAL
220 fi
214 221
215 buf_hr=`echo $result | awk '{print int($1)}'` 222 buf_hr=`echo $result | awk '{print int($1)}'`
216 result=`sqlplus -s ${2}/${3}@${4} << EOF 223 result=`sqlplus -s ${2}/${3}@${4} << EOF
217 set pagesize 0 224 set pagesize 0
218 225
219select sum(lc.pins)/(sum(lc.pins)+sum(lc.reloads))*100 \ 226select sum(lc.pins)/(sum(lc.pins)+sum(lc.reloads))*100 \
220from v\\$librarycache lc ; ` 227from v\\$librarycache lc;
228EOF`
221 229
230 if [ -n "`echo $result | grep ORA-`" ] ; then
231 error=` echo "$result" | grep "ORA-" | head -1`
232 echo "CRITICAL - $error"
233 exit $STATE_CRITICAL
234 fi
235
222 lib_hr=`echo $result | awk '{print int($1)}'` 236 lib_hr=`echo $result | awk '{print int($1)}'`
223 237
224 if [ $buf_hr -le ${5} -o $lib_hr -le ${5} ] ; then 238 if [ $buf_hr -le ${5} -o $lib_hr -le ${5} ] ; then
@@ -247,7 +261,14 @@ select tablespace_name,sum(bytes)/1024/1024 total \
247from dba_data_files group by tablespace_name) A, \ 261from dba_data_files group by tablespace_name) A, \
248( select tablespace_name,sum(bytes)/1024/1024 free \ 262( select tablespace_name,sum(bytes)/1024/1024 free \
249from dba_Free_space group by tablespace_name) B \ 263from dba_Free_space group by tablespace_name) B \
250where a.tablespace_name=b.tablespace_name and a.tablespace_name='${5}'; ` 264where a.tablespace_name=b.tablespace_name and a.tablespace_name='${5}';
265EOF`
266
267 if [ -n "`echo $result | grep ORA-`" ] ; then
268 error=` echo "$result" | grep "ORA-" | head -1`
269 echo "CRITICAL - $error"
270 exit $STATE_CRITICAL
271 fi
251 272
252 ts_free=`echo $result | awk '{print int($1)}'` 273 ts_free=`echo $result | awk '{print int($1)}'`
253 ts_total=`echo $result | awk '{print int($2)}'` 274 ts_total=`echo $result | awk '{print int($2)}'`