diff options
author | Matthew Kent <mattkent@users.sourceforge.net> | 2004-12-01 03:26:59 +0000 |
---|---|---|
committer | Matthew Kent <mattkent@users.sourceforge.net> | 2004-12-01 03:26:59 +0000 |
commit | 3857e368e9dfdd5bcd2649a97e42425fa71d1ad0 (patch) | |
tree | a76e3838bfa9ea851b5318edb90ae83a13967c36 | |
parent | e9c3c911a6faa00c9ff0dddda32803a35169cd8e (diff) | |
download | monitoring-plugins-3857e368e9dfdd5bcd2649a97e42425fa71d1ad0.tar.gz |
Perf data and other improvements by Florian Gleixner (1027787)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@957 f882894a-f735-0410-b71e-b25c423dba1c
-rwxr-xr-x | plugins-scripts/check_oracle.sh | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/plugins-scripts/check_oracle.sh b/plugins-scripts/check_oracle.sh index 2ac01ba2..1a23eb93 100755 --- a/plugins-scripts/check_oracle.sh +++ b/plugins-scripts/check_oracle.sh @@ -158,7 +158,7 @@ case "$cmd" in }' ;; --db) - pmonchk=`ps -ef | grep -v grep | grep "^${2}$" | grep -c pmon` + pmonchk=`ps -ef | grep -v grep | grep ${2} | grep -c pmon` if [ ${pmonchk} -ge 1 ] ; then echo "${2} OK - ${pmonchk} PMON process(es) running" exit $STATE_OK @@ -207,6 +207,7 @@ EOF` fi buf_hr=`echo "$result" | awk '/^[0-9\. \t]+$/ {print int($1)}'` + buf_hrx=`echo "$result" | awk '/^[0-9\. \t]+$/ {print $1}'` result=`sqlplus -s ${3}/${4}@${2} << EOF set pagesize 0 set numf '9999999.99' @@ -221,16 +222,17 @@ EOF` fi lib_hr=`echo "$result" | awk '/^[0-9\. \t]+$/ {print int($1)}'` + lib_hrx=`echo "$result" | awk '/^[0-9\. \t]+$/ {print $1}'` if [ $buf_hr -le ${5} -o $lib_hr -le ${5} ] ; then - echo "${2} CRITICAL - Cache Hit Rates: $lib_hr% Lib -- $buf_hr% Buff" + echo "${2} CRITICAL - Cache Hit Rates: $lib_hrx% Lib -- $buf_hrx% Buff|lib=$lib_hrx%;${6};${5};0;100 buffer=$buf_hrx%;${6};${5};0;100" exit $STATE_CRITICAL fi if [ $buf_hr -le ${6} -o $lib_hr -le ${6} ] ; then - echo "${2} WARNING - Cache Hit Rates: $lib_hr% Lib -- $buf_hr% Buff" + echo "${2} WARNING - Cache Hit Rates: $lib_hrx% Lib -- $buf_hrx% Buff|lib=$lib_hrx%;${6};${5};0;100 buffer=$buf_hrx%;${6};${5};0;100" exit $STATE_WARNING fi - echo "${2} OK - Cache Hit Rates: $lib_hr% Lib -- $buf_hr% Buff" + echo "${2} OK - Cache Hit Rates: $lib_hrx% Lib -- $buf_hrx% Buff|lib=$lib_hrx%;${6};${5};0;100 buffer=$buf_hrx%;${6};${5};0;100" exit $STATE_OK ;; @@ -260,19 +262,20 @@ EOF` 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)}'` + ts_pctx=`echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print $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 - echo "${2} : ${5} CRITICAL - $ts_pct% used [ $ts_free / $ts_total MB available ]" + echo "${2} : ${5} CRITICAL - $ts_pctx% used [ $ts_free / $ts_total MB available ]|${5}=$ts_pctx%;${7};${6};0;100" exit $STATE_CRITICAL fi if [ "$ts_pct" -ge ${7} ] ; then - echo "${2} : ${5} WARNING - $ts_pct% used [ $ts_free / $ts_total MB available ]" + echo "${2} : ${5} WARNING - $ts_pctx% used [ $ts_free / $ts_total MB available ]|${5}=$ts_pctx%;${7};${6};0;100" exit $STATE_WARNING fi - echo "${2} : ${5} OK - $ts_pct% used [ $ts_free / $ts_total MB available ]" + echo "${2} : ${5} OK - $ts_pctx% used [ $ts_free / $ts_total MB available ]|${5}=$ts_pctx%;${7};${6};0;100" exit $STATE_OK ;; *) |