zozo / supervisor-monitor-bundle
此Bundle提供监控supervisor服务器进程的接口
dev-master
2023-12-03 06:07 UTC
Requires
- php: >=7.2.5
- phpxmlrpc/phpxmlrpc: 4.3.1
- symfony/framework-bundle: 4.4.*|5.4.*
This package is auto-updated.
Last update: 2024-09-03 07:50:18 UTC
README
此bundle提供监控supervisor进程和控制这些状态的方法。
- 配置多个supervisor服务器服务。
- 启动、停止、重启单个或所有服务。
配置
-
在config/bundles.php中启用此bundle
-
配置此bundle
# config/packages/zo_supervisor_monitor.yaml zo_supervisor_monitor: servers: local: host: https:// port: 9001 username: null password: null test: host: https:// port: 9001 username: null password: null
-
为bundle注册路由
# config/routes.yaml zo_supervisor_monitor: resource: "@ZOSupervisorMonitorBundle/Resources/config/routing.yml" prefix: /supervisor/
-
设置容器
# config/services.yaml ZO\Bundle\SupervisorMonitorBundle\Controller\MonitorController: calls: - method: setContainer arguments: [ '@service_container' ]
在/supervisor/monitor找到supervisor监控页面。
小部件
- Supervisor客户端作为服务
zo_supervisor_monitor.util.client
暴露。 - 可以按以下方式获取Supervisor配置的服务器进程信息:
$client = $this->container->get('zo_supervisor_monitor.util.client'); $res = $this->client->getServersListVersion(); // $res = array('services' => $services, 'version' => $version);
- Supervisor监控视图可以在
ZOSupervisorMonitorBundle::services.html.twig
中找到。 请记住向视图传递services
和version
变量。