Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apt-get: Add a plugin which checks for the availability of updates on Debian based systems #755

Open
mrmolybdaen opened this issue Apr 7, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@mrmolybdaen
Copy link

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:

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?

Kind regards
Christian

Additional context

Work in progress, currently missing tests: https://github.com/mrmolybdaen/monitoring-plugins/tree/check_apt/check-plugins/apt-get

@mrmolybdaen mrmolybdaen added the enhancement New feature or request label Apr 7, 2024
@markuslf
Copy link
Member

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 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
@mrmolybdaen
Copy link
Author

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?

@markuslf
Copy link
Member

You can contact us at info [at] linuxfabrik [dot] ch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants