zo/supervisor-monitor-bundle

此包提供监控supervisor服务器进程的接口

安装: 549

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

公开问题: 0

类型:symfony-bundle

v1.0 2018-02-27 05:11 UTC

This package is auto-updated.

Last update: 2024-09-22 17:42:10 UTC


README

此包提供了一种监控supervisor进程并控制这些状态的方法。

  • 配置多个supervisor服务器服务。
  • 启动、停止、重启单个或所有服务。

配置

  1. 在 app/AppKernel.php 中启用此包
  2. 配置此包
    # app/config/config.yml 
    
    zo_supervisor_monitor:
        servers:
            local:
                host: https://
                port: 9001
                username: null
                password: null
            test:
                host: https://
                port: 9001
                username: null
                password: null
    
    
  3. 注册包的路由
    	# app/config/routing.yml
    
    	zo_supervisor_monitor:
    	    resource: "@ZOSupervisorMonitorBundle/Resources/config/routing.yml"
    	    prefix:   /supervisor/
    
    

在 /supervisor/monitor 找到supervisor监控页面。

小部件

  1. supervisor客户端作为服务 zo_supervisor_monitor.util.client 暴露。
  2. 可以通过以下方式获取supervisor配置的服务器进程信息:
    	$client = $this->get('zo_supervisor_monitor.util.client');
    	$res = $this->client->getServersListVersion();
    	// $res = array('services' => $services, 'version' => $version);
    
  3. supervisor监控视图可以在 ZOSupervisorMonitorBundle::services.html.twig 中找到。请记得向视图传递 servicesversion 变量。