![]() Linux resource monitoring and some tuning tips ![]() This will link the file there, same file will act as if it is there too.> Resource and service monitoring with Monit $ sudo ln /etc/monit/conf-available/puma /etc/monit/conf-enabled/puma So, we are going to link those files that folder instead of copying/duplicating them. Restart program = "/bin/su - john -c '~/.rvm/bin/rvm default do bundle exec pumactl -S /var/You have to copy the scripts to conf-enabled to have them executed by Monit. Stop program = "/bin/su - john -c '~/.rvm/bin/rvm default do bundle exec pumactl -S /var/www/myapp/production/shared/tmp/pids/puma.state stop'" Restart program = "/bin/su - john -c 'pumactl restart -P /var/www/myapp/production/shared/tmp/pids/puma.pid'" Stop program = "/bin/su - john -c 'pumactl stop -P /var/www/myapp/production/shared/tmp/pids/puma.pid'" Start program = "/bin/su - john -c '~/.rvm/bin/rvm default do bundle exec puma -C /var/www/myapp/production/shared/puma.rb -daemon'" Stop program = "/etc/init.d/postgresql stop" if failed unixsocket /var/run/postgresql/.s.PGSQL.5432 protocol pgsqlĬheck process puma with pidfile /var/www/myapp/production/shared/tmp/pids/puma.pid ![]() Start program = "/etc/init.d/postgresql start" PostGreSQL # /etc/monit/conf-available/pgĬheck process postgres with pidfile /var/run/postgresql/9.5-main.pid Stop program = "/bin/su - deployer -c 'cd /home/deployer/www/staging/current & /usr/local/rvm/bin/rvm default do bundle exec sidekiqctl stop /home/deployer/www/staging/shared/tmp/pids/sidekiq.pid'" with timeout 110 seconds group thepact-sidekiq-0 Start program = "/bin/su - deployer -c 'cd /home/deployer/www/staging/current & /usr/local/rvm/bin/rvm default do bundle exec sidekiq -config /home/deployer/www/staging/current/config/sidekiq.yml -index 0 -e staging -d'" with timeout 30 seconds General Monit Scripts Sidekiq # /etc/monit/conf-available/sidekiqĬheck process sidekiq_thepact_staging0 with pidfile "/home/deployer/www/staging/shared/tmp/pids/sidekiq.pid" You will see a dialog box appear in the browser. Once this is configured, monit should reload and reread the configuration file, and the web interface will be available: $ monit reload Use address 12.34.56.789 # only accept connection from localhostĪllow 0.0.0.0/0.0.0.0 # allow localhost to connect to the server andĪllow admin:monit # require user 'admin' with password 'monit' Once the section is uncommented, write in your server’s IP or domain name as the address, allow anyone to connect and then create a monit user and password # ~/.monitrc set httpd To configure the web interface, find and uncomment the section that begins with set httpd port 2812. Monit comes with it’s own web server running on port 2812. configure -sysconfdir /var/monit/etc will instruct Monit to look for monitrc in the /var/monit/etc directory. In case you have built Monit from its source code, you can specify the location of during the configuration process using the flag. If this file is not found, Monit will attempt to locate it in /etc/monitrc, then and finally in the current directory. The default location for this file is ~/.monitrc. Monit can be configured and managed using a control file called monitrc. ![]() These settings can be altered at the beginning of the configuration file in the set daemon and set logfile lines respectively. By default, it is set up to check that services are running every 2 minutes and stores its log file in “/var/log/monit.log”. Monit is very easy to use nearly out of the box. Typing monit status displays monit’s details: $ monit status Monit can be started up with a command that then keeps it running in the background $ monit Once monit downloads, you can add programs and processes to the configuration file: $ sudo nano /etc/monit/monitrc Monit is easiest to install through apt-get: $ sudo apt-get install monit
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |