[icinga-checkins] icinga.org: icinga-core/test/core: Adding ido2db_proc function

git at icinga.org git at icinga.org
Wed Nov 9 16:38:57 CET 2011


Module: icinga-core
Branch: test/core
Commit: 76e77168f11c80db972501f1dd7d94509e0f5d28
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=76e77168f11c80db972501f1dd7d94509e0f5d28

Author: assaf <assaf at AikiLinux-laptop.(none)>
Date:   Thu Oct  6 10:37:15 2011 +0100

Adding ido2db_proc function

---

 rc.ido2db.in |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/rc.ido2db.in b/rc.ido2db.in
index 57ce178..3ee3d08 100644
--- a/rc.ido2db.in
+++ b/rc.ido2db.in
@@ -35,7 +35,8 @@
 #  - Updated su syntax (Gary Miller)
 # 2009-07-11 Hendrik Bäcker <andurin at process-zero.de>
 #  - Rewrite ido2db init script, inspired by Sascha Runschke
-#
+# 2011-09-27 Assaf Flatto (icinga at flatto.net)
+# - add PID and Child proc detection for status call 
 #
 
 servicename=@ido2db_name@
@@ -97,10 +98,21 @@ status_ido2db ()
         return 1
 }
 
+ido2db_procs ()
+{
+        pid_ido2db
+#	        PARENT=`ps ef |grep pid_ido2db |grep -v grep`
+	PCHILD=`ps auxf |grep ido2db |grep -v grep |grep \_ |wc -l`
+	PID_LIST=`ps auxf |grep ido2db |grep -v grep |grep \_ |awk {'print $2'}| tr '\n' ' '`
+}
+		
+
+
 printstatus_ido2db()
 {
-	if status_ido2db $1 $2; then
-		echo "$servicename (pid $Ido2dbPID) is running..."
+     if status_ido2db $1 $2; then
+        ido2db_procs
+	echo "$servicename (pid $ido2dbPID) is running with $PCHILD child procs $PID_LIST..."
 	elif test $? == 2; then
 		echo "$servicename is not running but subsystem locked"
 	else





More information about the icinga-checkins mailing list