updated systemctl path, fixed mysql & php conf
This commit is contained in:
11
conf.sh
11
conf.sh
@@ -33,7 +33,7 @@ fi
|
||||
systemctl stop monit
|
||||
|
||||
curl --retry 7 --retry-delay 5 -s "$mrepo"/raw/branch/"$mbranch"/conf/monit/monitrc -o $monitconf
|
||||
curl --retry 7 --retry-delay 5 -s "$mrepo"/raw/branch/"$mbranch"/conf/monit/monitwebsocket -o /conf/monit/websocket
|
||||
curl --retry 7 --retry-delay 5 -s "$mrepo"/raw/branch/"$mbranch"/conf/monit/monitwebsocket -o /etc/monit/websocket
|
||||
touch /opt/MonitNotify.sh
|
||||
chmod +x /opt/MonitNotify.sh
|
||||
|
||||
@@ -58,7 +58,7 @@ fi
|
||||
|
||||
if echo "$SysServiceList" | grep -Fq "$monitMysqlserv"; then
|
||||
curl --retry 7 --retry-delay 5 -s "$mrepo"/raw/branch/"$mbranch"/conf/monit/mysql.conf -o /etc/monit/conf.d/mysql.conf
|
||||
sed -i "s/MYSQLserv/$monitMysqlservice/g" /etc/monit/conf.d/mysql.conf
|
||||
sed -i "s/MYSQLserv/$monitMysqlserv/g" /etc/monit/conf.d/mysql.conf
|
||||
fi
|
||||
|
||||
if echo "$SysServiceList" | grep -Fq 'nginx'; then
|
||||
@@ -67,10 +67,11 @@ fi
|
||||
|
||||
if echo "$SysServiceList" | grep -Fq "$phpFPMService" && test ! -z "$phpFPMService"; then
|
||||
curl --retry 7 --retry-delay 5 -s "$mrepo"/raw/branch/"$mbranch"/conf/monit/php-fpm.conf -o /etc/monit/conf.d/php"$phpver".conf
|
||||
sed -i "s/PHPpid/$monitPhpPid/g" /etc/monit/conf.d/php"$phpver".conf
|
||||
sed -i "s/PHPpro/$monitPhpPro/g" /etc/monit/conf.d/php"$phpver".conf
|
||||
sed -i "s#PHPpid#$monitPhpPid#g" /etc/monit/conf.d/php"$phpver".conf
|
||||
sed -i "s#PHPpro#$monitPhpPro#g" /etc/monit/conf.d/php"$phpver".conf
|
||||
sed -i "s#PHPsock#$monitPhpSock#g" /etc/monit/conf.d/php"$phpver".conf
|
||||
sed -i "s/PHPsrv/$phpFPMService/g" /etc/monit/conf.d/php"$phpver".conf
|
||||
sed -i "s/PHPsock/$monitPhpSock/g" /etc/monit/conf.d/php"$phpver".conf
|
||||
sed -i "s/PHPver/$phpver/g" /etc/monit/conf.d/php"$phpver".conf
|
||||
fi
|
||||
|
||||
if echo "$SysServiceList" | grep -Fq "$apacheService" && test ! -z "$apacheService"; then
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
check process APApro with pidfile /var/run/APAserv/APAserv.pid
|
||||
start program = "/usr/bin/systemctl start APAserv"
|
||||
stop program = "/usr/bin/systemctl stop APAserv"
|
||||
start program = "/bin/systemctl start APAserv"
|
||||
stop program = "/bin/systemctl stop APAserv"
|
||||
if not exist for 1 cycles then restart
|
||||
if not exist for 3 cycles then exec "/opt/MonitNotify.sh 'SRV-WARN: Apache'"
|
||||
else if recovered then exec "/opt/MonitNotify.sh 'SRV-OK: Apache'"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
check process fail2ban with pidfile /var/run/fail2ban/fail2ban.pid
|
||||
start program = "/usr/bin/systemctl start fail2ban"
|
||||
stop program = "/usr/bin/systemctl stop fail2ban"
|
||||
start program = "/bin/systemctl start fail2ban"
|
||||
stop program = "/bin/systemctl stop fail2ban"
|
||||
if failed unixsocket /var/run/fail2ban/fail2ban.sock then restart
|
||||
if failed unixsocket /var/run/fail2ban/fail2ban.sock for 3 cycles then exec "/opt/MonitNotify.sh 'SRV-WARN: Fail2Ban Socket'"
|
||||
else if recovered then exec "/opt/MonitNotify.sh 'SRV-OK: Fail2Ban Socket'"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
check process mysqld with pidfile /var/run/mysqld/mysqld.pid
|
||||
start program = "/usr/bin/systemctl start MYSQLserv"
|
||||
stop program = "/usr/bin/systemctl stop MYSQLserv"
|
||||
start program = "/bin/systemctl start MYSQLserv"
|
||||
stop program = "/bin/systemctl stop MYSQLserv"
|
||||
if failed unixsocket /var/run/mysqld/mysqld.sock protocol mysql for 2 times within 5 cycles then restart
|
||||
if failed unixsocket /var/run/mysqld/mysqld.sock protocol mysql for 4 times within 5 cycles then exec "/opt/MonitNotify.sh 'SRV-WARN: MySQL Socket'"
|
||||
else if recovered then exec "/opt/MonitNotify.sh 'SRV-OK: MySQL Socket"
|
||||
else if recovered then exec "/opt/MonitNotify.sh 'SRV-OK: MySQL Socket'"
|
||||
|
||||
if not exist for 1 cycles then restart
|
||||
if not exist for 3 cycles then exec "/opt/MonitNotify.sh 'SRV-WARN: MySQL service'"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
check process nginx with pidfile /var/run/nginx.pid
|
||||
start program = "/usr/bin/systemctl start nginx"
|
||||
stop program = "/usr/bin/systemctl stop nginx"
|
||||
start program = "/bin/systemctl start nginx"
|
||||
stop program = "/bin/systemctl stop nginx"
|
||||
if not exist for 1 cycles then restart
|
||||
if not exist for 3 cycles then exec "/opt/MonitNotify.sh 'SRV-WARN: Nginx"
|
||||
else if recovered then exec "/opt/MonitNotify.sh 'SRV-OK: Nginx'"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
check process PHPpro with pidfile PHPpid
|
||||
start program = "/usr/bin/systemctl start PHPsrv"
|
||||
stop program = "/usr/bin/systemctl stop PHPsrv"
|
||||
start program = "/bin/systemctl start PHPsrv"
|
||||
stop program = "/bin/systemctl stop PHPsrv"
|
||||
if failed unixsocket PHPsock then restart
|
||||
if failed unixsocket PHPsockfor 3 cycles then exec "/opt/MonitNotify.sh 'SRV-WARN: phpPHPver-fpm socket'"
|
||||
if failed unixsocket PHPsock for 3 cycles then exec "/opt/MonitNotify.sh 'SRV-WARN: phpPHPver-fpm socket'"
|
||||
else if recovered then exec "/opt/MonitNotify.sh 'SRV-OK: phpPHPver-fpm socket'"
|
||||
|
||||
if not exist for 1 cycles then restart
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
check process sshd with pidfile /var/run/sshd.pid
|
||||
start program = "/usr/bin/systemctl start sshd"
|
||||
stop program = "/usr/bin/systemctl stop sshd"
|
||||
start program = "/bin/systemctl start sshd"
|
||||
stop program = "/bin/systemctl stop sshd"
|
||||
if not exist for 1 cycles then restart
|
||||
if not exist for 3 cycles then exec "/opt/MonitNotify.sh 'SRV-WARN: SSHD'"
|
||||
else if recovered then exec "/opt/MonitNotify.sh 'SRV-OK: SSHD'"
|
||||
|
||||
Reference in New Issue
Block a user