Skip to content

Centril/motd.dynamic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Gittip License Semver

motd script for linux written in python, highly configurable with lots of eyecandy. It runs all the information gathering in separate concurrent proccesses and thus is fast, relatively speaking.

Features

motd.dynamic reports the following information:

  • uptime.
  • booted on.
  • system time.
  • system info (dist, os, release-version, arch).
  • usage of /, same as running df / - 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

Installation

1 - Prerequisites

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
2 - Clone the repo:
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
4 - Add script to /etc/profile.
echo /opt/motd.dynamic/motd.dynamic | sudo tee -a /etc/profile
5 - Remove Last Login & Motd from sshd logins.

Find PrintMotd and PrintLastLog, set them both to no. Then restart sshd

sudo nano /etc/ssh/sshd_config
/etc/init.d/ssh restart

Deciding on a figlet font:

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

About

motd script written in python, highly configurable and lots of eyecandy

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages