Skip to content

About

Generates simple prometheus file from APT updates

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

apt-exporter

Generate a Prometheus file from the state of your APT repositories.

Scrape this file using the node_exporter textfile collector.

Metrics

These metrics are exported:

Name Type Description
apt_upgrades_total gauge Total number of packages to be upgraded
apt_security_upgrades_total gauge Number of security related packages to be upgraded
apt_reboot_needed gauge Indicates if a system reboot is needed (1 for yes, 0 for no)
apt_refresh_time_seconds gauge Indicates the last time the prometheus file was refreshed (unix time)

Labels

A hostname label is added to all metrics.

Security

The number of security upgrades depends on the repositories you use. It is based on packages from repositories with security in their name.

Installation

Option 1

Run this script during the automatic package refresh: add a similar configuration file to the /etc/apt/apt.conf.d/ directory.

APT::Periodic::Update-Package-Lists "1";

APT::Update::Post-Invoke-Success {
  "/path/apt_exporter/apt_exporter -quiet -output /path/collector-files/apt.prom || true"
};

DPkg::Post-Invoke {
  "/path/apt_exporter/apt_exporter -quiet -output /path/collector-files/apt.prom || true"
};

It also means the script will run as the root user.

Options 2

Run this script in a crontab, or as a systemd timer.

/path/apt_exporter/apt_exporter -quiet -output /path/collector-files/apt.prom

About

Generates simple prometheus file from APT updates

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages