detect-hung.sh
If you're running apps written with #radiator, you might run into this error on occasion:
W, [2018-02-09T03:06:18.671911 #1622] WARN -- : database_api.get_account_history :: SSL Error (SSL_connect SYSCALL returned=5 errno=0 state=error: certificate verify failed), retrying ...
Normally, this might happen once in a while and recover right away. But sometimes, you'll see it happen over and over in a short period of time and never recover.
It can also happen if there's a "man-in-the-middle" attack or some other security breach, but that's pretty rare.
If it only happens once in a while, it's probably a reverse proxy timeout that happens during the response, instead of properly returning HTTP Code 502.
But if it happens over and over in a short period of time, it's probably your local machine running out of resources. There are too many file handles open, and it can't open the certificate.
Here's a script that will detect the problem (detect-hung.sh):
#!/bin/bash
cd $HOME/path/to/your/app
count=$((tail -2000 debug.log | grep "certificate verify failed" | wc -l))
if [[ $count -eq 1 ]] ; then
exit 0
fi
exit $count
You'll need to change /path/to/your/app and debug.log to the correct values for your app.
This script will also work with monit. Just add the following definition to /etc/monit/monitrc:
check program "detect-hung" with path "/home/your-user/scripts/detect-hung.sh"
uid your-user
gid your-user
if status != 0 for 2 cycles then alert
every 2 cycles
group your-app
You'll also have to use the correct values for your-user and your-app.
Leave detect-hung.sh to:
Read more #bots posts
Best Posts From ami18
We have not curated any of ami18's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From ami18
- Little swimming kid
- another image of Syrian crisis
- 시리아 위기와 시리아 어린이들의 삶 Syria crisis going beyond too worst ever in history
- holi 색의 축제
- 가장 위대한 왕 the greatest king in history
- The End of Language. Badeshi
- Tree with too much irregular branches
- Drone view: Spectacular and eye-catch view of Aurangabad ijtema
- Infinite Windows of infinite wall
- Illusion of the wall
- weapons of peshawa's
- Architecture of Golden Buddhist temple in Myanmar Shwedagon Pagoda
- photography by me: micro-photography.
- Decorative Structure
- Oleander the one of the most Dangerous poisoning plant.
- winter night in Norway
- beauty with a purpose #1 minute read.
- A purpose of every thing 모든 것이 유용하다.
- Cuteness overloaded.
- Unity in diversity