Wednesday, April 9, 2008

App Server Monitoring Script

Here I've created a shell script which can show you the status of large number of Application Server domains. Thought of, might be useful for some guys who are looking for the same kind of stuff...

we have two files here
1) param_list.txt -> list of app server domains
2) health.sh -> shell script that checks for the status of the app server domain


# Filename: param_list.txt
# Parameter List file
# Contains the list of environments
DOMAIN1
DOMAIN2
DOMAIN3
DOMAIN4
DOMAIN5
DOMAIN6
DOMAIN7
DOMAIN8


# Filename: health.sh
# Usage: ./health
# !/bin/sh
ENV_COUNTER=0
DATE=`date '+%Y%M%d_%H_%M_%S'`
OUTPUT_FILE='MONITOR_'$DATE

echo "*** Application Server Status as of `date`***" >> $OUTPUT_FILE
echo >> $OUTPUT_FILE
echo >> $OUTPUT_FILE

#while [ $ENV_COUNTER -le 9 ]
#do
for ENV in `cat param_list.txt`
do
TUXCONFIG=$PS_HOME/appserv/$ENV/PSTUXCFG; export TUXCONFIG
TUX_OUT_FILE=$ENV'_TUXOUT'
rm $TUX_OUT_FILE
echo pq | tmadmin -r > $TUX_OUT_FILE 2>&1
echo "*********************************************************" >> $OUTPUT_FILE
echo "*** Status Report for Application Server: $ENV ***" >> $OUTPUT_FILE
echo "**********************************************************" >> $OUTPUT_FILE
echo >> $OUTPUT_FILE
echo pq | tmadmin -r >> $OUTPUT_FILE 2>&1
#echo pclt | tmadmin -r >> $OUTPUT_FILE 2>&1
egrep "No bulletin board exists|ERROR" ${TUX_OUT_FILE} >/dev/null 2>&1
if test $? = 0
then
echo "App Server $ENV Status: DOWN"
echo >> $OUTPUT_FILE
echo "Application Server Status: DOWN" >> $OUTPUT_FILE
else
echo "App Server $ENV Status: UP"
echo >> $OUTPUT_FILE
echo "Application Server Status: UP" >> $OUTPUT_FILE
fi
echo "************************************************************" >> $OUTPUT_FILE
echo >> $OUTPUT_FILE
echo >> $OUTPUT_FILE
done
echo "*** End of Report ***" >> $OUTPUT_FILE

I am still working on it to add some more options like alerts, load, business etc... I will update it once done...

Comments are most welcome...

Cheers!!!


10 comments:

mmaller said...

I liked your script..I have also done in a similar way but have configured it at database level instead of tmadmin

mmaller said...

Liked the Work..Wonderful.Have got the same result but have done at Database Level instead of tmadmin

Rakesh Parwal said...

thx... here is bit refined form:
http://peoplesoft-admin.rakeshparwal.com/2008/04/monitoring-scripts.html

myblogger said...

Hello, I want the script which continuesly monitor oracle application server resources, and write the status in one file, now i require to check this file before app. server have new request, if resource reached at some limit i require to show high usage on portal page. Please provide necessory guidlines.

Achutan said...

Hi,

Good work....I have a requirement.
I would like to receive email alerts whenever application server/webserver is shutdown or restarted.
Do you have any scripts for these?

It would be of grea help..

Thanks,
Sakky

Rakesh Parwal said...

Hi Sakky,

You can use mailx command in the script to send the email notification if you are using Solaris (not sure if it works in other platforms or not)

mailx -s "App Server Down" "xyz@abc.com"

Rakesh...

geetha said...

Thanks for sharing this useful info. Keep updating same way.
Regards,Siddu online Training

Sandeep SEO said...

It is really a very excellent blog find all of your blogs were amazing and awesome...................Please contact us for Oracle Fusion Financials Training

Rajesh said...

Hi, I am really happy to found such a helpful and fascinating post that is written in a good manner. Thanks for sharing such an informative post.
Oracle Fusion PPM Training in Hyderabad

Sannihitha Technologies said...

thanks for sharing this article to us ,it is very nice article Thanks for sharing the details!...best regards.
Linux Training in Hyderabad

OCI - Attach Block Volume to Windows VM

Tip: Although creating and attaching Block Storage to a Windows VM is pretty straightforward (OCI documentation is pretty good for that), th...