motd
script forlinux
written inpython
, highly configurable with lots of eyecandy. It runs all the information gathering in separate concurrent proccesses and thus is fast, relatively speaking.
motd.dynamic
reports the following information:
uptime
.booted on
.system time
.system info
(dist, os, release-version, arch).- usage of
/
, same as runningdf /
- with color warnings if not enough free space. sshd sessions
reporting: all the logged-in users and how many per user. Color notification if root is on.memory usage & swap usage
.load average
.number of processes
(total and for current user).public hostname & IP
.internal hostname & IP
.apt-get upgrades reporting
.
Additionally, it provides a nice colorized banner made with figlet
, or pyfiglet
to be precise, as well as something like the following, but more elegantly and with colors, using fortune
and cowsay
:
fortune | cowsay
Assuming you have apt-get
- installed on debian
based dists, you need to:
sudo apt-get update
sudo apt-get install python python-dev pip fortune fortunes cowsay
sudo pip install -U pyfiglet uptime ipgetter psutil futures git+http://github.com/bufordtaylor/python-texttable
Or do this if you have apt-fast
sudo apt-fast update
sudo apt-fast install python python-dev pip
sudo apt-fast install fortune fortunes cowsay
sudo pip install -U pyfiglet uptime ipgetter psutil futures git+http://github.com/bufordtaylor/python-texttable
cd /opt
git clone https://github.com/Centril/motd.dynamic/
cd motd.dynamic
chmod +x motd.dynamic
This installs it to /opt/motd.dynamic
, but the choice is yours.
3 - Configure & Edit motd.dynamic
with your favourite editor.
nano motd.dynamic
echo /opt/motd.dynamic/motd.dynamic | sudo tee -a /etc/profile
Find PrintMotd
and PrintLastLog
, set them both to no
.
Then restart sshd
sudo nano /etc/ssh/sshd_config
/etc/init.d/ssh restart
Can't decide what figlet font to use? Run this in and replace <text>
with the text you wish to use.
pyfiglet -l | while read line ; do echo $line && echo && pyfiglet <text> --font=$line ; done > figletfonts