aboutsummaryrefslogtreecommitdiff
path: root/plugins-scripts/check_oracle.sh
diff options
context:
space:
mode:
authorGravatar Ton Voon <tonvoon@users.sourceforge.net> 2003-07-02 16:21:46 +0000
committerGravatar Ton Voon <tonvoon@users.sourceforge.net> 2003-07-02 16:21:46 +0000
commit81a0d72b54806c0a55620ca33e12ebef270e1566 (patch)
tree482fe4078e53dc512b97c0b26bb746017e5507ed /plugins-scripts/check_oracle.sh
parentb25150f0a43642ab3c640e337b7a09893f4744eb (diff)
downloadmonitoring-plugins-81a0d72b54806c0a55620ca33e12ebef270e1566.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/trunk@581 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins-scripts/check_oracle.sh')
-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 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'
and cg.name='consistent gets';
EOF`
+ if [ -n "`echo $result | grep ORA-`" ] ; then
+ error=` echo "$result" | grep "ORA-" | head -1`
+ echo "CRITICAL - $error"
+ exit $STATE_CRITICAL
+ fi
+
buf_hr=`echo $result | awk '{print int($1)}'`
result=`sqlplus -s ${3}/${4}@${2} << EOF
set pagesize 0
@@ -219,6 +225,12 @@ select sum(lc.pins)/(sum(lc.pins)+sum(lc.reloads))*100
from v\\$librarycache lc;
EOF`
+ if [ -n "`echo $result | grep ORA-`" ] ; then
+ error=` echo "$result" | grep "ORA-" | head -1`
+ echo "CRITICAL - $error"
+ exit $STATE_CRITICAL
+ fi
+
lib_hr=`echo $result | awk '{print int($1)}'`
if [ $buf_hr -le ${5} -o $lib_hr -le ${5} ] ; then
@@ -249,6 +261,12 @@ from dba_free_space group by tablespace_name) B
where a.tablespace_name=b.tablespace_name and a.tablespace_name='${5}';
EOF`
+ if [ -n "`echo $result | grep ORA-`" ] ; then
+ error=` echo "$result" | grep "ORA-" | head -1`
+ echo "CRITICAL - $error"
+ exit $STATE_CRITICAL
+ fi
+
ts_free=`echo $result | awk '{print int($1)}'`
ts_total=`echo $result | awk '{print int($2)}'`
ts_pct=`echo $result | awk '{print int($3)}'`