Re: Getting False Tomcat Down Alert

2024-01-03 Thread Christopher Schultz
Olaf, On 1/3/24 09:52, Olaf Kock wrote: On 03.01.24 15:34, Christopher Schultz wrote: Olaf, +1 The regular expression used with grep should be improved a lot. I would recommend at least the following: STAT=`netstat -luptn 2>/dev/null | grep '^tcp.*:8080[^:0-9]' | awk '{print $6}'` ...or

Re: Getting False Tomcat Down Alert

2024-01-03 Thread Olaf Kock
On 03.01.24 15:34, Christopher Schultz wrote: Olaf, +1 The regular expression used with grep should be improved a lot. I would recommend at least the following: STAT=`netstat -luptn 2>/dev/null | grep '^tcp.*:8080[^:0-9]' | awk '{print $6}'` ...or omit the UDP output by using "netstat -lp

Re: Getting False Tomcat Down Alert

2024-01-03 Thread Christopher Schultz
Olaf, On 1/3/24 04:18, Olaf Kock wrote: Here's an option: On 03.01.24 09:41, Chaudhary, Mohit wrote: 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

Re: Getting False Tomcat Down Alert

2024-01-03 Thread Olaf Kock
On 03.01.24 10:18, Olaf Kock wrote: Here's an option: On 03.01.24 09:41, Chaudhary, Mohit wrote: 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

Re: Getting False Tomcat Down Alert

2024-01-03 Thread Olaf Kock
Here's an option: On 03.01.24 09:41, Chaudhary, Mohit wrote: 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" $ma

RE: Getting False Tomcat Down Alert

2024-01-03 Thread Chaudhary, Mohit
t; $mailto < $MESSAGE Thanks & Regards, Mohit Chaudhary -Original Message- From: Olaf Kock 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 a

Re: Getting False Tomcat Down Alert

2024-01-03 Thread Olaf Kock
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 ser

Getting False Tomcat Down Alert

2024-01-02 Thread Chaudhary, Mohit
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 wa