Simple service and timer for the apt.sh
metrics script from the Prometheus community script collection.
Used on a Debianite system with the Debian repository version of node-exporter
, YMMV. puppet/prometheus
uses node-exporter
as the group by default, can be changed by setting prometheus::node_exporter::group
via hiera/resource parameter.
Alternative uses with ACLs are possible; one would have to investigate if the DynamicUser
overlay would work for deleting files from a directory.
Last active
July 9, 2020 12:43
-
-
Save towo/d13ad92fc554c8aa6a7f53aea030520c to your computer and use it in GitHub Desktop.
Apt metrics systemd units for prometheus-node-exporter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Collect APT metrics | |
[Service] | |
ExecStartPre=rm -f /var/lib/prometheus/node-exporter/apt.prom | |
ExecStart=/usr/local/bin/apt.sh | |
User=nobody | |
Group=prometheus | |
StandardOutput=file:/var/lib/prometheus/node-exporter/apt.prom |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Collect APT metrics | |
[Timer] | |
OnCalendar=hourly | |
Unit=apt-metrics.service | |
[Install] | |
WantedBy=timers.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment