supervisord-example.conf

  1. [unix_http_server]
  2. file=/tmp/supervisor.sock ; path to your socket file
  3. [supervisord]
  4. logfile=/var/log/supervisord/supervisord.log ; supervisord log file
  5. logfile_maxbytes=50MB ; maximum size of logfile before rotation
  6. logfile_backups=10 ; number of backed up logfiles
  7. loglevel=error ; info, debug, warn, trace
  8. pidfile=/var/run/supervisord.pid ; pidfile location
  9. nodaemon=false ; run supervisord as a daemon
  10. minfds=1024 ; number of startup file descriptors
  11. minprocs=200 ; number of process descriptors
  12. user=root ; default user
  13. childlogdir=/var/log/supervisord/ ; where child log files will live
  14. [rpcinterface:supervisor]
  15. supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
  16. [supervisorctl]
  17. serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
  18. ; This is where you run individual Tornado instances.
  19. ; We run four; one per processor core.
  20. ; In development, we ran as many as four per core with no issues.
  21. ; If you're looking to minimize cpu load, run fewer processes.
  22. ; BTW, Tornado processes are single threaded.
  23. ; To take advantage of multiple cores, you'll need multiple processes.
  24. [program:tornado-8001]
  25. directory=/var/www/Server/
  26. environment=PATH="/var/www/Server/venv/bin"
  27. command=/var/www/Server/venv/bin/python -m tornado_api.application --port=8001
  28. stderr_logfile = /var/log/supervisord/tornado-stderr.log
  29. stdout_logfile = /var/log/supervisord/tornado-stdout.log
  30. [program:tornado-8002]
  31. directory=/var/www/Server/
  32. environment=PATH="/var/www/Server/venv/bin"
  33. command=/var/www/Server/venv/bin/python -m tornado_api.application --port=8002
  34. stderr_logfile = /var/log/supervisord/tornado-stderr.log
  35. stdout_logfile = /var/log/supervisord/tornado-stdout.log
  36. ; Run celery process with supervisord
  37. [program:celery]
  38. directory=/var/www/Server/celery_workers
  39. environment=PATH="/var/www/Server/venv/bin"
  40. command=/var/www/Server/venv/bin/celery -A tasks worker --loglevel=info
  41. stderr_logfile = /var/log/supervisord/celery-stderr.log
  42. stdout_logfile = /var/log/supervisord/celery-stdout.log

centos7 环境

  1. yum install -y supervisor
  1. cat > /etc/supervisord.d/nagios-api.ini << EOF
  2. [program:nagios-api]
  3. directory=/opt/nagios-api/
  4. environment=PATH="/opt/nagios-api/venv/bin"
  5. command=/opt/nagios-api/venv/bin/python nagios-api -p 8080 -c /var/spool/nagios/cmd/nagios.cmd -s /var/log/nagios/status.dat -l /var/log/nagios/nagios.log
  6. stdout_logfile=/var/log/supervisor/nagios-api.log
  7. stdout_logfile_maxbytes=1MB
  8. stderr_logfile=/var/log/supervisor/nagios-api.error_log
  9. stderr_logfile_maxbytes=1MB
  10. EOF
  1. systemctl restart supervisord

