SlideShare uma empresa Scribd logo
1 de 13
Monitoring for Web
Applications
Контроль и мониторинг Linux процессов
для Рython разработчиков
•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

SnortReport Presentation
SnortReport PresentationSnortReport Presentation
SnortReport Presentation
webhostingguy
 
Asus WL500gP USB Serial
Asus WL500gP USB SerialAsus WL500gP USB Serial
Asus WL500gP USB Serial
guestac21b8
 
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
Huy Eav
 
Openstack kilo installation using rdo
Openstack kilo installation using rdoOpenstack kilo installation using rdo
Openstack kilo installation using rdo
Narasimha 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" web
Web::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

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
FFRI, Inc.
 

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
 
Installation And Configuration Of DNS, Web And FTP Servers On Virtual Machine...
Installation And Configuration Of DNS, Web And FTP Servers On Virtual Machine...Installation And Configuration Of DNS, Web And FTP Servers On Virtual Machine...
Installation And Configuration Of DNS, Web And FTP Servers On Virtual Machine...
 
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
 
[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
 
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
 
Nodejs in Production
Nodejs in ProductionNodejs in Production
Nodejs in Production
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 

Linux processes control and monitoring

  • 1. Monitoring for Web Applications Контроль и мониторинг Linux процессов для Рython разработчиков
  • 2.
  • 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