[Nagiosplug-checkins] CVS: nagiosplug/plugins-scripts check_oracle.sh,1.4.2.2,1.4.2.3
Ton Voon
tonvoon at users.sourceforge.net
Thu Apr 8 04:05:01 CEST 2004
Update of /cvsroot/nagiosplug/nagiosplug/plugins-scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10219
Modified Files:
Tag: r1_3_0
check_oracle.sh
Log Message:
Cleaner calls to awk and support if Oracle has different national
language settings (Torsten Werner)
Index: check_oracle.sh
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins-scripts/check_oracle.sh,v
retrieving revision 1.4.2.2
retrieving revision 1.4.2.3
diff -C2 -r1.4.2.2 -r1.4.2.3
*** check_oracle.sh 2 Jul 2003 16:20:19 -0000 1.4.2.2
--- check_oracle.sh 8 Apr 2004 10:50:39 -0000 1.4.2.3
***************
*** 206,209 ****
--- 206,210 ----
result=`sqlplus -s ${2}/${3}@${4} << EOF
set pagesize 0
+ set numf '9999999.99'
select (1-(pr.value/(dbg.value+cg.value)))*100 \
***************
*** 220,226 ****
fi
! buf_hr=`echo $result | awk '{print int($1)}'`
result=`sqlplus -s ${2}/${3}@${4} << EOF
set pagesize 0
select sum(lc.pins)/(sum(lc.pins)+sum(lc.reloads))*100 \
--- 221,228 ----
fi
! buf_hr=`echo "$result" | awk '/^[0-9\. \t]+$/ {print int($1)}'`
result=`sqlplus -s ${2}/${3}@${4} << EOF
set pagesize 0
+ set numf '9999999.99'
select sum(lc.pins)/(sum(lc.pins)+sum(lc.reloads))*100 \
***************
*** 234,238 ****
fi
! lib_hr=`echo $result | awk '{print int($1)}'`
if [ $buf_hr -le ${5} -o $lib_hr -le ${5} ] ; then
--- 236,240 ----
fi
! lib_hr=`echo "$result" | awk '/^[0-9\. \t]+$/ {print int($1)}'`
if [ $buf_hr -le ${5} -o $lib_hr -le ${5} ] ; then
***************
*** 255,258 ****
--- 257,261 ----
result=`sqlplus -s ${2}/${3}@${4} << EOF
set pagesize 0
+ set numf '9999999.99'
select b.free,a.total,100 - trunc(b.free/a.total * 1000) / 10 prc \
***************
*** 271,282 ****
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_pct -ge ${6} ] ; then
echo "${4} : ${5} CRITICAL - $ts_pct% used [ $ts_free / $ts_total MB available ]"
exit $STATE_CRITICAL
fi
! if [ $ts_pct -ge ${7} ] ; then
echo "${4} : ${5} WARNING - $ts_pct% used [ $ts_free / $ts_total MB available ]"
exit $STATE_WARNING
--- 274,286 ----
fi
! 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_pct" -ge ${6} ] ; then
echo "${4} : ${5} CRITICAL - $ts_pct% used [ $ts_free / $ts_total MB available ]"
exit $STATE_CRITICAL
fi
! if [ "$ts_pct" -ge ${7} ] ; then
echo "${4} : ${5} WARNING - $ts_pct% used [ $ts_free / $ts_total MB available ]"
exit $STATE_WARNING
More information about the Commits
mailing list