X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins-scripts%2Fcheck_oracle.sh;h=02ca11147b86cefde247b098cfca1486483223ce;hb=94a3cf91b3548388a9b278273ac596203a4a9e75;hp=99564917a9831950e9b0161e35f806ab43885f76;hpb=6728e60669cfa3011e5ab5f3315feccd6205668d;p=nagiosplug.git diff --git a/plugins-scripts/check_oracle.sh b/plugins-scripts/check_oracle.sh index 9956491..02ca111 100755 --- a/plugins-scripts/check_oracle.sh +++ b/plugins-scripts/check_oracle.sh @@ -244,13 +244,14 @@ EOF` 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