Last active
February 19, 2018 10:22
-
-
Save alexalouit/5745c360ff65a328232d to your computer and use it in GitHub Desktop.
HTTPD (Apache and Nginx) regular email report, vhosts in errors reported
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
#!/bin/bash | |
# | |
# cron ex: 0 * * * * /usr/bin/nice -n 19 /usr/bin/ionice -c2 -n7 /root/scripts/httpd-errors.sh >> /root/scripts/cron.log | |
email="" | |
if [ -f /etc/apache2/sites-available/*.err ] | |
then | |
CONTAIN=$(ls -lah /etc/apache2/sites-available/*.err) | |
echo -e "Erreur du serveur apache, vhost:\n $CONTAIN" | mail -s "Rapport d'erreur Apache" $email | |
fi | |
if [ -f /etc/nginx/sites-available/*.err ] | |
then | |
CONTAIN=$(ls -lah /etc/nginx/sites-available/*.err) | |
echo -e "Erreur du serveur nginx, vhost:\n $CONTAIN" | mail -s "Rapport d'erreur Nginx" $email | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment