1

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.

symcbean
  • 219
  • 1
  • 8
  • I found a partial answer here: https://askubuntu.com/questions/164/how-can-i-tell-from-the-command-line-whether-the-machine-requires-a-reboot so that just leaves the question of patches. – symcbean Jul 13 '20 at 16:35
  • apt list --upgradable | grep "\-security" works but with dire warnings :( – symcbean Jul 13 '20 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 '20 at 16:48
  • Checkout /etc/update-motd.d – Ravexina Jul 13 '20 at 17:39

0 Answers0