Hi, Please find below script code which has been written.
STAT=`netstat -luptn | grep 8080 | awk '{print $6}'` if [[ "$STAT" != "LISTEN" ]]; then echo "Tomcat instance down" >> $MESSAGE mail -s "Tomcat Instance Down on $HOSTNAME" $mailto < $MESSAGE Thanks & Regards, Mohit Chaudhary -----Original Message----- From: Olaf Kock <tom...@olafkock.de> Sent: Wednesday, January 3, 2024 2:03 PM To: users@tomcat.apache.org Subject: Re: Getting False Tomcat Down Alert [You don't often get email from tom...@olafkock.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] On 03.01.24 07:55, Chaudhary, Mohit wrote: > > Hello Team, > > We have RHEL 6.10 server and configured custom script in crontab to > check 8080 port is up or not, if 8080 is down then getting email > alert. But some time we are facing the false alert for 2 to 3 min. > When we are checking the tomcat services it was up and running fine > and nothing was written in logs also. > > So is it possible that 8080 port will be down for few minutes when > tomcat is facing heavy traffic? Or what will be the reason for facing > the false alert?. > To me, the question is rather: *How* does your custom script check port 8080 being up? Because you say that you're checking as well, and this result disagrees with the result of the manual check. With two different results, I'd first inspect the custom script for its behavior, and suspect it to generate a false positive. It being a script implies that you might be able to share it (or the relevant parts of it) here (?) Olaf --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org