diff --git a/HowtoApache.md b/HowtoApache.md index f9b69d93..5e391338 100644 --- a/HowtoApache.md +++ b/HowtoApache.md @@ -1049,6 +1049,34 @@ ExtendedStatus On ~~~ +#### Sauvegarde automatique du server-status + +Placer le code suivant dans un fichier tel que /usr/share/scripts/save_apache_status.sh + +~~~ +#!/bin/bash + +set -e + +DIR=/var/log/apache-status +URL=http://127.0.0.1/server-status-XXXX +TS=`date +%Y%m%d%H%M%S` +FILE="$DIR/$TS.html" + +mkdir -p $DIR +curl -s $URL > $FILE +chmod 640 $FILE +find $DIR -type f -mtime +1 -delete + +exit 0 +~~~ + +Il sera ensuite appelé dans une tâche cron de root : + +~~~ +* * * * * /usr/share/scripts/save_apache_status.sh +~~~ + ### Munin Pour activer les plugins Munin pour Apache :