Set it up once. Let the agent watch..
kb-monitor observes services deployed by kb-deploy. Every command has --json with a stable schema — the agent runs health checks, reads logs, and reacts autonomously.
Same file as kb-deploy.
kb-monitor reads .kb/deploy.yaml — the same file used to deploy services. No second source of truth, no parallel inventory.
Deploy and observability are paired by design. If kb-deploy knows about a target, kb-monitor does too.
registry: ghcr.io/your-org
targets:
api:
watch: [apps/api/**]
image: my-project/api
ssh:
host: ${SSH_HOST}
user: ${SSH_USER}
key_env: SSH_KEY
remote:
compose_file: ~/app/docker-compose.yml
service: api
permissions:
logs: true
health: true
exec: false
infrastructure:
postgres:
type: docker-image
image: postgres:16
ssh:
host: ${SSH_HOST}
user: ${SSH_USER}
key_env: SSH_KEY
restart: unless-stoppedEverything is scriptable.
kb-monitor healthRun health probes against every target. Pass or fail per service, with response latency.kb-monitor health kb-labs-webProbe a specific target. Useful for post-deploy verification in CI or agent workflows.kb-monitor statusRunning state, uptime, and image SHA for every target. The three things you need during an incident.kb-monitor status --jsonStructured output for agents and dashboards. Stable schema, every field documented.kb-monitor logs kb-labs-web --lines 100Fetch the last 100 lines of logs for a target. No SSH session, no docker ps needed.kb-monitor logs kb-labs-web --followStream live logs for a target from your laptop. Ctrl-C to stop, no cleanup needed.kb-monitor exec kb-labs-web -- df -hExecute a command inside the running container. Any command after -- is passed through verbatim.All commands support --json for scripts and agent workflows
The details that matter.
Health across every target, one command
health runs HTTP or TCP probes against every target defined in deploy.yaml. Pass or fail per service, with latency.
Running state, uptime, and image SHA
status gives you the three things you always want during an incident — current state, how long it's been that way, and exactly what's running.
Remote logs without SSH sessions
logs streams docker logs from the host. --lines for a tail, --follow for live tail. No more SSH into a box just to tail a file.
Set up once. Forget about monitoring.
curl -fsSL https://kblabs.ru/kb-monitor/install.sh | sh