Skip to content

kunitsucom/pshealthz

Repository files navigation

license pkg goreportcard workflow workflow workflow codecov sourcegraph

Overview

pshealthz is a tool to check the health of a process.

Example

$ pshealthz

other terminal:

$ curl -i http://localhost:8080 -d '{"regex":"^/usr/sbin/chronyd"}'
HTTP/1.1 200 OK
Content-Type: application/json
Date: Wed, 15 Nov 2023 09:38:24 GMT
Content-Length: 74

{"ok":true,"processes":[{"pid":"10","cmdline":"/usr/sbin/chronyd -F -1"}]}

Installation

pre-built binary

VERSION=v0.0.1

# download
curl -fLROSs https://github.com/kunitsucom/pshealthz/releases/download/${VERSION}/pshealthz_${VERSION}_linux_amd64.zip

# unzip
unzip -j pshealthz_${VERSION}_linux_amd64.zip '*/pshealthz'

go install

go install github.com/kunitsucom/pshealthz/cmd/pshealthz@latest

Usage

$ pshealthz --help
Usage:
    pshealthz [options]

Description:
    check process health via http

options:
    --version (default: false)
        show version information and exit
    --addr (env: PSHEALTHZ_ADDR, default: localhost:8888)
        listen address for http server
    --help (default: false)
        show usage