Created
July 20, 2019 06:33
-
-
Save ankitdbst/73398b8ffc280838dd2ceb3775de21a1 to your computer and use it in GitHub Desktop.
Monitor Nginx + Magento server logs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Stopping monitoring if running..." | |
./stop-monit.sh | |
declare WEBHOOK="https://hooks.slack.com/services/..."; # your web-hook | |
echo "Starting monitoring..." | |
nohup ./tail-slack.sh /var/log/nginx/access.log $WEBHOOK " 50[0-3]\{1\} \| 40[0-3]\{1\} " >/dev/null 2>&1 & | |
nohup ./tail-slack.sh /var/log/nginx/error.log $WEBHOOK "[error]" >/dev/null 2>&1 & | |
nohup ./tail-slack.sh /var/www/html/current/var/log/exception.log $WEBHOOK "main\.ERROR\|main\.CRITICAL" >/dev/null 2>&1 & | |
nohup ./tail-slack.sh /var/www/html/current/var/log/system.log $WEBHOOK "main\.ERROR\|main\.CRITICAL" >/dev/null 2>&1 & | |
echo "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment