summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2003-07-02 16:21:46 (GMT)
committerTon Voon <tonvoon@users.sourceforge.net>2003-07-02 16:21:46 (GMT)
commit6aaca0f135d87c0593b78d9c9b7c0cff1bec3be9 (patch)
treebfd2258295cc5b6e45f631d9dc728a791839ca6c
parent620a792dc0eb6cbe095de0bf5b4c588849e21cd9 (diff)
downloadmonitoring-plugins-6aaca0f135d87c0593b78d9c9b7c0cff1bec3be9.tar.gz
Check for ORA- errors for tablespace and cache (patch 755456 - Sven Meyer)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/branches/release-1.3.0@581 f882894a-f735-0410-b71e-b25c423dba1c
-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 3064db9..6bdafcf 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)}'`