|
@@ -30,6 +30,9 @@ gwIA=1
|
|
|
# Debug switch for development purposes ( 0 for no debug, 1 for debug information )
|
|
# Debug switch for development purposes ( 0 for no debug, 1 for debug information )
|
|
|
debug=0
|
|
debug=0
|
|
|
|
|
|
|
|
|
|
+# Service name
|
|
|
|
|
+SERVICE="GroupWise"
|
|
|
|
|
+
|
|
|
#####################################################################
|
|
#####################################################################
|
|
|
# DO NOT CHANGE BELOW UNLESS YOU EXACTLY KNOW WHAT YOU ARE DOING #
|
|
# DO NOT CHANGE BELOW UNLESS YOU EXACTLY KNOW WHAT YOU ARE DOING #
|
|
|
#####################################################################
|
|
#####################################################################
|
|
@@ -38,75 +41,75 @@ if [ "$gwMTA" -eq 1 ]
|
|
|
then
|
|
then
|
|
|
if [ "$debug" -eq 1 ]
|
|
if [ "$debug" -eq 1 ]
|
|
|
then
|
|
then
|
|
|
- echo "DEBUG: gwMTA is enabled in config, checking for the process."
|
|
|
|
|
|
|
+ echo "DEBUG: $SERVICE gwMTA is enabled in config, checking for the process."
|
|
|
fi
|
|
fi
|
|
|
gwMTAProcess=$(pgrep -x gwmta)
|
|
gwMTAProcess=$(pgrep -x gwmta)
|
|
|
if [[ -n "$gwMTAProcess" ]]
|
|
if [[ -n "$gwMTAProcess" ]]
|
|
|
then
|
|
then
|
|
|
if [ "$debug" -eq 1 ]
|
|
if [ "$debug" -eq 1 ]
|
|
|
then
|
|
then
|
|
|
- echo "DEBUG:We found a gwMTA process ID: $gwMTAProcess"
|
|
|
|
|
|
|
+ echo "DEBUG:We found a $SERVICE gwMTA process ID: $gwMTAProcess"
|
|
|
fi
|
|
fi
|
|
|
gwMTAListener=$(ss -lpn | grep "$gwMTAProcess" |awk '{print $5}' | grep -E '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'| sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g')
|
|
gwMTAListener=$(ss -lpn | grep "$gwMTAProcess" |awk '{print $5}' | grep -E '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'| sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g')
|
|
|
if [ ! -z "$gwMTAListener" ]
|
|
if [ ! -z "$gwMTAListener" ]
|
|
|
then
|
|
then
|
|
|
if [ "$debug" -eq 1 ]
|
|
if [ "$debug" -eq 1 ]
|
|
|
then
|
|
then
|
|
|
- echo "DEBUG:We found atleast one gwMTA listener: $gwMTAListener"
|
|
|
|
|
|
|
+ echo "DEBUG:We found atleast one $SERVICE gwMTA listener: $gwMTAListener"
|
|
|
fi
|
|
fi
|
|
|
- echo "P \"Groupwise MTA\" status=1;;;1 GroupWise Mail Transfer Agent is running with PID: $gwMTAProcess and listening.\n $gwMTAListener"
|
|
|
|
|
|
|
+ echo "P \"$SERVICE MTA\" status=1;;;1 $SERVICE Mail Transfer Agent is running with PID: $gwMTAProcess and listening.\n $gwMTAListener"
|
|
|
else
|
|
else
|
|
|
if [ "$debug" -eq 1 ]
|
|
if [ "$debug" -eq 1 ]
|
|
|
then
|
|
then
|
|
|
- echo "DEBUG:We found no listeners for the gwMTA process with process ID: $gwMTAProcess"
|
|
|
|
|
|
|
+ echo "DEBUG:We found no listeners for the $SERVICE gwMTA process with process ID: $gwMTAProcess"
|
|
|
fi
|
|
fi
|
|
|
- echo "P \"Groupwise MTA\" status=0.5;;;1GroupWise Mail Transfer Agent is running with PID: $gwMTAProcess but not listening."
|
|
|
|
|
|
|
+ echo "P \"$SERVICE MTA\" status=0.5;;;1 $SERVICE Mail Transfer Agent is running with PID: $gwMTAProcess but not listening."
|
|
|
fi
|
|
fi
|
|
|
else
|
|
else
|
|
|
if [ "$debug" -eq 1 ]
|
|
if [ "$debug" -eq 1 ]
|
|
|
then
|
|
then
|
|
|
- echo "DEBUG: gwMTA is enabled in config, but no processes could be found."
|
|
|
|
|
|
|
+ echo "DEBUG: $SERVICE gwMTA is enabled in config, but no processes could be found."
|
|
|
fi
|
|
fi
|
|
|
- echo "P \"GroupWise MTA\" status=0;;;1 GroupWise Mail Transfer Agent process is not Running."
|
|
|
|
|
|
|
+ echo "P \"$SERVICE MTA\" status=0;;;1 $SERVICE Mail Transfer Agent process is not Running."
|
|
|
fi
|
|
fi
|
|
|
else
|
|
else
|
|
|
- echo "DEBUG: gwMTA is not enabled in config, skipping."
|
|
|
|
|
|
|
+ echo "DEBUG: $SERVICE gwMTA is not enabled in config, skipping."
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
if [ "$gwPOA" -eq 1 ]
|
|
if [ "$gwPOA" -eq 1 ]
|
|
|
then
|
|
then
|
|
|
if [ "$debug" -eq 1 ]
|
|
if [ "$debug" -eq 1 ]
|
|
|
then
|
|
then
|
|
|
- echo "DEBUG: gwPOA is enabled in config, checking for the process."
|
|
|
|
|
|
|
+ echo "DEBUG: $SERVICE gwPOA is enabled in config, checking for the process."
|
|
|
fi
|
|
fi
|
|
|
gwPOAProcess=$(pgrep -x gwpoa)
|
|
gwPOAProcess=$(pgrep -x gwpoa)
|
|
|
if [ ! -z "$gwPOAProcess" ]
|
|
if [ ! -z "$gwPOAProcess" ]
|
|
|
then
|
|
then
|
|
|
if [ "$debug" -eq 1 ]
|
|
if [ "$debug" -eq 1 ]
|
|
|
then
|
|
then
|
|
|
- echo "DEBUG:We found a gwPOA process ID: $gwPOAProcess"
|
|
|
|
|
|
|
+ echo "DEBUG:We found a $SERVICE gwPOA process ID: $gwPOAProcess"
|
|
|
fi
|
|
fi
|
|
|
gwPOAListener=$(ss -lpn | grep "$gwPOAProcess" |awk '{print $5}' | grep -E '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | sort -u | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g' )
|
|
gwPOAListener=$(ss -lpn | grep "$gwPOAProcess" |awk '{print $5}' | grep -E '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | sort -u | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g' )
|
|
|
if [ ! -z "$gwPOAListener" ]
|
|
if [ ! -z "$gwPOAListener" ]
|
|
|
then
|
|
then
|
|
|
if [ "$debug" -eq 1 ]
|
|
if [ "$debug" -eq 1 ]
|
|
|
then
|
|
then
|
|
|
- echo "DEBUG:We found atleast one gwPOA listener: $gwPOAListener"
|
|
|
|
|
|
|
+ echo "DEBUG:We found atleast one $SERVICE gwPOA listener: $gwPOAListener"
|
|
|
fi
|
|
fi
|
|
|
- echo "P \"Groupwise POA\" status=1;;;1 GroupWise Post Office Agent is running with PID: $gwPOAProcess and listening.\n $gwPOAListener"
|
|
|
|
|
|
|
+ echo "P \"$SERVICE POA\" status=1;;;1 $SERVICE Post Office Agent is running with PID: $gwPOAProcess and listening.\n $gwPOAListener"
|
|
|
else
|
|
else
|
|
|
if [ "$debug" -eq 1 ]
|
|
if [ "$debug" -eq 1 ]
|
|
|
then
|
|
then
|
|
|
- echo "DEBUG:We found no listeners for the gwPOA process with process ID: $gwPOAProcess"
|
|
|
|
|
|
|
+ echo "DEBUG:We found no listeners for the $SERVICE gwPOA process with process ID: $gwPOAProcess"
|
|
|
fi
|
|
fi
|
|
|
- echo "P \"Groupwise POA\" status=0.5;;;1GroupWise Post Office Agent is running with PID: $gwPOAProcess but not listening."
|
|
|
|
|
|
|
+ echo "P \"Groupwise POA\" status=0.5;;;1 $SERVICE Post Office Agent is running with PID: $gwPOAProcess but not listening."
|
|
|
fi
|
|
fi
|
|
|
else
|
|
else
|
|
|
if [ "$debug" -eq 1 ]
|
|
if [ "$debug" -eq 1 ]
|
|
|
then
|
|
then
|
|
|
- echo "DEBUG: gwPOA is enabled in config, but no processes could be found."
|
|
|
|
|
|
|
+ echo "DEBUG: $SERVICE gwPOA is enabled in config, but no processes could be found."
|
|
|
fi
|
|
fi
|
|
|
- echo "P \"GroupWise POA\" status=0;;;1 GroupWise Post Office Agent process is not Running."
|
|
|
|
|
|
|
+ echo "P \"$SERVICE POA\" status=0;;;1 $SERVICE Post Office Agent process is not Running."
|
|
|
fi
|
|
fi
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
@@ -114,7 +117,7 @@ if [ "$gwIA" -eq 1 ]
|
|
|
then
|
|
then
|
|
|
if [ "$debug" -eq 1 ]
|
|
if [ "$debug" -eq 1 ]
|
|
|
then
|
|
then
|
|
|
- echo "DEBUG: gwIA is enabled in config, checking for the process."
|
|
|
|
|
|
|
+ echo "DEBUG: $SERVICE gwIA is enabled in config, checking for the process."
|
|
|
fi
|
|
fi
|
|
|
gwIAProcess=$(pgrep -x gwia)
|
|
gwIAProcess=$(pgrep -x gwia)
|
|
|
if [ ! -z "$gwIAProcess" ]
|
|
if [ ! -z "$gwIAProcess" ]
|
|
@@ -124,22 +127,22 @@ then
|
|
|
then
|
|
then
|
|
|
if [ "$debug" -eq 1 ]
|
|
if [ "$debug" -eq 1 ]
|
|
|
then
|
|
then
|
|
|
- echo "DEBUG:We found atleast one gwIA listener: $gwIAListener"
|
|
|
|
|
|
|
+ echo "DEBUG:We found atleast one $SERVICE gwIA listener: $gwIAListener"
|
|
|
fi
|
|
fi
|
|
|
- echo "P \"Groupwise GWIA\" status=1;;;1 GroupWise Internet Agent is running with PID: $gwIAProcess and listening.\n $gwIAListener"
|
|
|
|
|
|
|
+ echo "P \"$SERVICE GWIA\" status=1;;;1 $SERVICE Internet Agent is running with PID: $gwIAProcess and listening.\n $gwIAListener"
|
|
|
else
|
|
else
|
|
|
if [ "$debug" -eq 1 ]
|
|
if [ "$debug" -eq 1 ]
|
|
|
then
|
|
then
|
|
|
- echo "DEBUG:We found no listeners for the gwIA process with process ID: $gwIAProcess"
|
|
|
|
|
|
|
+ echo "DEBUG:We found no listeners for the $SERVICE gwIA process with process ID: $gwIAProcess"
|
|
|
fi
|
|
fi
|
|
|
- echo "P \"Groupwise GWIA\" status=0.5;;;1 GroupWise Internet Agent is running with PID: $gwIAProcess but not listening."
|
|
|
|
|
|
|
+ echo "P \"$SERVICE GWIA\" status=0.5;;;1 $SERVICE Internet Agent is running with PID: $gwIAProcess but not listening."
|
|
|
fi
|
|
fi
|
|
|
else
|
|
else
|
|
|
if [ "$debug" -eq 1 ]
|
|
if [ "$debug" -eq 1 ]
|
|
|
then
|
|
then
|
|
|
- echo "DEBUG: gwIA is enabled in config, but no processes could be found."
|
|
|
|
|
|
|
+ echo "DEBUG: $SERVICE gwIA is enabled in config, but no processes could be found."
|
|
|
fi
|
|
fi
|
|
|
- echo "P \"GroupWise GWIA\" status=0;;;1 GroupWise Internet Agent process is not Running."
|
|
|
|
|
|
|
+ echo "P \"$SERVICE GWIA\" status=0;;;1 $SERVICE Internet Agent process is not Running."
|
|
|
fi
|
|
fi
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
@@ -148,24 +151,24 @@ if [ ! -z "$gwAdminProcess" ]
|
|
|
then
|
|
then
|
|
|
if [ "$debug" -eq 1 ]
|
|
if [ "$debug" -eq 1 ]
|
|
|
then
|
|
then
|
|
|
- echo "DEBUG:We found a gwAdmin process ID: $gwAdminProcess"
|
|
|
|
|
|
|
+ echo "DEBUG:We found a $SERVICE gwAdmin process ID: $gwAdminProcess"
|
|
|
fi
|
|
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://' | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g')
|
|
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://' | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g')
|
|
|
if [ ! -z "$gwAdminListener" ]
|
|
if [ ! -z "$gwAdminListener" ]
|
|
|
then
|
|
then
|
|
|
if [ "$debug" -eq 1 ]
|
|
if [ "$debug" -eq 1 ]
|
|
|
then
|
|
then
|
|
|
- echo "DEBUG:We found atleast one gwAdmin listener: $gwAdminListener"
|
|
|
|
|
|
|
+ echo "DEBUG:We found atleast one $SERVICE gwAdmin listener: $gwAdminListener"
|
|
|
fi
|
|
fi
|
|
|
- echo "P \"Groupwise AdminService\" count=1;;;1 GroupWise AdminService process is running with PID: $gwAdminProcess and listening.\n $gwAdminListener"
|
|
|
|
|
|
|
+ echo "P \"$SERVICE AdminService\" count=1;;;1 $SERVICE AdminService process is running with PID: $gwAdminProcess and listening.\n $gwAdminListener"
|
|
|
else
|
|
else
|
|
|
if [ "$debug" -eq 1 ]
|
|
if [ "$debug" -eq 1 ]
|
|
|
then
|
|
then
|
|
|
- echo "DEBUG:We found no listeners for the gwAdminService process with process ID: $gwAdminProcess"
|
|
|
|
|
|
|
+ echo "DEBUG:We found no listeners for the $SERVICE gwAdminService process with process ID: $gwAdminProcess"
|
|
|
fi
|
|
fi
|
|
|
- echo "P \"Groupwise AdminService\" status=0.5;;;1 GroupWise AdminService is running with PID: $gwAdminProcess but not listening."
|
|
|
|
|
|
|
+ echo "P \"$SERVICE AdminService\" status=0.5;;;1 $SERVICE AdminService is running with PID: $gwAdminProcess but not listening."
|
|
|
fi
|
|
fi
|
|
|
else
|
|
else
|
|
|
- echo "P \"GroupWise AdminService\" status=0;;;1 GroupWise AdminService process is not Running."
|
|
|
|
|
|
|
+ echo "P \"$SERVICE AdminService\" status=0;;;1 $SERVICE AdminService process is not Running."
|
|
|
fi
|
|
fi
|
|
|
|
|
|