[icinga-checkins] icinga.org: icinga-core/aflatto/ido: Fixed the retrival of child procs on Solris and Linux , using pgrep

git at icinga.org git at icinga.org
Fri Dec 16 12:24:11 CET 2011


Module: icinga-core
Branch: aflatto/ido
Commit: ec296483421c255f7d92239fe32e6bf32cd3da95
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=ec296483421c255f7d92239fe32e6bf32cd3da95

Author: Assaf Flatto <icinga at flatto.net>
Date:   Fri Dec 16 11:23:09 2011 +0000

Fixed the retrival of child procs on Solris and Linux , using pgrep

---

 rc.ido2db.in |   12 ++----------
 1 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/rc.ido2db.in b/rc.ido2db.in
index b2a3fcf..eeb64fa 100644
--- a/rc.ido2db.in
+++ b/rc.ido2db.in
@@ -100,16 +100,8 @@ status_ido2db ()
 
 ido2db_procs ()
 {
-
-if [ `uname` == "SunOS" ] ; then
-        PCHILD=`ps -fe -o pid,ppid,comm | grep "$Ido2dbPID" |grep -v grep | wc -l`
-        PID_LIST=`ps -fe -o pid,ppid,comm | grep "$Ido2dbPID" |grep -v grep |awk {'print $1'}| tr '\n' ' ' `
-else 
-        PCHILD=`ps axf  -o user,pid,ppid,command | grep "$Ido2dbPID" |grep -v grep|grep \_ | wc -l`
-        PID_LIST=`ps axf  -o pid,ppid,command  | grep "$Ido2dbPID" |grep -v grep |grep  \_ |awk {'print $1'}| tr '\n' ' ' `
-fi
-
-
+        PCHILD=`/usr/bin/pgrep -P  "$Ido2dbPID" | /usr/bin/wc -l`
+        PID_LIST=`/usr/bin/pgrep -P  "$Ido2dbPID" | /usr/bin/tr '\n' ' ' `
 }
 
 





More information about the icinga-checkins mailing list