Ubuntu Like MOTD on Debian


Published: April 15, 2018 Author: Saad Ali

This post is actually quite late.

So, Ubuntu has a dynamic MOTD. The dynamicity of MOTD in Ubuntu utilizes pam_motd(8) on top of which Ubuntu introduced the update-motd(5) framework.

Since PAM is used in every Linux system, anyone with sufficient knowledge can setup a dynamic MOTD on any Linux system.

Setting up dynamic MOTD manually on every server becomes quite boring. I wrote a Ansible role that would perform all the tasks. You can find the role listed on Ansible Galaxy or you can clone the GitHub repository.

The role currently supports Debian Jessie and Stretch distributions. I may update the role in future to support other distributions as well. It consists some bash scripts that fetch the data for you. A sample output is as follows:

 __  __            _       ____  ____         ___  _ 
|  \/  | __ _ _ __(_) __ _|  _ \| __ )       / _ \/ |
| |\/| |/ _` | '__| |/ _` | | | |  _ \ _____| | | | |
| |  | | (_| | |  | | (_| | |_| | |_) |_____| |_| | |
|_|  |_|\__,_|_|  |_|\__,_|____/|____/       \___/|_|


Welcome to Debian GNU/Linux 8.10 (jessie) (3.16.0-5-amd64).

System Information as of Monday 29 January, 2018 @ 12:43:35 PKT

Average System Load: 0.38 0.16 0.06

Total RAM: 1503 MiB     RAM Used: 31.00%
RAM Cached: .66%        RAM Free: 68.99%
RAM Available: 11.70%   Total SWAP: 1699 MiB
SWAP Used: 0%           SWAP Free: 100.00%

Total Storage Used on /: 10%

A total of 17 are pending.
17 are security updates.

Most of my work is inspired from Nick Charlton's blog post.

Try it out and let me know if you like it.

Share

Tagged as: Linux Debian Stretch Jessie MOTD Bash Ansible Ubuntu