supervisord-example.conf

[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file [supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon
minfds=1024 ; number of startup file descriptors
minprocs=200 ; number of process descriptors
user=root ; default user
childlogdir=/var/log/supervisord/ ; where child log files will live [rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface [supervisorctl]
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket ; This is where you run individual Tornado instances.
; We run four; one per processor core.
; In development, we ran as many as four per core with no issues.
; If you're looking to minimize cpu load, run fewer processes.
; BTW, Tornado processes are single threaded.
; To take advantage of multiple cores, you'll need multiple processes. [program:tornado-8001]
directory=/var/www/Server/
environment=PATH="/var/www/Server/venv/bin"
command=/var/www/Server/venv/bin/python -m tornado_api.application --port=8001
stderr_logfile = /var/log/supervisord/tornado-stderr.log
stdout_logfile = /var/log/supervisord/tornado-stdout.log [program:tornado-8002]
directory=/var/www/Server/
environment=PATH="/var/www/Server/venv/bin"
command=/var/www/Server/venv/bin/python -m tornado_api.application --port=8002
stderr_logfile = /var/log/supervisord/tornado-stderr.log
stdout_logfile = /var/log/supervisord/tornado-stdout.log ; Run celery process with supervisord
[program:celery]
directory=/var/www/Server/celery_workers
environment=PATH="/var/www/Server/venv/bin"
command=/var/www/Server/venv/bin/celery -A tasks worker --loglevel=info
stderr_logfile = /var/log/supervisord/celery-stderr.log
stdout_logfile = /var/log/supervisord/celery-stdout.log

centos7 环境

yum install -y supervisor
cat > /etc/supervisord.d/nagios-api.ini << EOF
[program:nagios-api]
directory=/opt/nagios-api/
environment=PATH="/opt/nagios-api/venv/bin"
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 stdout_logfile=/var/log/supervisor/nagios-api.log
stdout_logfile_maxbytes=1MB
stderr_logfile=/var/log/supervisor/nagios-api.error_log
stderr_logfile_maxbytes=1MB
EOF
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. bzoj4548: 小奇的糖果 题解

    题目链接 题解 不包含所有颜色 就强制不选一个颜色 图中圆点颜色相同 矩形越大,包括的点一定不比其一小部分少 如图所示,最大矩形只有3种 离散化\(x\)坐标 然后按\(y\)排序 每次取出颜色的前驱 ...

  2. git 代码统计

    查看git上的个人代码提交量: git log --author="Marek Romanowski" --since="2019-01-01" --no-me ...

  3. vue-watch deep 和 immediate

    watch 是一个对象,对象就有键,有值. 值可以是函数:就是当你监控的家伙变化时,需要执行的函数,这个函数有两个形参,第一个是变化后的值,第二个是变化前的值. 值也可以是函数名:不过这个函数名要用单 ...

  4. Oracle RAC集群搭建(五)--oracle部署

    01,配置好环境 节点01--node1 ORACLE_BASE=/oracle/app/oracle ORACLE_HOME=$ORACLE_BASE/product//db_1 ORACLE_SI ...

  5. 原生态hadoop2.6平台搭建

     hadoop2.6平台搭建 一.条件准备 软件条件: Ubuntu14.04 64位操作系统,jdk1.7 64位,Hadoop 2.6.0 硬件条件: 1台主节点机器,配置:cpu 8个,内存32 ...

  6. jquery、js判断复选框是否选中

    js: if (document.getElementById("checkboxID").checked) { alert("checkobx is checked&q ...

  7. 计算机网络相关知识(http状态码 && 首部字段)

    计算机网络相关知识 计算机网络的知识还是非常重要的, 这里做一个简单的总结. 推荐阅读文章:http://www.cnblogs.com/TankXiao/archive/2012/02/13/234 ...

  8. IE Error: '__doPostBack' is undefined 问题解决

    突然遇到个很奇怪的BUG,翻页控件,其他浏览器一切正常,IE无法翻页,会提示 '__doPostBack' is undefined 后来搜索发现: [原文發表地址] Bug and Fix: ASP ...

  9. 移动平台的meta标签(转)

    1.Meta 之 viewport 说到移动平台meta标签,那就不得不说一下viewport了,那么什么是viewport呢? viewport即可视区域,对于桌面浏览器而言,viewport指的就 ...

  10. SpringBoot | 第三十五章:Mybatis的集成和使用

    前言 最近收到公众号留言说,单纯的Mybatis的集成和使用.前面在第九章:Mybatis-plus的集成和使用介绍了基于mybatis-plus的集成和使用.后者也只是对mybatis进行了功能增强 ...