PHPackages                             katmore/healthsvc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. katmore/healthsvc

ActiveProject[Logging &amp; Monitoring](/categories/logging)

katmore/healthsvc
=================

health webservice

v1.0.3(7y ago)03MITPHPPHP &gt;=7.2.1

Since Dec 6Pushed 7y ago1 watchersCompare

[ Source](https://github.com/katmore/healthsvc)[ Packagist](https://packagist.org/packages/katmore/healthsvc)[ Docs](https://github.com/katmore/healthsvc)[ RSS](/packages/katmore-healthsvc/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (4)Versions (6)Used By (0)

Healthsvc
=========

[](#healthsvc)

Healthsvc is a system health status service with a RESTful API interface. It 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.

Usage as Standalone Service
---------------------------

[](#usage-as-standalone-service)

- Download *healthsvc*:

    ```
    git clone https://github.com/katmore/healthsvc.git
    ```
- Update using *Composer*:

    ```
    cd healthsvc
    composer update
    ```
- Print list of available "host-sanity" tests using the `host-sanity-config.php` command-line utility

    ```
    bin/host-sanity-config.php --print-bin-list
    ```
- Add a "host-sanity" test with the label "free-space" using the `host-sanity-config.php` command-line utility

    ```
    bin/host-sanity-config.php --bin free-space free-space-check /tmp
    ```
- Configure endpoint for use with HTTP server:

    - **Dev use only**

        - start the [`webservice`](./bin/webservice) command-line utility

        ```
        bin/webservice
        ```
    - **Production or Dev**

        - create a symlink to [`healthsvc/web`](./web) dir in existing http root

        ```
        ln -s /var/www/healthsvc/web /var/www/html/healthsvc
        ```

        - **--OR--**
        - use the [`healthsvc/web`](./web) dir as the http root:

        ```
        # nginx example
        server {
        ...
            root   /var/www/healthsvc/web;
        ...
        }
        ```
- Test the [`web/host-sanity.php`](./web/host-sanity.php) webservice endpoint

    - For example, using `curl` command-line utility ```
        curl http://localhost:8000/host-sanity.php
        ```
- Example `web/host-sanity.php` response body when tests in "success" status (*200/OK* response code)

    ```
    {
     "hostname": "my-host",
     "exec_exit_status": [],
     "health_status_time": "2018-12-11T21:51:36-08:00",
     "health_status_ttl": 0,
     "message": "total success",
     "health_info": {
         "free-space": {
             "stdout": [
                 "ok: '\/tmp' has 81% free disk space"
             ]
         }
     },
     "health_success": [
         "free-space"
     ],
     "health_warn": [],
     "health_failure": []
    }
    ```
- Example `web/host-sanity.php` response body when one or more tests has "failure" status (*500/Internal Server Error* response code)

    ```
    {
     "hostname": "my-host",
     "exec_exit_status": {
         "free-space": 3
     },
     "health_status_time": "2018-12-11T21:58:45-08:00",
     "health_status_ttl": 0,
     "message": "one or more failures",
     "health_info": [],
     "health_success": [],
     "health_warn": [],
     "health_failure": {
         "free-space": {
             "stdout": [
                 "'\/tmp' has only 10% free disk space (20% is minimum required)"
             ]
         }
     }
    }
    ```

Usage in Existing Projects
--------------------------

[](#usage-in-existing-projects)

- See [PHP usage documentation](./docs/phpdox.md) for more details.
- Use *Composer* to add to an existing project.

    ```
    composer require katmore/healthsvc
    ```

Unit Tests
----------

[](#unit-tests)

- [`docs/coverage.txt`](./docs/coverage.txt): unit test coverage report
- [`phpunit.xml.dist`](./phpunit.xml.dist): PHPUnit configuration file
- [`tests/phpunit`](./tests/phpunit): source code for unit tests

To perform unit tests, execute phpunit located in the `vendor/bin` directory.

```
vendor/bin/phpunit
```

The [`tests.sh`](./tests.sh) wrapper script is provided for convenience.

```
./tests.sh
```

Legal
-----

[](#legal)

"Healthsvc" is distributed under the terms of the [MIT license](LICENSE) or the [GPLv3](GPLv3) license.

Copyright (c) 2018-2019, Doug Bird. All rights reserved.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

4

Last Release

2704d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ef3cde32b1ac961c229cb3e76202b38b5d1a2c571334152c6cee08c43732ce7c?d=identicon)[acksponies](/maintainers/acksponies)

---

Top Contributors

[![ackspony](https://avatars.githubusercontent.com/u/1947018?v=4)](https://github.com/ackspony "ackspony (64 commits)")

---

Tags

health-webservicemonitoringphpwebservicewebservice-endpoints

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/katmore-healthsvc/health.svg)

```
[![Health](https://phpackages.com/badges/katmore-healthsvc/health.svg)](https://phpackages.com/packages/katmore-healthsvc)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
