|
1 | 1 | #!/usr/bin/env python3 |
2 | | -# |
3 | | -# Description: Expose metrics from apt. This is inspired by and |
4 | | -# intended to be a replacement for the original apt.sh. |
5 | | -# |
6 | | -# This script deliberately does *not* update the apt cache. You need |
7 | | -# something else to run `apt update` regularly for the metrics to be |
8 | | -# up to date. This can be done in numerous ways, but the canonical way |
9 | | -# is to use the normal `APT::Periodic::Update-Package-Lists` |
10 | | -# setting. |
11 | | -# |
12 | | -# This, for example, will enable a nightly job that runs `apt update`: |
13 | | -# |
14 | | -# echo 'APT::Periodic::Update-Package-Lists "1";' > /etc/apt/apt.conf.d/99_auto_apt_update.conf |
15 | | -# |
16 | | -# See /usr/lib/apt/apt.systemd.daily for details. |
17 | | -# |
18 | | -# Dependencies: python3-apt, python3-prometheus-client |
19 | | -# |
20 | | -# Authors: Kyle Fazzari <[email protected]> |
21 | | -# Daniel Swarbrick <[email protected]> |
| 2 | + |
| 3 | +""" |
| 4 | +Description: Expose metrics from apt. This is inspired by and |
| 5 | +intended to be a replacement for the original apt.sh. |
| 6 | +
|
| 7 | +This script deliberately does *not* update the apt cache. You need |
| 8 | +something else to run `apt update` regularly for the metrics to be |
| 9 | +up to date. This can be done in numerous ways, but the canonical way |
| 10 | +is to use the normal `APT::Periodic::Update-Package-Lists` |
| 11 | +setting. |
| 12 | +
|
| 13 | +This, for example, will enable a nightly job that runs `apt update`: |
| 14 | +
|
| 15 | + echo 'APT::Periodic::Update-Package-Lists "1";' > /etc/apt/apt.conf.d/99_auto_apt_update.conf |
| 16 | +
|
| 17 | +See /usr/lib/apt/apt.systemd.daily for details. |
| 18 | +
|
| 19 | +Dependencies: python3-apt, python3-prometheus-client |
| 20 | +
|
| 21 | +Authors: Kyle Fazzari <[email protected]> |
| 22 | + Daniel Swarbrick <[email protected]> |
| 23 | +""" |
22 | 24 |
|
23 | 25 | import apt |
24 | 26 | import apt_pkg |
|
0 commit comments