Build status | Vulnerabilities |
---|---|
This is a Prometheus exporter for discoverable UPnP devices, scraping all state variables that are available by calling a argument-less getter Action, and presenting them in a Prometheus compatible format.
This is an early work in progress, yet enough to auto-discover metrics exported by an AVM Fritz!Box. I also have other devices announced via SSDP on my network (FireTV, Logitech Harmony), but none of those seem to export any useful SOAP operations.
UPnP SSDP discovery requires Multicast networking. Especially for Docker, this requires --net host
, and this in turn
is not supported on Docker for Mac.
Either install a JDK (tested with OpenJDK 8) and run ./mvnw package
to create an executable JAR only
(to be found in unp-exporter/target then), or install Docker and use
docker build . -t upnp-exporter:latest
to create a Docker image.
By default, the exporter runs on port 19133, which can be overridden by setting the UPNP_SERVER_PORT
env
variable. The server then listens on this port (plain HTTP), prometheus metrics are
available at http://host:$port/prometheus
.
For complete list of configurable items and their defaults, see the application.yml
Environment variable | Description | Default | Required |
---|---|---|---|
UPNP_SERVER_PORT | HTTP Server port | 19133 | no |
scrape_configs:
- job_name: upnp-exporter
metrics_path: /prometheus
scheme: http
static_configs:
- targets:
- upnp-exporter:19133
TODO
TODO
The exporter discovers all UPnP devices announcing themselves via Multicast SSDP. It then registers Meters for all numeric or boolean state variables that are retrievable by calling an argument-less getter SOAP action.
- Discovery does not work without Multicast, e.g. in Docker without
--net host
, esp. Docker for Mac. - Does not work on OpenJ9 variants of OpenJDK (Runs into stack overflows in tests, Jackson serialization yields empty Strings)