https://github.com/boolka/probe
Simplest possible solution to check service availability
https://github.com/boolka/probe
Last synced: 7 months ago
JSON representation
Simplest possible solution to check service availability
- Host: GitHub
- URL: https://github.com/boolka/probe
- Owner: boolka
- License: mit
- Created: 2023-01-17T10:06:29.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-01-17T10:13:24.000Z (about 3 years ago)
- Last Synced: 2025-03-28T08:17:04.121Z (10 months ago)
- Language: C
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Probe
## Purpose
Simplest possible solution to check service availability.
Can be used in docker `HEALTHCHECK` instruction (check `docker/Dockerfile.test` folder for example).
## Usage
Usage: probe [...OPTIONS] [HOST]
Options:
- -s, --service - service to connect to
- -p, --port - port to connect to
- -r, --retry - retry count
- -t, --timeout - timeout between retryings
- -h, --help - this help message
- -v, --version - current application version
Examples:
- `probe --port=80 1.2.3.4`
- `probe --service=http localhost`
- `probe --port=8080 localhost`
- `probe --timeout=3 --retry=5 --service=https example.com`
## Description
This program uses GNU Name Service Switch (NSS) mechanics to determine the `HOST` to resolve.
The first thing probe is doing is trying to determine the host. When it is unavailable then it failures.
After this probe will try to connect to host that many times that `retry` & `timeout` tells.
On success probe will return `0` and `1` on failure.
Don't use the `0.0.0.0` address.
## Requirements
- libc
## TODO
- Check all addresses in `struct hostent`.
- Only `tcp` protocol for now is available.