summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ffa7482)
raw | patch | inline | side by side (parent: ffa7482)
author | Ton Voon <tonvoon@users.sourceforge.net> | |
Thu, 8 Apr 2004 11:05:11 +0000 (11:05 +0000) | ||
committer | Ton Voon <tonvoon@users.sourceforge.net> | |
Thu, 8 Apr 2004 11:05:11 +0000 (11:05 +0000) |
language settings (Torsten Werner)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@866 f882894a-f735-0410-b71e-b25c423dba1c
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@866 f882894a-f735-0410-b71e-b25c423dba1c
plugins-scripts/check_oracle.sh | patch | blob | history |
index 85425557689536ed6214b97c9903daf17e397f24..41e9dcefb356c71bc7fa881bba50db649a04714b 100755 (executable)
fi
result=`sqlplus -s ${3}/${4}@${2} << EOF
set pagesize 0
+set numf '9999999.99'
select (1-(pr.value/(dbg.value+cg.value)))*100
from v\\$sysstat pr, v\\$sysstat dbg, v\\$sysstat cg
where pr.name='physical reads'
exit $STATE_CRITICAL
fi
- buf_hr=`echo $result | awk '{print int($1)}'`
+ buf_hr=`echo "$result" | awk '/^[0-9\. \t]+$/ {print int($1)}'`
result=`sqlplus -s ${3}/${4}@${2} << EOF
set pagesize 0
+set numf '9999999.99'
select sum(lc.pins)/(sum(lc.pins)+sum(lc.reloads))*100
from v\\$librarycache lc;
EOF`
exit $STATE_CRITICAL
fi
- lib_hr=`echo $result | awk '{print int($1)}'`
+ lib_hr=`echo "$result" | awk '/^[0-9\. \t]+$/ {print int($1)}'`
if [ $buf_hr -le ${5} -o $lib_hr -le ${5} ] ; then
echo "${2} CRITICAL - Cache Hit Rates: $lib_hr% Lib -- $buf_hr% Buff"
fi
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
from (
select tablespace_name,sum(bytes)/1024/1024 total
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)}'`
- if [ $ts_free -eq 0 -a $ts_total -eq 0 -a $ts_pct -eq 0 ] ; then
+ ts_free=`echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print int($1)}'`
+ ts_total=`echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print int($2)}'`
+ ts_pct=`echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print int($3)}'`
+ if [ "$ts_free" -eq 0 -a "$ts_total" -eq 0 -a "$ts_pct" -eq 0 ] ; then
echo "No data returned by Oracle - tablespace $5 not found?"
exit $STATE_UNKNOWN
fi
- if [ $ts_pct -ge ${6} ] ; then
+ if [ "$ts_pct" -ge ${6} ] ; then
echo "${2} : ${5} CRITICAL - $ts_pct% used [ $ts_free / $ts_total MB available ]"
exit $STATE_CRITICAL
fi
- if [ $ts_pct -ge ${7} ] ; then
+ if [ "$ts_pct" -ge ${7} ] ; then
echo "${2} : ${5} WARNING - $ts_pct% used [ $ts_free / $ts_total MB available ]"
exit $STATE_WARNING
fi