albertofem/sitestatuschecker-bundle

dev-master 2014-12-02 06:33 UTC

This package is not auto-updated.

Last update: 2024-09-14 15:40:07 UTC


README

build status Scrutinizer Code Quality

Symfony2 扩展包,用于执行站点状态检查,依赖于 LiipMonitorBundle。它专门为ping服务而设计,例如New Relic的服务。

安装

在composer中引入它

composer require albertofem/sitestatuschecker-bundle dev-master

安装它

composer update albertofem/sitestatuschecker-bundle

将其添加到您的扩展包

$bundles = array(
    ...,
    new \Liip\MonitorBundle\LiipMonitorBundle(),
    new \AFM\Bundle\SiteStatusCheckerBundle\SiteStatusCheckerBundle()
);

如果您想运行测试

./vendor/bin/phpunit

用法

配置 LiipMonitorBundle

请参阅扩展包文档:https://github.com/liip/LiipMonitorBundle

进行配置

site_status_checker:
    token: my_secure_token

在路由中注册控制器

status_checker:
    resource: "@SiteStatusCheckerBundle/Resources/config/routing.yml"
    prefix: /status

这将在您的前缀下创建一个路由:/status/check/{token},它将返回相应的响应代码

  • 403:无效的token。内容:KO
  • 200:所有检查都执行正确。内容:OK
  • 500:某些检查失败。内容:KO