You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In addition to the deb-lastactivity plugin I would be pleased if the monitoring plugins could introduce a plugin apt/apt-get which could inform about pending updates like the check_apt plugin provided by the Debian Nagios Maintainer Group does.
The check provided by them can optionally do an apt-get update to refresh the apt cache.
It returns a list with upgradable packages, marking packages from Debian's or Ubuntu's security repos with "(security)", looking a bit like this:
APT CRITICAL: 3 packages available for dist-upgrade (1 critical updates).
runc (security)
php8.3-common
php8.3-mysql
Given there is a Python API for APT provided by the APT Developers (maintained here: python-apt, documented there) I thought it might be a good idea to use it instead of wildly regexing command line calls. So I started playing around.
The API might be counterintuitive and the resulting script is not really fast (could be caused by my implementation using all the apt caches) but I managed to create something myself resembling the original a bit. What do you think?
It looks pretty good and fits very well into the collection. If you are interested in feedback on the code, how can I best contact you?
markuslf
changed the title
[apt-get: add ] A plugin which checks for the availability of updates on Debian based systems
apt-get: Add a plugin which checks for the availability of updates on Debian based systems
Apr 10, 2024
Feedback on the code would be highly appreciated. At the moment e-mail or of course Github would work the best. But I am unsure of how to share contact information securely - maybe a gist would do fine?
Describe the solution you'd like
Hello together,
In addition to the deb-lastactivity plugin I would be pleased if the monitoring plugins could introduce a plugin apt/apt-get which could inform about pending updates like the check_apt plugin provided by the Debian Nagios Maintainer Group does.
The check provided by them can optionally do an
apt-get update
to refresh the apt cache.It returns a list with upgradable packages, marking packages from Debian's or Ubuntu's security repos with "(security)", looking a bit like this:
Given there is a Python API for APT provided by the APT Developers (maintained here: python-apt, documented there) I thought it might be a good idea to use it instead of wildly regexing command line calls. So I started playing around.
The API might be counterintuitive and the resulting script is not really fast (could be caused by my implementation using all the apt caches) but I managed to create something myself resembling the original a bit. What do you think?
Kind regards
Christian
Additional context
Work in progress, currently missing tests: https://github.com/mrmolybdaen/monitoring-plugins/tree/check_apt/check-plugins/apt-get
The text was updated successfully, but these errors were encountered: