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. C++_异常1-调用abort()

    异常是相对较新的C++功能,有些老式编译器可能没有实现.另外有些编译器可能默认关闭这一特性,需要使用编译器选项来打开它. 这里先讨论一个基本问题: 2.0 * x * y / (x+y) 如果y是x的 ...

  2. ORA-28009: 应当以 SYSDBA 身份或 SYSOPER 身份建立 SYS 连接

    用 SQL*Plus 连接数据库的时候,除了用户名和密码外,还要在口令后面加一个主机字符串.如下: 请输入用户名:sys 口令:ANKoracle123,orcl as sysdba

  3. B. Cover Points Codeforces Round #511 (Div. 2)【数学】

    题目: There are nn points on the plane, (x1,y1),(x2,y2),…,(xn,yn)(x1,y1),(x2,y2),…,(xn,yn). You need t ...

  4. C++标准库之String

    C++中支持的字符串处理的函数库叫String,但它不是STL,却与STL操作十分相似. 1.声明: 使用String之前要有以下头文件 #include<string> using na ...

  5. vue点击tab跳转页面,给点击的tab添加样式,且解决刷新以后点击的tab样式消失问题

    <ul class="nij"> <li v-for="item in nav" @click="selectNav(item.ti ...

  6. 【网络】默认路由、RIPv2、OSPF、EIGRP配置(全网全通)

    1:默认路由 遇到问题:给r2配置向右的单项默认路由,通过PC1去ping主机PC2,一直显示Request timed out, 解决方法:r2配置如下: r2(config)#ip route 0 ...

  7. Chess

    # coding=utf-8 import pandas as pd import numpy as np from sklearn import cross_validation import te ...

  8. window.open打开窗口的几种方式

    1. 在当前窗口打开百度,并且使URL地址出现在搜索栏中. window.open("http://www.baidu.com/", "_search"); w ...

  9. linux运维基础之系统挂载与etc文件下介绍

    1) 目录结构说明: windows:磁盘----分区---格式化--系统 linux:磁盘--分区--生成一个文件(磁盘分区) linux 中一切皆文件 ll -h 显示人类能看懂的 mount - ...

  10. shell 括号的区别

    $() 用于命令交换 里面会会执行命令,如果你写其他的: 会直接报错的 ` ` 也是用于命令交换的哦   和$() 的操作是一样的 ${ } 用于变量替换 每次调用环境的时候是需要带一个${ } 但是 ...