{"id":22725083,"url":"https://github.com/katmore/healthsvc","last_synced_at":"2025-03-29T23:22:35.078Z","repository":{"id":57004763,"uuid":"160399762","full_name":"katmore/healthsvc","owner":"katmore","description":"health webservice","archived":false,"fork":false,"pushed_at":"2019-01-08T21:29:00.000Z","size":2248,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T00:44:17.303Z","etag":null,"topics":["health-webservice","monitoring","php","webservice","webservice-endpoints"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/katmore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-04T18:14:12.000Z","updated_at":"2019-01-08T21:29:02.000Z","dependencies_parsed_at":"2022-08-21T14:10:58.747Z","dependency_job_id":null,"html_url":"https://github.com/katmore/healthsvc","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katmore%2Fhealthsvc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katmore%2Fhealthsvc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katmore%2Fhealthsvc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katmore%2Fhealthsvc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/katmore","download_url":"https://codeload.github.com/katmore/healthsvc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246256106,"owners_count":20748193,"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":["health-webservice","monitoring","php","webservice","webservice-endpoints"],"created_at":"2024-12-10T15:08:48.153Z","updated_at":"2025-03-29T23:22:35.059Z","avatar_url":"https://github.com/katmore.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Healthsvc\nHealthsvc is a system health status service with a RESTful API interface.\nIt can be used stand-alone or be integrated into existing projects. It is intended to be used conjunction with devops workflows, functional testing, monitoring software, etc.\n\n## Usage as Standalone Service\n * Download *healthsvc*:\n    ```sh\n    git clone https://github.com/katmore/healthsvc.git\n    ```\n\n * Update using *Composer*:\n    ```sh\n    cd healthsvc\n    composer update\n    ```\n\n * Print list of available \"host-sanity\" tests using the `host-sanity-config.php` command-line utility\n    ```sh\n    bin/host-sanity-config.php --print-bin-list\n    ```\n\n * Add a \"host-sanity\" test with the label \"free-space\" using the `host-sanity-config.php` command-line utility\n    ```sh\n    bin/host-sanity-config.php --bin free-space free-space-check /tmp\n    ```\n\n * Configure endpoint for use with HTTP server:\n     * **Dev use only** \n        * start the [`webservice`](./bin/webservice) command-line utility\n        ```sh\n        bin/webservice\n        ```\n        \n     * **Production or Dev**\n        * create a symlink to [`healthsvc/web`](./web) dir in existing http root\n        ```sh\n        ln -s /var/www/healthsvc/web /var/www/html/healthsvc\n        ```\n        * **--OR--**\n        * use the [`healthsvc/web`](./web) dir as the http root:\n        ```ini\n        # nginx example\n        server {\n        ...\n            root   /var/www/healthsvc/web;\n        ...\n        }\n        ```\n\n * Test the [`web/host-sanity.php`](./web/host-sanity.php) webservice endpoint\n   * For example, using `curl` command-line utility\n     ```sh\n     curl http://localhost:8000/host-sanity.php\n     ```\n  * Example `web/host-sanity.php` response body when tests in \"success\" status (*200/OK* response code)\n     ```json\n     {\n      \"hostname\": \"my-host\",\n      \"exec_exit_status\": [],\n      \"health_status_time\": \"2018-12-11T21:51:36-08:00\",\n      \"health_status_ttl\": 0,\n      \"message\": \"total success\",\n      \"health_info\": {\n          \"free-space\": {\n              \"stdout\": [\n                  \"ok: '\\/tmp' has 81% free disk space\"\n              ]\n          }\n      },\n      \"health_success\": [\n          \"free-space\"\n      ],\n      \"health_warn\": [],\n      \"health_failure\": []\n     }\n     ```\n  * Example `web/host-sanity.php` response body when one or more tests has \"failure\" status (*500/Internal Server Error* response code)\n     ```json\n     {\n      \"hostname\": \"my-host\",\n      \"exec_exit_status\": {\n          \"free-space\": 3\n      },\n      \"health_status_time\": \"2018-12-11T21:58:45-08:00\",\n      \"health_status_ttl\": 0,\n      \"message\": \"one or more failures\",\n      \"health_info\": [],\n      \"health_success\": [],\n      \"health_warn\": [],\n      \"health_failure\": {\n          \"free-space\": {\n              \"stdout\": [\n                  \"'\\/tmp' has only 10% free disk space (20% is minimum required)\"\n              ]\n          }\n      }\n     }\n     ```\n     \n## Usage in Existing Projects\n * See [PHP usage documentation](./docs/phpdox.md) for more details.\n\n * Use *Composer* to add to an existing project.\n    ```sh\n    composer require katmore/healthsvc\n    ```\n\n## Unit Tests\n * [`docs/coverage.txt`](./docs/coverage.txt): unit test coverage report\n * [`phpunit.xml.dist`](./phpunit.xml.dist): PHPUnit configuration file\n * [`tests/phpunit`](./tests/phpunit): source code for unit tests\n\nTo perform unit tests, execute phpunit located in the `vendor/bin` directory.\n```sh\nvendor/bin/phpunit\n```\n\nThe [`tests.sh`](./tests.sh) wrapper script is provided for convenience.\n```sh\n./tests.sh\n```\n\n## Legal\n\"Healthsvc\" is distributed under the terms of the [MIT license](LICENSE) or the [GPLv3](GPLv3) license.\n\nCopyright (c) 2018-2019, Doug Bird. All rights reserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkatmore%2Fhealthsvc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkatmore%2Fhealthsvc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkatmore%2Fhealthsvc/lists"}