SlideShare uma empresa Scribd logo
1 de 13
Baixar para ler offline
Monitoring for Web
Applications
Контроль и мониторинг Linux процессов
для Рython разработчиков
Linux processes control and monitoring
•sudo apt-get install nginx
•ls /etc/init.d/nginx
•sudo service nginx restart
•sudo apt-get install mongodb-10gen
•ls /etc/init.d/mongodb
•sudo service mongodb status
•ls /etc/mongodb.conf
•sudo apt-get install rabbitmq-server
•ls /etc/init.d/rabbitmq-server
•service rabbitmq-server status
Monitoring system which just works
•sudo apt-get install monit
•ls /etc/init.d/monit
•service monit status
•cat sudo cat /etc/monit/monitrc
1.set daemon 120 # check services at 2-minute intervals
2.set logfile /var/log/monit.log
1.check process nginx with pidfile /var/run/nginx.pid
2. start program = "/etc/init.d/nginx start"
3. stop program = "/etc/init.d/nginx stop"
4. if failed port 80 protocol http then alert
5. if cpu usage is greater than 60 percent for 2 cycles
6. then alert
7. if cpu usage > 98% for 5 cycles then restart
8. if 2 restarts within 3 cycles then timeout
9. alert admin@bar.com
Installation & Configuration
Monit Web Server
MongoDB process detail
•/home/user/venv/bin/pip install tornado
•ls venv/lib/python2.7/site-packages/tornado
•venv/bin/python my_web_project/app.py
•/home/user/venv/bin/pip install celery
•ls venv/lib/python2.7/site-packages/celery
•venv/bin/celery worker -A myproject.tasks --
config=myproject.celeryconfig
Virtualev based Python stack
A process control system
•supervisord
•supervisorctl
•Web Server
•XML RPC Interface
•/home/user/venv/bin/pip install supervisor
•ls venv/lib/python2.7/site-packages/supervisor
•/venv/bin/echo_supervisord_conf > supervisord.conf
•venv/bin/supervisord -c supervisord.conf
•venv/bin/supervisorctl -c supervisord.conf shutdown
Supervisor Web Interface
Configuring Supervisor
Celery supervisor config
Plugin source code

Mais conteúdo relacionado

Mais procurados

Debconf14 : Putting some salt in your Debian systems -- Julien Cristau
Debconf14 : Putting some salt in your Debian systems -- Julien CristauDebconf14 : Putting some salt in your Debian systems -- Julien Cristau
Debconf14 : Putting some salt in your Debian systems -- Julien CristauLogilab
 
SnortReport Presentation
SnortReport PresentationSnortReport Presentation
SnortReport Presentationwebhostingguy
 
Inspector - Node.js : Notes
Inspector - Node.js : NotesInspector - Node.js : Notes
Inspector - Node.js : NotesSubhajit Sahu
 
Asus WL500gP USB Serial
Asus WL500gP USB SerialAsus WL500gP USB Serial
Asus WL500gP USB Serialguestac21b8
 
Install Cuckoo on Mac OS X
Install Cuckoo on Mac OS XInstall Cuckoo on Mac OS X
Install Cuckoo on Mac OS XMohd Khairulazam
 
Ip sec vpn with dynamic routing mikrotik and cisco - mikro-tik wiki
Ip sec vpn with dynamic routing   mikrotik and cisco - mikro-tik wikiIp sec vpn with dynamic routing   mikrotik and cisco - mikro-tik wiki
Ip sec vpn with dynamic routing mikrotik and cisco - mikro-tik wikiHuy Eav
 
Configure a Riak Cluster
Configure a Riak ClusterConfigure a Riak Cluster
Configure a Riak ClusterJeffrey Kirkell
 
Openstack installation using rdo multi node
Openstack installation using rdo multi nodeOpenstack installation using rdo multi node
Openstack installation using rdo multi nodeNarasimha sreeram
 
Openstack kilo installation using rdo
Openstack kilo installation using rdoOpenstack kilo installation using rdo
Openstack kilo installation using rdoNarasimha sreeram
 
Salt Stack pt. 2 : Configuration Management
Salt Stack pt. 2 : Configuration ManagementSalt Stack pt. 2 : Configuration Management
Salt Stack pt. 2 : Configuration ManagementUmberto Nicoletti
 
NodeMCU setup LUA
NodeMCU setup LUANodeMCU setup LUA
NodeMCU setup LUA숭 김
 
