From facb416ef8645858ae2b521f3c4051aea223360d Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Tue, 22 Oct 2013 08:23:38 +0200 Subject: check_oracle: --db +ASM bad string matching check_oracle doesn't correctly check for pmon +ASM instance from at least Oracle 11 as the pmon proces was renamed from ora_pmon_.* to asm_pmon_.*. -- Just turning attached patch of github issue #1207 into a push request. (Closes #1207) --- plugins-scripts/check_oracle.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins-scripts/check_oracle.sh b/plugins-scripts/check_oracle.sh index 2a8ab21d..b86ce1d2 100755 --- a/plugins-scripts/check_oracle.sh +++ b/plugins-scripts/check_oracle.sh @@ -164,6 +164,7 @@ case "$cmd" in ;; --db) pmonchk=`ps -ef | grep -v grep | grep -c "ora_pmon_${2}$"` + pmonchk=$(($pmonchk+`ps -ef | grep -v grep | grep -c "asm_pmon_${2}$"`)) if [ ${pmonchk} -ge 1 ] ; then echo "${2} OK - ${pmonchk} PMON process(es) running" exit $STATE_OK -- cgit v1.2.3-74-g34f1 From 3e2d2fcf1f9f53b62f3c08ddfcc0bc78ef1537f6 Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Tue, 22 Oct 2013 10:42:22 +0200 Subject: Just using the posix conform extended regular expression grep --- plugins-scripts/check_oracle.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins-scripts/check_oracle.sh b/plugins-scripts/check_oracle.sh index b86ce1d2..77eba2eb 100755 --- a/plugins-scripts/check_oracle.sh +++ b/plugins-scripts/check_oracle.sh @@ -163,8 +163,7 @@ case "$cmd" in }' ;; --db) - pmonchk=`ps -ef | grep -v grep | grep -c "ora_pmon_${2}$"` - pmonchk=$(($pmonchk+`ps -ef | grep -v grep | grep -c "asm_pmon_${2}$"`)) + pmonchk=`ps -ef | grep -v grep | grep -E -c "(asm|ora)_pmon_${2}$"` if [ ${pmonchk} -ge 1 ] ; then echo "${2} OK - ${pmonchk} PMON process(es) running" exit $STATE_OK -- cgit v1.2.3-74-g34f1