SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Ähnlich wie 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.
 

Ähnlich wie 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
 

Kürzlich hochgeladen

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
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

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
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 

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