snide/monitor-bundle

服务监控包

dev-master 2014-07-31 06:18 UTC

This package is not auto-updated.

Last update: 2024-09-24 01:43:15 UTC


README

基于Test类的Symfony 2监控包

Build Status Scrutinizer Quality Score

特性

  • 基于测试类
  • 应用管理 & 连接(通过JSON展示)
  • 仪表板

安装

通过Composer安装

如果你使用Composer,将MonitorBundle包作为依赖项添加到你的应用composer.json文件中

    "require": {
        ...
        "snide/monitor-bundle": "dev-master"
        ...
    },

将SnideMonitorBundle添加到你的应用内核。

// app/AppKernel.php
<?php
    // ...
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Snide\MonitorBundle\SnideMonitorBundle(),
        );
    }

该包需要将必要的资源复制到web文件夹。你可以使用以下命令:

    php app/console assets:install

概述

仪表板

Dashboard

应用程序列表

Applications list

应用程序测试

Application test

定义你的测试服务

为了定义测试服务,添加类似于“snide_monitor.test”的标签

<service id="acme_demo.redis" class="Snide\Monitoring\Test\Redis" public="false">
    <tag name="snide_monitor.test" />
    <argument>Redis local instance</argument>
    <argument>127.0.0.1</argument>
    <argument>6379</argument>
</service>

应用程序链

你可以添加应用程序引用并定义其API URL(例如:/dashboard.json)。现在你的应用程序可以监控其他应用程序,测试将在你的仪表板上显示。

完整配置

    snide_monitor:
        timer: XX # Dashboard will be refreshed every XX seconds
        repository:
            type: yaml # only Yaml type is defined
            application:
                filename: /path/to/your/yaml/save/file.yml