FreeBSD preseed installation (PXE) AsiaBSDCon 2015
FreeBSD preseed installation (PXE) AsiaBSDCon 2015FreeBSD preseed installation (PXE) AsiaBSDCon 2015
FreeBSD preseed installation (PXE) AsiaBSDCon 2015Kamil Czekirda
 
Installing OpenStack Juno using RDO on RHEL
Installing OpenStack Juno using RDO on RHELInstalling OpenStack Juno using RDO on RHEL
Installing OpenStack Juno using RDO on RHELopenstackstl
 
Salt Stack - Subhankar Sengupta
Salt Stack - Subhankar SenguptaSalt Stack - Subhankar Sengupta
Salt Stack - Subhankar SenguptaDevOpsBangalore
 
Openstack installation using rdo
Openstack installation using rdoOpenstack installation using rdo
Openstack installation using rdoNarasimha sreeram
 
(WS14) Sasa Matijasic - Node.js i "novi" web
(WS14) Sasa Matijasic - Node.js i "novi" web(WS14) Sasa Matijasic - Node.js i "novi" web
(WS14) Sasa Matijasic - Node.js i "novi" webWeb::Strategija
 

Mais procurados (20)

Debconf14 : Putting some salt in your Debian systems -- Julien Cristau
Debconf14 : Putting some salt in your Debian systems -- Julien CristauDebconf14 : Putting some salt in your Debian systems -- Julien Cristau
Debconf14 : Putting some salt in your Debian systems -- Julien Cristau
 
SnortReport Presentation
SnortReport PresentationSnortReport Presentation
SnortReport Presentation
 
Inspector - Node.js : Notes
Inspector - Node.js : NotesInspector - Node.js : Notes
Inspector - Node.js : Notes
 
Asus WL500gP USB Serial
Asus WL500gP USB SerialAsus WL500gP USB Serial
Asus WL500gP USB Serial
 
Prosess accouting
Prosess accoutingProsess accouting
Prosess accouting
 
Install Cuckoo on Mac OS X
Install Cuckoo on Mac OS XInstall Cuckoo on Mac OS X
Install Cuckoo on Mac OS X
 
Ip sec vpn with dynamic routing mikrotik and cisco - mikro-tik wiki
Ip sec vpn with dynamic routing   mikrotik and cisco - mikro-tik wikiIp sec vpn with dynamic routing   mikrotik and cisco - mikro-tik wiki
Ip sec vpn with dynamic routing mikrotik and cisco - mikro-tik wiki
 
Raspberry Pi Bake-Off
Raspberry Pi Bake-OffRaspberry Pi Bake-Off
Raspberry Pi Bake-Off
 
Configure a Riak Cluster
Configure a Riak ClusterConfigure a Riak Cluster
Configure a Riak Cluster
 
Openstack installation using rdo multi node
Openstack installation using rdo multi nodeOpenstack installation using rdo multi node
Openstack installation using rdo multi node
 
Openstack kilo installation using rdo
Openstack kilo installation using rdoOpenstack kilo installation using rdo
Openstack kilo installation using rdo
 
Salt Stack pt. 2 : Configuration Management
Salt Stack pt. 2 : Configuration ManagementSalt Stack pt. 2 : Configuration Management
Salt Stack pt. 2 : Configuration Management
 
NodeMCU setup LUA
NodeMCU setup LUANodeMCU setup LUA
NodeMCU setup LUA
 
FreeBSD preseed installation (PXE) AsiaBSDCon 2015
FreeBSD preseed installation (PXE) AsiaBSDCon 2015FreeBSD preseed installation (PXE) AsiaBSDCon 2015
FreeBSD preseed installation (PXE) AsiaBSDCon 2015
 
Installing OpenStack Juno using RDO on RHEL
Installing OpenStack Juno using RDO on RHELInstalling OpenStack Juno using RDO on RHEL
Installing OpenStack Juno using RDO on RHEL
 
Zookeper
ZookeperZookeper
Zookeper
 
Salt Stack - Subhankar Sengupta
Salt Stack - Subhankar SenguptaSalt Stack - Subhankar Sengupta
Salt Stack - Subhankar Sengupta
 
Openstack installation using rdo
Openstack installation using rdoOpenstack installation using rdo
Openstack installation using rdo
 
(WS14) Sasa Matijasic - Node.js i "novi" web
(WS14) Sasa Matijasic - Node.js i "novi" web(WS14) Sasa Matijasic - Node.js i "novi" web
(WS14) Sasa Matijasic - Node.js i "novi" web
 
