patchmon-exporter

patchmon-exporter

Docker app from louij2's Repository

Overview

Prometheus exporter for PatchMon that answers "is the fleet actually patched?" - a different question from "is PatchMon up" or "did the agent check in", both of which can stay green while a host silently stops applying updates. Reads PatchMon's Postgres backing store directly, read-only, as a dedicated DB role.

patchmon-exporter

Prometheus exporter for PatchMon that answers "is the fleet actually patched?" — a different question from "is PatchMon up" (which a blackbox probe already answers) or "did the agent check in" (which can stay green while updates silently fail to apply).

Reads PatchMon's Postgres backing store directly, read-only, as a dedicated DB role with SELECT and nothing else — PatchMon's own REST API needs a session/API key per host with no fleet-wide read token, so the database is the only place to see every host's patch state in one query.

Key metric: patchmon_host_patch_stale_seconds — age since a host last successfully applied updates, independent of whether its agent is still checking in on schedule. See the module docstring in exporter.py for the real incident (a host silently unpatched for 2+ months while every check-in-based signal read healthy) that this exists to catch.

Build

docker build -t patchmon-exporter:latest .

Run

docker run -d --name patchmon-exporter --restart unless-stopped \
  -p 9820:9820 \
  --network patchmon-internal \
  -v /path/to/patchmon-dsn:/run/secrets/patchmon-dsn:ro \
  patchmon-exporter:latest

The DSN file (default path /run/secrets/patchmon-dsn, override with PATCHMON_DSN_FILE) holds a standard Postgres connection string, e.g. host=patchmon-database-1 port=5432 dbname=patchmon_db user=patchmon_exporter password=..., for a dedicated read-only role — never bake the DSN into the image or a plain env var. LISTEN_PORT (default 9820) and CACHE_SECONDS (default 60) are also overridable via env.

Scrape :9820/metrics with Prometheus. Needs network access to PatchMon's Postgres instance — join its internal docker network or expose the DB port.

Install patchmon-exporter on Unraid in a few clicks.

Find patchmon-exporter in Community Apps on your Unraid server, review the template, and click Install. Unraid handles the Docker app or plugin setup from the published template.

Open the Apps tab on your Unraid server Search Community Apps for patchmon-exporter Review the template variables and paths Click Install

Requirements

Network access to PatchMon's Postgres database, plus a dedicated read-only DB role for the exporter to connect as.

Download Statistics

58
Total Downloads

Related apps

Details

Repository
louij2/patchmon-exporter:latest
Last Updated2026-09-17
First Seen2026-09-18

Runtime arguments

Web UI
http://[IP]:[PORT:9820]/metrics
Network
bridge
Shell
sh
Privileged
false
Extra Params
--restart=unless-stopped --memory=256m --cpus=0.5

Template configuration

Host Port 9820Porttcp

Container Port: 9820

Target
9820
Default
9820
Value
9820
patchmon-dsnPathro

Read-only bind mount to a file holding a Postgres DSN, e.g. host=patchmon-database port=5432 dbname=patchmon_db user=patchmon_exporter password=...

Target
/run/secrets/patchmon-dsn
Value
/mnt/user/appdata/patchmon-exporter/dsn