Operating System - HP-UX
1834569 Members
4050 Online
110069 Solutions
New Discussion

Script Needed for Paging support when application is down

 
Hunki
Super Advisor

Script Needed for Paging support when application is down

Can anyone suggest a way to page support team through a script if the application does not come up clean after a restart through cron job.The application is tuxedo based.


Thanks to all the nice samaritans.
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor

Re: Script Needed for Paging support when application is down

Hi:

Assume that you want to look for a process called "myproc" and email/page if it isn't running:

# [ -z "`UNIX95= ps -C myproc -o pid= -o comm=`" ] && mailx -s "myproc" is not running!" root < /dev/null

Regards!

...JRF...
Peter Godron
Honored Contributor

Re: Script Needed for Paging support when application is down

Hi,
add a cronjob or direct monitoring to check for the job running.
Use a modem to alert your paging service.

Also this brings back quite a few results:
http://www4.itrc.hp.com/service/james/search.do?searchtext=Pager&searchcriteria=allwords&searchtype=SEARCH_FORUMS&rn=25&presort=rank&x=26&y=10
Geoff Wild
Honored Contributor

Re: Script Needed for Paging support when application is down

Best to do this from the script that restarts the application...

grep for something in a log file and/or echo $? for the application...

Something like this:


alertxebec="gwild@mydomain.com, applicationuser@mydomain.com:
#############################################################
#
# Mail Log file for the day to Support
#
#############################################################

grep failed $LOGFILE
FTPSTATUS=$?
if test "$FTPSTATUS" = 0
then
#we have a failure
mailx -s "XYZ JOB FTP FAILURE FOR $DATE" alertxebec < $LOGFILE
else
#we have success
mailx -s "XEBEC FTP LOG FILE FOR $DATE" gwild@mydomain.com< $LOGFILE
fi


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Peter Godron
Honored Contributor

Re: Script Needed for Paging support when application is down

Hi,
is this problem now solved.
Could you please award points and close.