• About Me
  • Impressum
  • Privacy
  • Status Page

№42

... it's better to have good questions

APT Monitoring with Prometheus

2022-12-24 1 min read Monitoring How-To Ronny Trommer

As soon you run a Linux server, you need to make sure your systems are up-to-date. It would also be handy to know if you had Kernel upgrades which require a reboot of the system to get applied.

I came across a blog post from Tom Henderson which provided a solution using the Node_Exporter with Prometheus. The way he solved this is pretty slick. I had to tweak the scripts a bit to get it running. He integrated an APT hook which runs a command on apt update and after installing packages. The hooks create a Prometheus file which can be easily shipped with the Node_Exporter.

The high level steps are pretty straight forward.

  1. Add a wrapper script which creates the apt.prom file format for you.
  2. Install the apt hook.
  3. Enable the text file collector and point it to your directory with the apt.prom file.
  4. Scrape the Node_Exporter endpoint with Prometheus
  5. Install the Grafana dashboard

I’ve collected the scripts and a Grafana dashboard you can use in the apt-prometheus repository.

Feel free to fork - merry x-mas and have fun.

Featured image by Renate Köppel from Pixabay.

Grafana Prometheus
Latest posts
  • Why You Should Care About Your Release Notes
  • How Docker Broke the Internet for Me
  • macOS with Apple Silicon and x86-64-v3 support
  • Streaming telemetry with gNMI
  • Go away or I replace you with a Makefile
  • SNMP Proxy ... wait what?
  • Hackathon on BGP monitoring using BMP in OpenNMS
  • Dealing with secrets in OpenNMS Horizon
  • Building container images for OpenNMS
  • Hello Containerlab with Orbstack
Categories
  • OpenNMS (27)
  • Technology (26)
  • How-To (23)
  • Monitoring (13)
  • Container (8)
  • Tutorial (8)
  • Events (6)
  • Open-Source (6)
  • BGP (2)
  • Networking (2)
Social media
© 2025 made in 🇪🇺 by Ronny Trommer with ❤️ for Open Source
Bilberry Hugo Theme