hardtyz/yii2-health

Yii2 multipoint health check

Installs: 19

Dependents: 0

Suggesters: 0

Security: 0

Type:yii2-extension

0.0.2 2018-08-07 12:48 UTC

This package is auto-updated.

Last update: 2024-03-21 21:42:19 UTC


README

1. Instalation

The preferred way to install this extension is through composer.

and add next lines to composer.json

    "repositories": [
        {
            "url": "https://bitbucket.org/HardTYZ/yii2-health",
            "type": "git"
        }
    ]

and add line to require section of composer.json

"hardtyz/yii2-health": "*"

Usage

Example configuration

Just simply add to your config in modules, you need to define your checks in "check" array.

...
   'modules'   => [
        'health' => [
            'class'  => 'hardtyz\health\Module',
            'check' => [
                "TcpCheck" => [
                    "type" => "tcp",                    // type tcp
                    "host" => "localhost",              // tcp host or ip adress
                    "port" => 80,                       // tcp port
                    "name" => "TcpCheck"                // service name
                ],
                "HttpCheck" => [
                    "type" => "http",                   // type http
                    "host" => "http://localhost",       // http or https host
                    "name" => "HttpCheck"               // service name
                ],
                "DataBaseCheck" => [
                    "type" => "db",                     // type database
                    "db" => "db",                       // name of database profile
                    "name" => "DB"                      // service name
                ],
            ],
        ],
    ],
...