diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2003-07-02 16:21:46 (GMT) |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2003-07-02 16:21:46 (GMT) |
commit | 81a0d72b54806c0a55620ca33e12ebef270e1566 (patch) | |
tree | 482fe4078e53dc512b97c0b26bb746017e5507ed | |
parent | b25150f0a43642ab3c640e337b7a09893f4744eb (diff) | |
download | monitoring-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
-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 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' | |||
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)}'` |