supervisor运行virtualenv环境下的nagios-api的更多相关文章

  1. virtualenv 环境下 Nginx + Flask + Gunicorn+ Supervisor 搭建 Python Web

    在这篇文章里,我们将搭建一个简单的 Web 应用,在虚拟环境中基于 Flask 框架,用 Gunicorn 做 wsgi 容器,用 Supervisor 管理进程,然后使用 Python 探针来监测应 ...

  2. nginx环境下搭建nagios 3.5.0,及配置pnp4nagios画图

    本文基于<LNMP最新源码安装脚本>,Nagios依赖PHP环境和perl环境,由于Nginx不支持Perl的CGI,需先来搭建Perl环境,Nagios原理介绍略.一.下载最新稳定源码包 ...

  3. 如何在 Linux 环境下配置 Nagios Remote Plugin Executor (NRPE)

    为 NRPE 配置自定义命令 远程服务器上安装 下面列出了一些可以用于 NRPE 的自定义命令.这些命令在远程服务器的 /etc/nagios/nrpe.cfg 文件中定义. ## 当 1.5.15 ...

  4. Docker容器环境下ASP.NET Core Web API应用程序的调试

    本文主要介绍通过Visual Studio 2015 Tools for Docker – Preview插件,在Docker容器环境下,对ASP.NET Core Web API应用程序进行调试.在 ...

  5. Python Virtualenv运行Django环境配置

    系统: RHEL6.5 版本说明: Python-3.5.0 Django-1.10.4 virtualenv:为每个项目建立不同的/独立的Python环境,你将为每个项目安装所有需要的软件包到它们各 ...

  6. ECStore在Win环境下如何运行CMD命令

    大多数程序员使用windows开发环境来做ECStore二次开发,经常需要使用 ECStore自带的cmd命令进行一些系统操作,如清除缓存(cacheclean),升级程序(update),创建新的a ...

  7. Docker容器环境下ASP.NET Core Web API

    Docker容器环境下ASP.NET Core Web API应用程序的调试 本文主要介绍通过Visual Studio 2015 Tools for Docker – Preview插件,在Dock ...

  8. [转]windows环境下使用virtualenv对python进行多版本隔离

    windows环境下使用virtualenv对python进行多版本隔离 最近在用python做一个文本的情感分析的项目,用到tensorflow,需要用python3的版本,之前因为<机器学习 ...

  9. Azure REST API (4) 在Python环境下,使用Azure REST API

    <Windows Azure Platform 系列文章目录> 之前遇到的项目中,客户需要在Python环境下,监控Azure VM的CPU利用率,在这里简单记录一下. 笔者的环境是Win ...

随机推荐

  1. Moving docker images location to different partition

    By default docker will put all the data including images under /var/lib/docker(At least on Debian). ...

  2. POJ_3262 Protecting the Flowers 【贪心】

    一.题面 POJ3262 二.分析 这题要往贪心上面想应该还是很容易的,但问题是要证明为什么比值关系就能满足. 可以选择几个去分析,入1-6  与 2-15  和 1-6 与2-5 和 1-6 与 2 ...

  3. 马踏棋盘--dfs

    [问题描述]关于马踏棋盘的基本过程:国际象棋的棋盘为 8*8 的方格棋盘.现将"马"放在任意指定的方格中,按照"马"走棋的规则将"马"进行移 ...

  4. mysql数据库知识

    学而时习之,不亦说乎!                              --<论语> 数据库所有操作的总结.   1.mysql的数据库服务为mysqld.exe   windo ...

  5. <a>标签深入讲解

    标签中 href 和 onclick 的区别,以及href="javascript:xxx(this);"与onclick="xxx(this);" 传递thi ...

  6. PIE SDK主/次要分析

    1.算法功能简介 主要分析功能是采用类似卷积滤波的方法将较大类别中的虚假像元归到该类中,首先定义一个变换核尺寸,然后用变换核中占主要地位(像元最多)类别数代替中心像元的类别数,次要分析相反,用变换核中 ...

  7. MySQL误删root用户导致无法登陆解决方法

    测试环境   删除前 mysql> select user,host,password from mysql.user; +------+-----------+---------------- ...

  8. MVC参数自动装配

    在拿到一个类型的所有属性以及字段的描述信息后,就可以通过循环的方式,根据这些数据成员的名字去QueryString,Form,Session,Cookie读取所需的数据了. 就是遍历参数,然后用反射遍 ...

  9. Ace教你一步一步做Android新闻客户端(四) 优化Bitmap大法

    我计划着把需要用到的知识分解开来写,趁着我们要开发这款客户端的机会把安卓所有移动客户端开发中的技术贯穿其中,也是我自己成长的过程.By Ace in 20160121 我们开发一款新闻客户端程序,它的 ...

  10. Hsl PLC

    https://github.com/dathlin/HslCommunication 地址