File1
File1File1
File1
 

Semelhante a Linux processes control and monitoring

Proactive monitoring with Monit
Proactive monitoring with MonitProactive monitoring with Monit
Proactive monitoring with MonitOSOCO
 
Monit - NHRuby May 2009
Monit - NHRuby May 2009Monit - NHRuby May 2009
Monit - NHRuby May 2009bturnbull
 
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and VarnishMagento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and VarnishYireo
 
Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...
Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...
Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...Stacey Whitney
 
Montreal On Rails 5 : Rails deployment using : Nginx, Mongrel, Mongrel_cluste...
Montreal On Rails 5 : Rails deployment using : Nginx, Mongrel, Mongrel_cluste...Montreal On Rails 5 : Rails deployment using : Nginx, Mongrel, Mongrel_cluste...
Montreal On Rails 5 : Rails deployment using : Nginx, Mongrel, Mongrel_cluste...addame
 
Hadoop single cluster installation
Hadoop single cluster installationHadoop single cluster installation
Hadoop single cluster installationMinh Tran
 
NGINX Installation and Tuning
NGINX Installation and TuningNGINX Installation and Tuning
NGINX Installation and TuningNGINX, Inc.
 
Java App On Digital Ocean: Deploying With Gitlab CI/CD
Java App On Digital Ocean: Deploying With Gitlab CI/CDJava App On Digital Ocean: Deploying With Gitlab CI/CD
Java App On Digital Ocean: Deploying With Gitlab CI/CDSeun Matt
 
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기Ji-Woong Choi
 
Mr201309 automated on-execute_test_using_virtual_box_eng
Mr201309 automated on-execute_test_using_virtual_box_engMr201309 automated on-execute_test_using_virtual_box_eng
Mr201309 automated on-execute_test_using_virtual_box_engFFRI, Inc.
 
Google App Engine: For PHP Developers
Google App Engine: For PHP DevelopersGoogle App Engine: For PHP Developers
Google App Engine: For PHP DevelopersAbu Ashraf Masnun
 
Rabbit mq簡介(上)
Rabbit mq簡介(上)Rabbit mq簡介(上)
Rabbit mq簡介(上)共和 薛
 
How To Install OpenFire in CentOS 7
How To Install OpenFire in CentOS 7How To Install OpenFire in CentOS 7
How To Install OpenFire in CentOS 7VCP Muthukrishna
 
Nicolas-Embleton - Deploying node.js with forever and nginx
Nicolas-Embleton  - Deploying node.js with forever and nginxNicolas-Embleton  - Deploying node.js with forever and nginx
Nicolas-Embleton - Deploying node.js with forever and nginxJavaScript Meetup HCMC
 
[Js hcm] Deploying node.js with Forever.js and nginx
[Js hcm] Deploying node.js with Forever.js and nginx[Js hcm] Deploying node.js with Forever.js and nginx
[Js hcm] Deploying node.js with Forever.js and nginxNicolas Embleton
 
Tested install-isp config3-ubuntu-16-04
Tested install-isp config3-ubuntu-16-04Tested install-isp config3-ubuntu-16-04
Tested install-isp config3-ubuntu-16-04SANTIAGO HERNÁNDEZ
 

Semelhante a Linux processes control and monitoring (20)

Proactive monitoring with Monit
Proactive monitoring with MonitProactive monitoring with Monit
Proactive monitoring with Monit
 
Monit - NHRuby May 2009
Monit - NHRuby May 2009Monit - NHRuby May 2009
Monit - NHRuby May 2009
 
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and VarnishMagento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish
 
Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...
Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...
Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...
 
Virt monitoring
Virt monitoringVirt monitoring
Virt monitoring
 
Getting started with rabbitmq
Getting started with rabbitmqGetting started with rabbitmq
Getting started with rabbitmq
 
Montreal On Rails 5 : Rails deployment using : Nginx, Mongrel, Mongrel_cluste...
Montreal On Rails 5 : Rails deployment using : Nginx, Mongrel, Mongrel_cluste...Montreal On Rails 5 : Rails deployment using : Nginx, Mongrel, Mongrel_cluste...
Montreal On Rails 5 : Rails deployment using : Nginx, Mongrel, Mongrel_cluste...
 
Hadoop single cluster installation
Hadoop single cluster installationHadoop single cluster installation
Hadoop single cluster installation
 
NGINX Installation and Tuning
NGINX Installation and TuningNGINX Installation and Tuning
NGINX Installation and Tuning
 
Java App On Digital Ocean: Deploying With Gitlab CI/CD
Java App On Digital Ocean: Deploying With Gitlab CI/CDJava App On Digital Ocean: Deploying With Gitlab CI/CD
Java App On Digital Ocean: Deploying With Gitlab CI/CD
 
RubyKaigi 2014: ServerEngine
RubyKaigi 2014: ServerEngineRubyKaigi 2014: ServerEngine
RubyKaigi 2014: ServerEngine
 
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기
 
Mr201309 automated on-execute_test_using_virtual_box_eng
Mr201309 automated on-execute_test_using_virtual_box_engMr201309 automated on-execute_test_using_virtual_box_eng
Mr201309 automated on-execute_test_using_virtual_box_eng
 
Google App Engine: For PHP Developers
Google App Engine: For PHP DevelopersGoogle App Engine: For PHP Developers
Google App Engine: For PHP Developers
 
Rabbit mq簡介(上)
Rabbit mq簡介(上)Rabbit mq簡介(上)
Rabbit mq簡介(上)
 
How To Install OpenFire in CentOS 7
How To Install OpenFire in CentOS 7How To Install OpenFire in CentOS 7
How To Install OpenFire in CentOS 7
 
Nicolas-Embleton - Deploying node.js with forever and nginx
Nicolas-Embleton  - Deploying node.js with forever and nginxNicolas-Embleton  - Deploying node.js with forever and nginx
Nicolas-Embleton - Deploying node.js with forever and nginx
 
[Js hcm] Deploying node.js with Forever.js and nginx
[Js hcm] Deploying node.js with Forever.js and nginx[Js hcm] Deploying node.js with Forever.js and nginx
[Js hcm] Deploying node.js with Forever.js and nginx
 
Nodejs in Production
Nodejs in ProductionNodejs in Production
Nodejs in Production
 
Tested install-isp config3-ubuntu-16-04
Tested install-isp config3-ubuntu-16-04Tested install-isp config3-ubuntu-16-04
Tested install-isp config3-ubuntu-16-04
 

Último

UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPathCommunity
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7DianaGray10
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Brian Pichman
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfDaniel Santiago Silva Capera
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 

Último (20)

UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation Developers
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )
 
201610817 - edge part1
201610817 - edge part1201610817 - edge part1
201610817 - edge part1
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 
20230104 - machine vision
20230104 - machine vision20230104 - machine vision
20230104 - machine vision
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 

Linux processes control and monitoring

  • 1. Monitoring for Web Applications Контроль и мониторинг Linux процессов для Рython разработчиков
  • 3. •sudo apt-get install nginx •ls /etc/init.d/nginx •sudo service nginx restart •sudo apt-get install mongodb-10gen •ls /etc/init.d/mongodb •sudo service mongodb status •ls /etc/mongodb.conf •sudo apt-get install rabbitmq-server •ls /etc/init.d/rabbitmq-server •service rabbitmq-server status
  • 5. •sudo apt-get install monit •ls /etc/init.d/monit •service monit status •cat sudo cat /etc/monit/monitrc 1.set daemon 120 # check services at 2-minute intervals 2.set logfile /var/log/monit.log 1.check process nginx with pidfile /var/run/nginx.pid 2. start program = "/etc/init.d/nginx start" 3. stop program = "/etc/init.d/nginx stop" 4. if failed port 80 protocol http then alert 5. if cpu usage is greater than 60 percent for 2 cycles 6. then alert 7. if cpu usage > 98% for 5 cycles then restart 8. if 2 restarts within 3 cycles then timeout 9. alert admin@bar.com Installation & Configuration
  • 8. •/home/user/venv/bin/pip install tornado •ls venv/lib/python2.7/site-packages/tornado •venv/bin/python my_web_project/app.py •/home/user/venv/bin/pip install celery •ls venv/lib/python2.7/site-packages/celery •venv/bin/celery worker -A myproject.tasks -- config=myproject.celeryconfig Virtualev based Python stack
  • 9. A process control system •supervisord •supervisorctl •Web Server •XML RPC Interface •/home/user/venv/bin/pip install supervisor •ls venv/lib/python2.7/site-packages/supervisor •/venv/bin/echo_supervisord_conf > supervisord.conf •venv/bin/supervisord -c supervisord.conf •venv/bin/supervisorctl -c supervisord.conf shutdown