Browse Source

Update 'groupwise.sh'

Adding debug and listener routine for gwAdminService
Michael Honkoop 1 year ago
parent
commit
e7aa91e6cf
1 changed files with 20 additions and 1 deletions
  1. 20 1
      groupwise.sh

+ 20 - 1
groupwise.sh

@@ -133,8 +133,27 @@ fi
 gwAdminProcess=$(ps -ef | grep gwadmin.jar | grep -v grep | awk '{print $2}')
 if [ ! -z "$gwAdminProcess" ]
 then
-    echo "P \"Groupwise AdminService\" count=1;;;1 GroupWise AdminService process is running with PID: $gwAdminProcess"
+    if [ $debug -eq 1 ]
+    then
+        echo "DEBUG:We found a gwAdmin process ID: $gwAdminProcess"
+    fi
+    gwAdminListener=$(ss -lpn| grep $gwAdminProcess | awk '{print $5}' | grep -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | sort -u | sed 's/^::ffff://')
+    if [ ! -z "$gwAdminListener" ]
+    then
+        echo "DEBUG:We found atleast one gwAdmin listener: $gwAdministener"
+    fi
+    echo "P \"Groupwise AdminService\" count=1;;;1 GroupWise AdminService process is running with PID: $gwAdminProcess and listening.\n $gwAdministener"
+    else
+        if [ $debug -eq 1 ]
+        then
+            echo "DEBUG:We found no listeners for the gwAdminService process with process ID: $gwAdminProcess"
+        fi
+    fi
 else
+    if [ $debug -eq 1 ]
+    then
+        echo "DEBUG: gwAdminService process should be running, but no processes could be found."
+    fi
     echo "P \"GroupWise AdninService\" count=0;;;1 GroupWise AdminService process is not Running."
 fi