In Ubuntu servers there is a program called
update-motd from package
UNIX/Linux system adminstrators often communicate important information
to console and remote users by maintaining text in the file /etc/motd,
which is displayed by the pam_motd(8) module on interactive shell
Traditionally, this file is static text, typically installed by the
distribution and only updated on release upgrades, or overwritten by
the local administrator with pertinent information.
Ubuntu introduced the update-motd framework, by which the motd(5) is
dynamically assembled from a collection of scripts at login.
This collection of scripts lives under
/etc/update-motd.d/. For more information see this wiki page.
Another alternative to generating
/etc/motd, instead of having a script run at login is to have a cron job. Certainly it is not the same, but I have met this approach sometimes in the past.