ADSM-L

Re: Check for Process

2001-10-11 15:30:15
Subject: Re: Check for Process
From: Alex Paschal <AlexPaschal AT FREIGHTLINER DOT COM>
Date: Thu, 11 Oct 2001 12:26:49 -0700
Here's something I threw together on the spur of the moment.  I used dsmadmc
as a followup because sometimes dsmserv can just hang or maybe it died
because of a condition that isn't resolved just by restarting the server.
Maybe someone else knows how to send SNMP traps or something instead of an
email notification.

If all you want is just to restart it, a script isn't really necessary.  You
can just change the rc.adsmserv in inittab to respawn, so if it really does
die, it'll just restart.

Good luck.

Alex

#!/usr/bin/ksh
ps -ef | grep dsmserv | grep -v grep >/dev/null 2>&1
flag=$?
if [[ ! $flag -eq 0 ]] ; then
   nohup rc.adsmserv >/dev/null 2>&1 &
   wait 600
fi
dsmadmc -id=id -pa=password quit > /dev/null 2>&1
flag=$?
if [[ ! $flag -eq 0 ]] ; then
   {
      print "The TSM server on `hostname` has failed a connection attempt."
      print "Alert the TSM administrator, Admin Name, that TSM appears to be
down."
   } | mail -s "TSM Failure"
operations_notification AT company DOT com,admin_pager AT pagerco DOT com
fi

<Prev in Thread] Current Thread [Next in Thread>