Hi All.
I have scheduled the script below in cron (Solaris 8). This script is supported to monitor the output of the websphere was-stat command and send a page out if it finds that one of the JVMs in the JVM_list.txt is down.
#!/bin/ksh
mailbox=pager_name
cat JVM_list.txt | while read i
do
was-stat | grep $i > /dev/null 2>&1
if [ $? -ne "0" ]; then
mailx -s "The JVM $i is down on server `hostname`" $mailbox
##echo "The JVM $i is down on server `hostname`"
else
echo " The JVM $i is up on the server `hostname`"
fi
done
The Cron entry is as follows
05 * * * 1-5 /path/to/script/jvmscript/server_name_jvm_monitor.sh > /dev/null 2>&1
The issue is that if I run the script interactively, it works.
but crontab does not seem to be initiating the script as I tried bringning a JVM down and I did not recieve a page.
The script is supposed to run every 5 mins on weekdays.
Can someone look at it and the script and help me debug.
Thanks
Segwar