This page looks best with JavaScript enabled

Enhancing 'motd' with 'server-info'

   · ☕ 2 min read

My memory isn’t what it used to be, but I have this blog. 😄 And on the handful of CentOS and Ubuntu servers that I maintain, I have my server-info script, my replacement for motd. 😄

Requirements: mdv and figlet

The server-info script/command relies on a pair of utilities, namely mdv and figlet.

The server-info Script

You’ll find the script itself in this gist. Sample installation of the script is documented below, and the content template can be found in this gist.

Sample Installation on DGDocker3, a CentOS 7 Host

DGdocker3.Grinnell.edu is a CentOS 7 / Docker server that I use for development and testing at Grinnell College. This is what I did on DGDocker3 to install my server-info command:

sudo yum update
sudo yum install epel-release
sudo yum install figlet
sudo yum install python-pip
sudo pip install --upgrade pip
sudo pip install mdv

Then, to “install” the initial script and content template…

sudo su
cd /usr/local/bin
curl https://gist.githubusercontent.com/McFateM/8a81e74be780697cf8ab6e63a707052f/raw > server-info
chmod 755 server-info
cd /etc
curl https://gist.githubusercontent.com/McFateM/98a3247a388b826a16c7f985e1d0351c/raw > server-info.md

Sample Installation in Ubuntu

mcfate.family is a domain I currently use for testing, and right now (May 2020) it’s pointed at an Ubuntu 18.04 LTS droplet at DigitalOcean. This is what I did on that host, as root, to install my server-info command:

apt-get update
apt-get install figlet
apt install python-pip
pip install mdv

Then, to “install” the initial script and content template, again as root

cd /usr/local/bin
curl https://gist.githubusercontent.com/McFateM/8a81e74be780697cf8ab6e63a707052f/raw > server-info
chmod 755 server-info
cd /etc
curl https://gist.githubusercontent.com/McFateM/98a3247a388b826a16c7f985e1d0351c/raw > server-info.md

Use

So, how’s it used? Simple, just enter server-info at any command prompt on the host.

Updating the Maintenance Information

That’s easy too, just use sudo nano /etc/server-info.md and apply your changes/additions, then save the file.

And that’s a wrap. Until next time… 😄

Share on

Mark A. McFate
WRITTEN BY
Mark A. McFate
Digital Library Applications Developer