Cron Script to monitor the Novell Messenger status and auto-restart if its down

  • 7014794
  • 25-Mar-2014
  • 25-Mar-2014

Environment

Novell GroupWise Messenger
SUSE Linux Enterprise Server
Novell Open Enterprise Server 

Situation

Novell Messenger Agent status shows as "unused" , "dead"

Resolution

  1. Create a file on the Linux Server /usr/sbin/messenger.sh
  2. Edit the file and type the following in the file
    #!/bin/bash

    declare -i CNT=0
    CNT=`ps -aef | grep -v grep | grep -c "nmma"`
    if [ $CNT -eq 0 ]
    then
     echo "Restarting Novell Messenger Agent"
     /etc/init.d/novell-nmma start
     echo "Restarted Novell Messenger Agent" `! date` >> /var/opt/novell/messenger/log
     echo "Novell Messenger restarted" | mail -s "Novell Messenger Restarted"
    username@example.com
    else
     echo "Novell Messenger Agent is running" > /dev/null
    fi

    declare -i CNT1=0
    CNT1=`ps -aef | grep -v grep | grep -c "nmaa"`
    if [ $CNT1 -eq 0 ]
    then
     echo "Restarting Novell Archiving Agent"
     /etc/init.d/novell-nmaa start
     echo "Restarted Novell Archiving Agent" `! date` >> /var/opt/novell/messenger/log
     echo "Novell Archiving Agent restarted" | mail -s "Novell Archiving Agent Restarted"
    username@example.com
    else
     echo "Novell Archiving Agent is running" > /dev/null

  3. Save the file
  4. Type "chmod 777 /usr/sbin/messenger.sh"
  5. Edit /etc/crontab and type the following at the end of the file
    * * * * *     root   /usr/sbin/messenger.sh
  6. Now if Messenger Agent or the Archiving Agent goes down, it will brough back up automatically