Skip to content

Latest commit

 

History

History
74 lines (49 loc) · 3.66 KB

README.md

File metadata and controls

74 lines (49 loc) · 3.66 KB

UPnP exporter

 Build status Vulnerabilities
Docker Build JDK Compatibility Snyk Vulnerabilities for UPNP Exporter Snyk Vulnerabilities for UPnP Utils Snyk Vulnerabilities for Parent POM

Introduction

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.

Limitations

UPnP SSDP discovery requires Multicast networking. Especially for Docker, this requires --net host, and this in turn is not supported on Docker for Mac.

Building

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.

Usage

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.

Configuration

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

Prometheus scraping config

scrape_configs:
  - job_name: upnp-exporter
    metrics_path: /prometheus
    scheme: http
    static_configs:
      - targets:
        - upnp-exporter:19133

Grafana dashboard

TODO

Available metrics

TODO

How it works

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.

References

Known Issues and TODOs

  • 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)