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
set daemon 60 #check services every 60 seconds | |
set logfile /var/log/monit.log | |
set idfile /var/lib/monit/id | |
set statefile /var/lib/monit/state | |
#Event queue | |
set eventqueue | |
basedir /var/lib/monit/events # set the base directory where events will be stored | |
slots 100 # optionally limit the queue size |
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
### example.tld | |
check host example.tld with address www.example.tld | |
# ICMP check | |
if failed icmp type echo | |
for 2 times within 2 cycles | |
then alert | |
# HTTP check | |
if failed port 80 protocol http |
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
# Apache2 | |
check process apache2 with pidfile /var/run/apache2/apache2.pid | |
group www-data | |
start program = "/bin/systemctl start apache2" with timeout 30 seconds | |
stop program = "/bin/systemctl stop apache2" | |
if failed host localhost port 80 with protocol http | |
and request "/server-status" for 2 times within 2 cycles then restart | |
depend apache_bin | |
depend apache_rc | |
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
### example.tld | |
check host example.tld with address www.example.tld | |
# ICMP check | |
if failed icmp type echo | |
for 2 times within 2 cycles | |
then alert | |
# HTTP check | |
if failed port 80 protocol http |
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
# Varnish | |
check program varnishpanic with path "/bin/varnishadm panic.show" | |
if status != 1 then alert | |
check process varnish with pidfile /var/run/varnish.pid | |
#start program = "/etc/init.d/varnish start" with timeout 30 seconds | |
#stop program = "/etc/init.d/varnish stop" | |
start program = "/usr/bin/systemctl start varnish" with timeout 30 seconds | |
stop program = "/usr/bin/systemctl stop varnish" | |
if failed host 127.0.0.1 port 80 protocol http |
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
#!/usr/bin/env bash | |
## WordPress Plugin Installer using BASH and WP-CLI | |
# Make executable: chmod u+x wp-plugins | |
# remember change WPPATH | |
# array of plugin slugs to install | |
WPPLUGINS=( | |
advanced-database-cleaner basepress categorytinymce classic-editor code-snippets change-last-modified-date disqus-comment-system |
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
#!/usr/bin/env bash | |
# | |
# install WP CLI at your home-dir. Change if you want something else | |
# make executable: chmod u+x wpcli.sh | |
# use ./wpcli.sh | |
# | |
mkdir ~/wp-cli | |
wget -q https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -O ~/wp-cli/wp | |
chmod 755 ~/wp-cli/wp | |
export PATH="$PATH:~/wp-cli" |
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
#!/usr/bin/env bash | |
# | |
# Backup your widgets before you give a try to new theme | |
# | |
# https://guides.wp-bullet.com/using-wp-cli-backup-restore-wordpress-widgets/ | |
# | |
# create array of all widgets in the wp_options table | |
WIDGETSARRAY=($(wp db query "SELECT option_name FROM $(wp db prefix --allow-root)options WHERE option_name LIKE 'widget\_%'" --skip-column-names --allow-root)) | |
# loop through widgets |
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
#!/usr/bin/env bash | |
# | |
# Restore your widgets after tried new theme | |
# | |
# https://guides.wp-bullet.com/using-wp-cli-backup-restore-wordpress-widgets/ | |
# | |
# loop through widget backups | |
for WIDGETBACKUP in /tmp/widgets/*.txt | |
do | |
# extract filename |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"logs:CreateLogGroup", | |
"logs:CreateLogStream", | |
"logs:PutLogEvents" | |
], |