Code Monkey home page Code Monkey logo

firemotd's Introduction

Bash tool to display system information after logging into a Linux system

Idea

This tool displays useful system information after logging into a Linux system, such as version, CPU information, memory, disk information, number of updates, ...

Screenshots

Modern:

FireMotD Modern

Blue:

FireMotD Blue

Red:

FireMotD Red

Gray:

FireMotD Gray

Original:

FireMotD Original

Status

Production ready.

How To

Please check https://outsideit.net/FireMotD for more information on how to use this plugin.

Help

In case you find a bug or have a feature request, please make an issue on GitHub.

Install Dependencies

Using yum
sudo yum install openssh-clients bc sysstat
Using apt-get
sudo apt-get install bc sysstat

Usage Help

$ FireMotD --help
FireMotD v5.13.160630

Usage: 
 FireMotD [-v] -t <Theme Name> 
 FireMotD [-v] -C ['String']
 FireMotD [-vUhVs]

Options:
 -h | --help               Shows this help and exits
 -v | --verbose            Verbose mode (shows messages)
 -V | --version            Shows version information and exits
 -t | --theme <Theme Name> Shows Motd info on screen, based on the chosen theme
 -C | --colortest          Prints color test to screen
 -M | --colormap           Prints color test to screen, with color numbers in it
 -U | --updates            Checks for system updates and prints count to stdout
 -S | --saveupdates        Checks for system updates and saves count to disk
                           same as [ FireMotD -U > /var/tmp/updatecount.txt ]

256-color themes:
 original
 modern
 gray
 orange

16-color themes:
 red
 blue
 clean

HTML theme:
 html

Examples:
 FireMotD -t original
 FireMotD -t html > /tmp/motd.html
 FireMotD --theme Modern
 FireMotD --colortest
 FireMotD -M
 sudo /usr/local/bin/FireMotD --saveupdates

Note:
 Some functionalities may require superuser privileges. Eg. check for updates.
 If you have problems, try something like:
 sudo /home/tavinus/FireMotD/FireMotD -S

System Install

You need to have make installed on the system, if you want to use the Makefile.

To install to /usr/local/bin/FireMotD
sudo make install

With this you can probably run FireMotD from anywhere in your system. If not, you need to add /usr/local/bin to your $PATH variable. To adjust the installation path, change the var IDIR=/usr/local/bin in the Makefile to the path you want.

To install bash autocompletion support
sudo make bash_completion

With this you can use TAB to autocomplete parameters and options with FireMotD. Does not require the sudo make install above (system install), but requires the bash-completion package to be installed and working. Then you should logout-login or source the bash completion file, eg. $ . /etc/bash_completion.d/FireMotD

If you don't have root access, just install everything on your user's folder and source the file from your user's .profile file

Crontab to get system updates count

This is an example on how to record the system update package count daily.
This will update the file /var/tmp/updatecount.txt for later access.
Root privilege is required for this operation.

To edit root's crontab
sudo crontab -e
Then add this line
# FireMotD system updates check (randomly execute between 0:00:00 and 5:59:59)
0 0 * * * root perl -e 'sleep int(rand(21600))' && /usr/local/bin/FireMotD -S &>/dev/null

Apt configuration to update updates count

On systems with apt (Debian, Ubuntu, ...) add the following configuration lines to refresh the updates count after an apt action (install, remove, ...) was performed.

Create the apt configuration file /etc/apt/apt.conf.d/15firemotd containing:

DPkg::Post-Invoke {
  "if [ -x /usr/local/bin/FireMotD ]; then echo -n 'Updating FireMotD available updates count ... '; /usr/local/bin/FireMotD -S; echo ''; fi";
};

Adding FireMotD to run on login

Choosing where to run your script is kind of situational. Some files will only run on remote logins, other local logins, or even both. You should find out what suits best your needs on each case.

To add FireMotD to a single user

Edit the user's ~/.profile file, ~/.bash_profile file, or the ~/.bashrc file

nano ~/.profile

Add the FireMotD call at the end of the file (choose your theme)

/usr/local/bin/FireMotD -t red
To add FireMotD to all users

You may call FireMotD from a few different locations for running globally.
Eg. /etc/bash.bashrc, /etc/profile.

You may also create a initialization script init.sh which will call the FireMotD script in /etc/profile.d when logging in. You can put whatever you like in this init.sh script. Everything in it will be executed at the moment someone logs in your system. Example:

#!/bin/bash
 
/usr/local/bin/FireMotD --Theme Red

On Nagios Exchange

https://exchange.nagios.org/directory/Utilities/FireMotD/details

Copyright

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details at http://www.gnu.org/licenses/.

firemotd's People

Contributors

dimon222 avatar jasonrivers avatar stgarf avatar tavinus avatar thomdietrich avatar tontonitch avatar willemdh avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.