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 |
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/sh | |
# | |
# cron ex: 0 */6 * * * /usr/bin/nice -n 19 /usr/bin/ionice -c2 -n7 /root/scripts/coast-guard-observer.sh >> /root/scripts/cron.log | |
dir="/tmp/" | |
file="/var/www/clients/client*/web*/web" | |
email="" | |
pattern="vicodin|viagra|xanax|valium|silagra|kamagra|propranolol|celexa|albendazole|propecia|ampicillin|amoxil|neurontin|levitra|pharmacy|rolex|casino|cialis " # Need regexp for occurence like cialis (prevent specialist word) | |
# TODO: Add whitelist | |
#whitelist="" |
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 3 1 * * /usr/bin/nice -n 19 /usr/bin/ionice -c2 -n7 /root/scripts/backup-dbispconfig.sh >> /root/scripts/cron.log | |
DIR="/root/backup/" | |
MYSQLUSER="" # FOR SECURITY REASONS, CREATE AN READ ONLY USER FOR BACKUP! | |
# eg (as root): CREATE USER 'backup'@'localhost' IDENTIFIED BY 'RANDOMPASSWORD'; GRANT SELECT ON dbispconfig.* TO 'backup'@'localhost'; FLUSH PRIVILEGES; | |
MYSQLPASSWORD="" | |
MYSQLDATABASE="dbispconfig" | |
DATE=$(date +"%Y%m%d") |
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/sh | |
# | |
# cron ex: 0 0 1 * * /usr/bin/nice -n 19 /usr/bin/ionice -c2 -n7 /root/scripts/mysql-health.sh >> /root/scripts/cron.log | |
/usr/bin/mysqlcheck --silent --defaults-file=/etc/mysql/debian.cnf --auto-repair --optimize --all-databases |
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: 15 5 * * * /usr/bin/nice -n 19 /usr/bin/ionice -c2 -n7 /root/scripts/vzdump-purge.sh >> /root/scripts/cron.log | |
path='' | |
# Search files more than 14 days and remove it | |
find $path -type f -ctime +14 -delete |
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
input { | |
file { | |
path => "/var/log/fail2ban.log" | |
type => "fail2ban" | |
} | |
} | |
filter { | |
if [type] == "fail2ban" { | |
grok { |
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
# Processes iostat output | |
# >iostat -d -m -x sda sdb 1 | bin/logstash -f iostat.conf | |
# | |
# Sample Output: | |
# | |
# Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await svctm %util | |
# sda 3.36 174.28 9.64 183.71 65.17 1431.99 15.49 0.61 3.16 0.09 1.65 | |
# sdb 0.00 0.00 742.87 4110.46 5830.48 16441.82 9.18 4.90 0.98 0.11 55.45 | |
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: 25 5 * * * /usr/bin/nice -n 19 /usr/bin/ionice -c2 -n7 /root/scripts/gzed-log-purge.sh >> /root/scripts/cron.log | |
# Search files more than 14 days with .gz extension and remove it | |
find /var/log -type f -ctime +7 -regex ".*\.gz$" -delete |
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: */30 * * * * /usr/bin/nice -n 19 /usr/bin/ionice -c2 -n7 /root/scripts/survey-semaphore-ispconfig.sh >> /root/scripts/cron.log | |
email="" | |
# file exist? | |
if [ -f /usr/local/ispconfig/server/temp/.ispconfig_lock ] | |
then | |
# have a correct ttl? |
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/sh | |
# | |
# cron ex: * * * * * /usr/bin/nice -n 19 /usr/bin/ionice -c2 -n7 /root/scripts/check-mountpoint.sh >> /root/scripts/cron.log | |
# mountpoint must be present in fstab | |
mountpoint=" /mnt/endpoint" # use space before (prevent mountpoint as source) | |
email="" | |
if [ -z "$(grep $mountpoint /proc/mounts)" ]; then | |
# we use space before, prevent mountpoint as source |