[Nagiosplug-checkins] nagiosplug/plugins-scripts check_oracle.sh, 1.14, 1.15

Ton Voon tonvoon at users.sourceforge.net
Thu Oct 26 23:10:22 CEST 2006


Update of /cvsroot/nagiosplug/nagiosplug/plugins-scripts
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv10433/plugins-scripts

Modified Files:
	check_oracle.sh 
Log Message:
Fixed error if dba_free_space has no free segments (Florian Gleixner)


Index: check_oracle.sh
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins-scripts/check_oracle.sh,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- check_oracle.sh	1 Dec 2004 20:09:59 -0000	1.14
+++ check_oracle.sh	26 Oct 2006 21:10:20 -0000	1.15
@@ -244,13 +244,14 @@
     result=`sqlplus -s ${3}/${4}@${2} << EOF
 set pagesize 0
 set numf '9999999.99'
-select b.free,a.total,100 - trunc(b.free/a.total * 1000) / 10 prc
+select NVL(b.free,0.0),a.total,100 - trunc(NVL(b.free,0.0)/a.total * 1000) / 10 prc
 from (
 select tablespace_name,sum(bytes)/1024/1024 total
-from dba_data_files group by tablespace_name) A,
+from dba_data_files group by tablespace_name) A
+LEFT OUTER JOIN
 ( select tablespace_name,sum(bytes)/1024/1024 free
 from dba_free_space group by tablespace_name) B
-where a.tablespace_name=b.tablespace_name and a.tablespace_name='${5}';
+ON a.tablespace_name=b.tablespace_name WHERE a.tablespace_name='${5}';
 EOF`
 
     if [ -n "`echo $result | grep ORA-`" ] ; then





More information about the Commits mailing list