Open mrmolybdaen opened 3 months ago
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?
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?
You can contact us at info [at] linuxfabrik [dot] ch.
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