Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Language specific forums Russian (Русский) Общие вопросы
  • Search

Автоматический рестарт MySQL и Apache

Общие вопросы о панели управления Vesta
Post Reply
  • Print view
Advanced search
14 posts
  • Previous
  • 1
  • 2
skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Автоматический рестарт MySQL и Apache
  • Quote

Post by skurudo » Wed Jul 01, 2015 1:10 pm

Mr.Erbutw wrote:«Огород не огород» точнее нужно было формулировать вопрос автору ... а вышло совсем подругому.
C'est la vie, камрад :)
Top

Kirill
Posts: 122
Joined: Tue Jan 27, 2015 7:23 am

Re: Автоматический рестарт MySQL и Apache
  • Quote

Post by Kirill » Wed Jul 01, 2015 3:52 pm

skurudo wrote:
Kirill wrote: Подскажите в конфиге monit просто нужное раскомментировать. Допустим для для Apache и MySQL:
В принципе да, но я уже просто удаляю все лишнее и ставлю свое. Давайте я покажу, так будет визуально поменятнее:
/etc/monit.confShow

Code: Select all

set daemon  60
set logfile /var/log/monit.log
set logfile syslog facility log_daemon
set mailserver localhost
set alert [email protected] with mail-format {
              from:     [email protected]
              subject:  OVH8 - $SERVICE $EVENT at $DATE
              message:  Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION.

ZA RABOTU!

      }

set httpd port 10001 and
#SSL ENABLE
#PEMFILE  /var/certs/monit.pem
allow sku:password4monit

check filesystem hdd with path /
if space usage > 70% then alert
if inode usage > 80% then alert

check system domain.com
  if loadavg (1min) > 7 then alert
  if loadavg (5min) > 5 then alert
  if memory usage > 85% then alert
  if cpu usage (user) > 90% then alert
  if cpu usage (system) > 90% then alert
  if cpu usage (wait) > 80% then alert

check process proftpd with pidfile /var/run/proftpd.pid
start program = "/etc/init.d/proftpd start"
stop program  = "/etc/init.d/proftpd stop"
if failed port 21 protocol ftp for 32 cycles then alert
#if failed port 21 protocol ftp for 64 cycles then restart
if 15 restarts within 15 cycles then timeout

check process sshd with pidfile /var/run/sshd.pid
start program  "/etc/init.d/sshd start"
stop program  "/etc/init.d/sshd stop"
if failed port 22 protocol ssh for 7 cycles then alert
if failed port 22 protocol ssh for 15 cycles then restart
if 15 restarts within 15 cycles then timeout

check process mysql with pidfile /var/run/mysqld/mysqld.pid
start program = "/etc/init.d/mysqld start"
stop program = "/etc/init.d/mysqld stop"
if failed host 127.0.0.1 port 3306 for 5 cycles then alert
if cpu usage > 30% for 10 cycles then alert
if cpu usage > 50% for 10 cycles then alert
if 15 restarts within 15 cycles then timeout

check process httpd with pidfile /var/run/httpd.pid
start program = "/etc/init.d/httpd start"
stop program = "/etc/init.d/httpd stop"
if failed host 192.168.0.1  port 80 for 5 cycles then alert
if 15 restarts within 15 cycles then timeout
host 192.168.0.1 - может быть ваш адрес или сайт
Kirill wrote:Файл /etc/monit.d/httpd необходимо тоже создать для записи директив для перезагрузки? Или не надо его создавать.
Можно делать и отдельными модулями там, но я предпочитаю в одном файле, особенно когда проверок не так много. Вариант, о котором вы говорите, это когда много сервисов проверяется, чтобы все в одном конфиге не городить.
Огромное спасибо !!!
Top

rogerio.dobler
Posts: 10
Joined: Tue Jul 15, 2014 1:34 pm

Re: Автоматический рестарт MySQL и Apache
  • Quote

Post by rogerio.dobler » Wed Aug 17, 2016 12:32 am

skurudo wrote:
Kirill wrote: Подскажите в конфиге monit просто нужное раскомментировать. Допустим для для Apache и MySQL:
В принципе да, но я уже просто удаляю все лишнее и ставлю свое. Давайте я покажу, так будет визуально поменятнее:
/etc/monit.confShow

Code: Select all

set daemon  60
set logfile /var/log/monit.log
set logfile syslog facility log_daemon
set mailserver localhost
set alert [email protected] with mail-format {
              from:     [email protected]
              subject:  OVH8 - $SERVICE $EVENT at $DATE
              message:  Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION.

ZA RABOTU!

      }

set httpd port 10001 and
#SSL ENABLE
#PEMFILE  /var/certs/monit.pem
allow sku:password4monit

check filesystem hdd with path /
if space usage > 70% then alert
if inode usage > 80% then alert

check system domain.com
  if loadavg (1min) > 7 then alert
  if loadavg (5min) > 5 then alert
  if memory usage > 85% then alert
  if cpu usage (user) > 90% then alert
  if cpu usage (system) > 90% then alert
  if cpu usage (wait) > 80% then alert

check process proftpd with pidfile /var/run/proftpd.pid
start program = "/etc/init.d/proftpd start"
stop program  = "/etc/init.d/proftpd stop"
if failed port 21 protocol ftp for 32 cycles then alert
#if failed port 21 protocol ftp for 64 cycles then restart
if 15 restarts within 15 cycles then timeout

check process sshd with pidfile /var/run/sshd.pid
start program  "/etc/init.d/sshd start"
stop program  "/etc/init.d/sshd stop"
if failed port 22 protocol ssh for 7 cycles then alert
if failed port 22 protocol ssh for 15 cycles then restart
if 15 restarts within 15 cycles then timeout

check process mysql with pidfile /var/run/mysqld/mysqld.pid
start program = "/etc/init.d/mysqld start"
stop program = "/etc/init.d/mysqld stop"
if failed host 127.0.0.1 port 3306 for 5 cycles then alert
if cpu usage > 30% for 10 cycles then alert
if cpu usage > 50% for 10 cycles then alert
if 15 restarts within 15 cycles then timeout

check process httpd with pidfile /var/run/httpd.pid
start program = "/etc/init.d/httpd start"
stop program = "/etc/init.d/httpd stop"
if failed host 192.168.0.1  port 80 for 5 cycles then alert
if 15 restarts within 15 cycles then timeout
host 192.168.0.1 - может быть ваш адрес или сайт
Kirill wrote:Файл /etc/monit.d/httpd необходимо тоже создать для записи директив для перезагрузки? Или не надо его создавать.
Можно делать и отдельными модулями там, но я предпочитаю в одном файле, особенно когда проверок не так много. Вариант, о котором вы говорите, это когда много сервисов проверяется, чтобы все в одном конфиге не городить.

how do I access the url in my browser, I'm trying to access http://mydomain.com:10001

more is not opening the page monit
msokolov wrote:Можно конфиги для Ubuntu 14.04 выложить
skid wrote:Извините пожалуйста, поторопился.

Code: Select all

 yum -y install monit
chkconfig monit on

# Vesta Control Panel
wget http://c.vestacp.com/0.9.8/rhel/monit/vesta-nginx.conf -O /etc/monit.d/vesta-nginx.conf
wget http://c.vestacp.com/0.9.8/rhel/monit/vesta-php.conf -O /etc/monit.d/vesta-php.conf

# Nginx
wget http://c.vestacp.com/0.9.8/rhel/monit/nginx.conf -O /etc/monit.d/nginx.conf

# Apache
wget http://c.vestacp.com/0.9.8/rhel/monit/httpd.conf -O /etc/monit.d/httpd.conf

# MySQL
wget http://c.vestacp.com/0.9.8/rhel/monit/mysql.conf -O /etc/monit.d/mysql.conf

# Exim
wget http://c.vestacp.com/0.9.8/rhel/monit/exim.conf -O /etc/monit.d/exim.conf

# Dovecot
wget http://c.vestacp.com/0.9.8/rhel/monit/dovecot.conf -O /etc/monit.d/dovecot.conf

# ClamAV
wget http://c.vestacp.com/0.9.8/rhel/monit/clamd.conf -O /etc/monit.d/clamd.conf

# Spamassassin
wget http://c.vestacp.com/0.9.8/rhel/monit/spamassassin.conf -O /etc/monit.d/spamassassin.conf

# OpenSSH
wget http://c.vestacp.com/0.9.8/rhel/monit/sshd.conf -O /etc/monit.d/sshd.conf

service monit start
I installed according to the manual up, but it seems that is lacking something to be able to open in the browser page monit
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Автоматический рестарт MySQL и Apache
  • Quote

Post by skurudo » Wed Oct 26, 2016 7:46 am

rogerio.dobler wrote:I installed according to the manual up, but it seems that is lacking something to be able to open in the browser page monit
You forgot about firewall, I think.

PS: In future try to make another post in english part of forum ;-)
Top


Post Reply
  • Print view

14 posts
  • Previous
  • 1
  • 2

Return to “Общие вопросы”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password