supervisord支持扩展(xml RPC API & Third Party Applications and Libraries)

XML-RPC API Documentation

http://www.supervisord.org/api.html

Third Party Applications and Libraries

http://www.supervisord.org/plugins.html

本文尝试一下第三方应用中的Supervisord-Monitor

Install

1.Clone supervisord-monitor to your vhost/webroot:

git clone https://github.com/mlazarov/supervisord-monitor.git

2.Copy application/config/supervisor.php.example to application/config/supervisor.php

cp supervisord-monitor/application/config/supervisor.php.example supervisord-monitor/application/config/supervisor.php

3.Enable/Uncomment inet_http_server (found in supervisord.conf) for all your supervisord servers.

[inet_http_server]
port=*:9001
username="yourusername"
password="yourpass"

Do not forget to restart supervisord service after changing supervisord.conf

4.Edit supervisord-monitor configuration file and add all your supervisord servers

vim application/config/supervisor.php

5.Configure your web server to point one of your vhosts to 'public_html' directory. 6.Open web browser and enter your vhost url.

本文的web server使用nginx(同时需要安装php-fpm)

Centos安装php php-fpm 以及 配置nginx

[root@kuber-worker-2 conf]# cat server.conf 
server {
listen 9081;
server_name localhost;
root /home/zyf/supervisord-monitor/public_html;  #supervisord-monitor目录
index index.php;

access_log /usr/local/fountain/3rdparty/nginx/logs/supervisoraccess.log;
error_log  /usr/local/fountain/3rdparty/nginx/logs/supervisorerror.log;

#location = /ENV {
#    allow 127.0.0.1;
#    deny all;
#}

location / {
    try_files $uri $uri/ /index.php;
 }

location ~* .php$ {
    include fastcgi.conf;
    fastcgi_pass 127.0.0.1:9002;
    fastcgi_index index.php;
}
}

 结果如图:

原文地址:https://www.cnblogs.com/felixzh/p/8854050.html