When I login to my Ubuntu (18.04) boxes using ssh or on the console, I get a helpful messages telling me how many updates are outstanding, how many are security related and if a reboot is required. I would like to expose this information in my monitoring platform - but what generates it?

I've looked in /etc/profile, /etc/profile.d and ~/.bash_profile (/etc/motd does not exist) but I don't see anything there which would generate this.

  • I found a partial answer here: askubuntu.com/questions/164/… so that just leaves the question of patches.
    – symcbean
    Jul 13, 2020 at 16:35
  • apt list --upgradable | grep "\-security" works but with dire warnings :(
    – symcbean
    Jul 13, 2020 at 16:40
  • apt-daily.service generates those strings once daily, and hands those strings to motd-news.service (which also runs once daily), so those numbers might be quite stale by the time you see them at login. We generally encourage folks to use Unattended Upgrades precisely so you don't need to monitor pending security upgrades (important), pending other upgrades (routine), and reboot flags (routine).
    – user535733
    Jul 13, 2020 at 16:48
  • Checkout /etc/update-motd.d
    – Ravexina
    Jul 13, 2020 at 17:39


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.