{"id":13828443,"url":"https://github.com/antonioribeiro/health","last_synced_at":"2025-05-14T01:03:20.849Z","repository":{"id":45031530,"uuid":"74829244","full_name":"antonioribeiro/health","owner":"antonioribeiro","description":"Laravel Health Panel","archived":false,"fork":false,"pushed_at":"2024-10-15T12:52:30.000Z","size":4380,"stargazers_count":1966,"open_issues_count":39,"forks_count":201,"subscribers_count":43,"default_branch":"master","last_synced_at":"2025-04-23T17:12:35.368Z","etag":null,"topics":["hacktoberfest","health","health-panel","laravel","monitor","notifications","panel","php","server"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antonioribeiro.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-26T14:04:16.000Z","updated_at":"2025-04-10T11:43:29.000Z","dependencies_parsed_at":"2024-06-18T13:37:00.171Z","dependency_job_id":"82cf7caf-4a01-47e5-9fcc-dd719ef6cab6","html_url":"https://github.com/antonioribeiro/health","commit_stats":{"total_commits":527,"total_committers":34,"mean_commits":15.5,"dds":0.1897533206831119,"last_synced_commit":"6c1a64cba962ef528899bea29563068b1504690a"},"previous_names":[],"tags_count":59,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonioribeiro%2Fhealth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonioribeiro%2Fhealth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonioribeiro%2Fhealth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonioribeiro%2Fhealth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antonioribeiro","download_url":"https://codeload.github.com/antonioribeiro/health/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250477810,"owners_count":21437049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","health","health-panel","laravel","monitor","notifications","panel","php","server"],"created_at":"2024-08-04T09:02:47.046Z","updated_at":"2025-04-23T17:12:42.674Z","avatar_url":"https://github.com/antonioribeiro.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# Health Monitor\n## Laravel Server \u0026 App Health Monitor and Notifier\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://packagist.org/packages/pragmarx/health\"\u003e\u003cimg alt=\"Latest Stable Version\" src=\"https://img.shields.io/packagist/v/pragmarx/health.svg?style=flat-square\"\u003e\u003c/a\u003e\n    \u003ca href=\"LICENSE.md\"\u003e\u003cimg alt=\"License\" src=\"https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://scrutinizer-ci.com/g/antonioribeiro/health/?branch=master\"\u003e\u003cimg alt=\"Code Quality\" src=\"https://img.shields.io/scrutinizer/g/antonioribeiro/health.svg?style=flat-square\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/antonioribeiro/health/actions\"\u003e\u003cimg alt=\"Build\" src=\"https://github.com/antonioribeiro/health/actions/workflows/run-tests.yml/badge.svg?style=flat-square\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/pragmarx/health\"\u003e\u003cimg alt=\"Downloads\" src=\"https://img.shields.io/packagist/dt/pragmarx/health.svg?style=flat-square\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://scrutinizer-ci.com/g/antonioribeiro/health/?branch=master\"\u003e\u003cimg alt=\"Coverage\" src=\"https://img.shields.io/scrutinizer/coverage/g/antonioribeiro/health.svg?style=flat-square\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://travis-ci.org/antonioribeiro/health\"\u003e\u003cimg alt=\"PHP\" src=\"https://img.shields.io/badge/PHP-7.3%20--%208.1-brightgreen.svg?style=flat-square\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nThis package checks if the application resources are running as they should and creates a service status panel. It has the following main points:\n\n- Highly extensible and configurable: you can create new checkers and notifiers very easily, and you can virtually change everything on it.\n- Easy configuration: uses YAML as configuration files\n- Resilient resource checker: if the framework is working and at least one notification channel, you should receive notification messages.\n- Built-in notification system: get notifications via mail, slack, telegram or anything else you need.\n- Routes for: panel, json result, string result and resource.\n- Configurable panel design.\n- Cache.\n- Schedule checks to automatically receive notifications when a service fails.\n- View app error messages right in the panel.\n- Http response codes 200 and 500, on error, for services like [Envoyer](https://envoyer.io) to keep track of your app health.\n\n## Built-in Resources\n\nHeath has pre-configured resource checkers for the following services:\n\n- Adyen\n- AppKey\n- APIs\n- Broadcasting\n- Cache\n- ConfigurationCached\n- Certificate\n- Checkout.com\n- Database\n- DebugMode\n- DirectoryPermissions\n- DiskSpace\n- DocuSign\n- ElasticsearchConnectable\n- EnvExists\n- Filesystem\n- Framework\n- HealthPanel\n- Horizon\n- Http\n- Https\n- LaravelServices\n- Latency\n- LocalStorage\n- Mail\n- MailgunConnectable\n- MemcachedConnectable\n- MigrationsUpToDate\n- MixManifest\n- MySql\n- MySqlConnectable\n- NewrelicDeamon\n- NginxServer\n- PackagesUpToDate\n- Php\n- PostgreSqlConnectable\n- PostgreSqlServer\n- Queue\n- QueueWorkers\n- RebootRequired\n- Redis\n- RedisConnectable\n- RedisServer\n- RoutesCached\n- S3\n- SecurityChecker\n- SeeTickets\n- Sendinblue\n- ServerLoad\n- ServerVars\n- ServerUptime\n- Sshd\n- Supervisor\n\nBut you can add anything else you need, you just have to find the right checker to use or just create a new checker for your resource.\n\n## Panel of Panels\n\nIf you have a lot of websites to check, you can use the HealthPanel checker to create a Health Monitor application to check all your remote monitors and create a dashboard to summarize the state of all your websites.   \n\n## Easy Configuration\n\nCreating new resources monitors is easy, just create a new YAML file in app's config/health folder and it's done. Here's some examples:\n\n### Amazon S3\n\n    name: S3\n    abbreviation: s3\n    checker: PragmaRX\\Health\\Checkers\\CloudStorageChecker\n    notify: true\n    driver: s3\n    file: pragmarx-health-s3-testfile.txt\n    contents: {{ str_random(32) }}\n    error_message: 'Amazon S3 connection is failing.'\n    column_size: 4\n\n### Nginx\n\n    name: NginxServer\n    abbreviation: ngnxsrvr\n    checker: PragmaRX\\Health\\Checkers\\ProcessChecker\n    command: 'pgrep %s'\n    method: process_count\n    process_name: nginx\n    instances:\n        minimum:\n            count: 4\n            message: 'Process \"%s\" has not enough instances running: it has %s, when should have at least %s'\n        maximum:\n            count: 8\n            message: 'Process \"%s\" exceeded the maximum number of running instances: it has %s, when should have at most %s'\n    notify: true\n    pid_file_missing_error_message: 'Process ID file is missing: %s.'\n    pid_file_missing_not_locked: 'Process ID file is not being used by any process: %s.'\n    column_size: 4\n\n## Screenshots\n\n### Panel\n\n![default panel](docs/images/panel.png)\n\n### Panel alternate design\n\nIf you have lots of services to check, you may change the default panel design to use less space:\n\n![default panel](docs/images/error-single-2-columns.png)\n\n### Panel in 4 columns layout\n\n![default panel](docs/images/error-single-4-columns.png)\n\n### Error Messages\n\nMouse over a failing resource and get instant access to the error message:\n\n![default panel](docs/images/error-hint.png)\n\nClick the resource button and you'll get an alert showing the error message:\n\n![default panel](docs/images/error-alert.png)\n\n### Slack Notification\n\nHere's an example of notification sent via Slack:\n\n![default panel](docs/images/slack.png)\n\n## Artisan Console Commands\n\nThe health check commands below also return an exit code in a standard format:\n\n| Numeric Value | Service Status | Status Description                                                                                  |\n|---------------|----------------|-----------------------------------------------------------------------------------------------------|\n|       0       |       OK       | Service and appears to be functioning properly                                                      |\n|       1       |     Warning    | Check ran okay, but was above some \"warning\" threshold                                              |\n|       2       |    Critical    | The check detected service is not running or is above a \"critical\" threshold                        |\n|       3       |     Unknown    | Settings for the service check may be misconfigured and is preventing the check for being performed |\n\n### health:panel\n\nUse the command `health:panel` to view the status of your services in console.\n\n### health:check\n\nUse the command `health:check` to check all your resources and send notifications on failures.\n\n![default panel](docs/images/console-panel.png)\n\n## Routes\n\nAfter installing you will have access to the following routes:\n\n### /health/panel\n\nThe main panel route.\n\n### /health/check\n\nReturns a json with everything the package knows about your services:\n\n![default panel](docs/images/json.png)\n\n### /health/string\n\nReturns a string with status on all your services, useful when using other monitoring services:\n\n```\nhlthFAIL-dbFAIL-filesystemOK-frmwrkOK-httpOK-httpsOK-mailOK\n```\n\n### /health/resource/{name}\n\nReturns a json with information about a particular service:\n\n![default panel](docs/images/json-resource.png)\n\n## Requirements\n\n- PHP 7.3+\n- Laravel 8.0+\n\n## Installing\n\nUse Composer to install it:\n\n    composer require pragmarx/health\n\n## Installing on Laravel\n\nAdd the Service Provider to your `config/app.php`:\n\n    PragmaRX\\Health\\ServiceProvider::class,\n\n## Publish config and views\n\n    php artisan vendor:publish --provider=\"PragmaRX\\Health\\ServiceProvider\"\n\n## Hit The Health Panel\n\n    http://yourdomain.com/health/panel\n\n## Configure All The Things\n\nAlmost everything is easily configurable in this package:\n\n- Panel name\n- Title and messages\n- Resource checkers\n- Slack icon\n- Notification channels\n- Template location\n- Routes and prefixes\n- Mail server\n- Cache\n- Scheduler\n\n## Configure binaries\n\nSome of the checkers need you to configure the proper binary path for the checker to work:\n\n    'services' =\u003e [\n        'ping' =\u003e [\n            'bin' =\u003e env('HEALTH_PING_BIN', '/sbin/ping'),\n        ],\n\n        'composer' =\u003e [\n            'bin' =\u003e env('HEALTH_COMPOSER_BIN', 'composer'),\n        ],\n    ],\n\n## Allowing Slack Notifications\n\nTo receive notifications via Slack, you'll have to setup [Incoming Webhooks](https://api.slack.com/incoming-webhooks) and add this method to your User model with your webhook:\n\n    /**\n     * Route notifications for the Slack channel.\n     *\n     * @return string\n     */\n    public function routeNotificationForSlack()\n    {\n        return config('services.slack.webhook_url');\n    }\n\n## Cache\n\nWhen Health result is cached, you can flush the cache to make it process all resources again by adding `?flush=true` to the url:\n\n    http://yourdomain.com/health/panel?flush=true\n\n## Events\n\nIf you prefer to build you own notifications systems, you can disable it and listen for the following event\n\n    PragmaRX\\Health\\Events\\RaiseHealthIssue::class\n\n## Broadcasting Checker\n\nBroadcasting checker is done via ping and pong system. The broadcast checker will ping your service, and it must pong back. Basically what you need to do is to call back a url with some data:\n\n### Redis + Socket.io\n\n    var request = require('request');\n    var server = require('http').Server();\n    var io = require('socket.io')(server);\n    var Redis = require('ioredis');\n    var redis = new Redis();\n\n    redis.subscribe('pragmarx-health-broadcasting-channel');\n\n    redis.on('message', function (channel, message) {\n        message = JSON.parse(message);\n\n        if (message.event == 'PragmaRX\\\\Health\\\\Events\\\\HealthPing') {\n            request.get(message.data.callbackUrl + '?data=' + JSON.stringify(message.data));\n        }\n    });\n\n    server.listen(3000);\n\n### Pusher\n\n    \u003c!DOCTYPE html\u003e\n    \u003chtml\u003e\n        \u003chead\u003e\n            \u003ctitle\u003ePusher Test\u003c/title\u003e\n            \u003cscript src=\"https://js.pusher.com/3.2/pusher.min.js\"\u003e\u003c/script\u003e\n            \u003cscript\u003e\n                var pusher = new Pusher('YOUR-PUSHER-KEY', {\n                    encrypted: true\n                });\n\n                var channel = pusher.subscribe('pragmarx-health-broadcasting-channel');\n\n                channel.bind('PragmaRX\\\\Health\\\\Events\\\\HealthPing', function(data) {\n                    var request = (new XMLHttpRequest());\n\n                    request.open(\"GET\", data.callbackUrl + '?data=' + JSON.stringify(data));\n\n                    request.send();\n                });\n            \u003c/script\u003e\n        \u003c/head\u003e\n\n        \u003cbody\u003e\n            Pusher waiting for events...\n        \u003c/body\u003e\n    \u003c/html\u003e\n\n## Programatically checking resources\n\n``` php\n$generalHealthState = app('pragmarx.health')-\u003echeckResources();\n\n// or\n\n$databaseHealthy = app('pragmarx.health')-\u003echeckResource('database')-\u003eisHealthy();\n```\n\nChecking in artisan commands example:\n\n```\nArtisan::command('database:health', function () {\n    app('pragmarx.health')-\u003echeckResource('database')-\u003eisHealthy()\n        ? $this-\u003einfo('database is healthy')\n        : $this-\u003einfo('database is in trouble')\n    ;\n})-\u003edescribe('Check database health');\n```\n\n## SecurityChecker\n\nAs the [SensioLabs Security Checker](https://github.com/sensiolabs/security-checker) package was abandoned, this checker now depends on [local-php-security-checker](https://github.com/fabpot/local-php-security-checker). You need to compile or install it on your server or container in order to use this checker, and update the `config/resources/SecurityChecker.yml` file accordingly. \n\n## Lumen\nTo use it on Lumen, you'll probably need to do something like this on your `bootstrap/app.php`:\n\n    $app-\u003einstance('path.config', app()-\u003ebasePath() . DIRECTORY_SEPARATOR . 'config');\n    $app-\u003einstance('path.storage', app()-\u003ebasePath() . DIRECTORY_SEPARATOR . 'storage');\n\n    $app-\u003ewithFacades();\n\n    $app-\u003esingleton('Illuminate\\Contracts\\Routing\\ResponseFactory', function ($app) {\n        return new \\Illuminate\\Routing\\ResponseFactory(\n            $app['Illuminate\\Contracts\\View\\Factory'],\n            $app['Illuminate\\Routing\\Redirector']\n        );\n    });\n\n    $app-\u003eregister(PragmaRX\\Health\\ServiceProvider::class);\n\n## Testing\n\n``` bash\n$ composer test\n```\n\n## Author\n\n[Antonio Carlos Ribeiro](http://twitter.com/iantonioribeiro)\n\n## License\n\nHealth is licensed under the BSD 3-Clause License - see the `LICENSE` file for details\n\n## Contributing\n\nPull requests and issues are more than welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonioribeiro%2Fhealth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantonioribeiro%2Fhealth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonioribeiro%2Fhealth/lists"}