Commit a1607a5d authored by 's avatar

Added logging of what processes are not running


git-svn-id: file:///home/svn/mapi/trunk@1269 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 8402bc1a
......@@ -34,6 +34,9 @@
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
ABW_DIR=@ABW_DIR@
ABW_VAR_DIR=@ABW_VAR_DIR@
LOG_DIR=${ABW_VAR_DIR}/log
LOG_FILE=${LOG_DIR}/abw_check_rrd.log
usage() {
echo "Usage: abw_mapi.sh [ -d ]"
......@@ -58,9 +61,25 @@ echo "PROCESSES_MAPICOMMD: $PROCESSES_MAPICOMMD"
PROCESSES_ABW=`ps -ef|grep "abw -f"|grep -v grep|wc -l`
echo "PROCESSES_ABW: $PROCESSES_ABW"
if [ $PROCESSES_MAPID -eq 0 -o \
\( $PROCESSES_MAPICOMMD -eq 0 -a "$1x" = "-dx" \) -o \
$PROCESSES_ABW -eq 0 ]; then
CURRENT_DATE=`date`
RESTART=0
if [ $PROCESSES_MAPID -eq 0 ]; then
RESTART=1
echo "$CURRENT_DATE: mapid is not running" >> $LOG_FILE
fi
if [ $PROCESSES_MAPICOMMD -eq 0 -a "$1x" = "-dx" ]; then
RESTART=1
echo "$CURRENT_DATE: mapicommd is not running and -d was specified" >> $LOG_FILE
fi
if [ $PROCESSES_ABW -eq 0 ]; then
RESTART=1
echo "$CURRENT_DATE: abw is not running" >> $LOG_FILE
fi
if [ $RESTART -gt 0 ]; then
echo "Restarting MAPI and ABW"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment