ADSM-L

Re: Check for Process

2001-10-11 15:17:18
Subject: Re: Check for Process
From: "Ford, Phillip" <Phillip.Ford AT SPCORP DOT COM>
Date: Thu, 11 Oct 2001 15:14:28 -0400
I use two scripts p1 is the croned one and submits the second.  The second
p2 check to see if TSM is running.  The reason for two is we were having
trouble with *SM hanging.  Thus the first one checks to see if the second
has finished in a reasonable time.  If not, the server is hung.  The second
tries a query session and reports if an error is returned.   These just send
email and thus can page to an email pager if there is a problem.  We run it
every 15 min from cron.

hope that helps


--
Phillip Ford
Phillip Ford
Senior Software Specialist
Corporate Computer Center
Schering-Plough Corp.
(901) 320-4462
(901) 320-4856 FAX
phillip.ford AT spcorp DOT com



---------------------  check_adsm_p1.script --------------
#!/bin/sh
#!/bin/sh

# file /var/operlib/adsm/check_adsm_p1.script

nohup /var/operlib/adsm/check_adsm_p2.script >/dev/null 2&>1 &


count=0
i=1
trouble=0
sleep 10
while [ ${i} -ne 0 ]
do
     i=`ps -ef | grep "check_adsm_p2.script" | grep -v grep | grep -c
"check_ad`
     count=`expr $count + 1`
     if [ ${count} -gt 10 ]
     then
        i=0
        trouble=1
     else
        sleep 60
     fi
done

if [ ${trouble} -eq 1 ]
then
   i=`grep adsm_hung /var/operlib/adsm/page_adsm_when.file | grep -c YES`
   if [ $i -eq 1 ]; then
     echo "help trouble with check adsm - adsm hungup" | /usr/bin/mailx -s
"${ne
   fi
fi

---------------------------  check_adsm_p2.script --------------------
#!/bin/sh
#!/bin/sh

# file /var/operlib/adsm/check_adsm_p2.script

sleep 10

cat /etc/adsm/adsm | read usr pw

cd /usr/bin
# /usr/bin/dsmadmc -id=$usr -password=$pw q ses > /dev/null
/usr/bin/dsmadmc -id=$usr -password=$pw q ses

errxx=$?
if [ $errxx -ne 0 ]
then
   i=`grep adsm_not_running /var/operlib/adsm/page_adsm_when.file | grep -c
YES`
   if [ $i -eq 1 ]; then
     node=`uname -n`
     echo "help trouble with check adsm - adsm is not running" |
/usr/bin/mailxe
   fi
   exit 1
fi


---------------------------------------------------------------------------
-----Original Message-----
<Prev in Thread] Current Thread [Next in Thread>