MOTDs32/README.md

234 lines
7.7 KiB
Markdown
Raw Permalink Normal View History

2017-09-02 15:18:39 +02:00
![MIT Licence](https://img.shields.io/dub/l/vibe-d.svg?style=flat-square)
2017-09-07 01:58:09 +02:00
![bash](https://img.shields.io/badge/bash-100%25-brightgreen.svg?style=flat)
![bash](https://img.shields.io/badge/Installation-Easy-blue.svg)
2017-09-02 15:18:39 +02:00
Project 2017 *fork on MOTDstat https://bitbucket.org/hetii/motdstat*
-----
2017-07-31 19:21:31 +02:00
2018-02-21 22:14:56 +01:00
2017-08-01 14:16:50 +02:00
## **MOTDs32** = MOTD + Stats32
2017-07-20 11:20:55 +02:00
2017-09-02 15:18:39 +02:00
2017-07-20 11:19:39 +02:00
2017-07-26 11:16:55 +02:00
```
2017-07-19 13:15:28 +02:00
,--. ,--. ,-----. ,--------.,------. ,----. ,---.
2017-07-19 10:01:43 +02:00
| `.' |' .-. ''--. .--'| .-. \ ,---. '.-. |'.-. \
2017-07-31 22:48:25 +02:00
| |'.'| || | | | | | | | \ :( .-' .' ; .-' .'
2017-07-19 10:01:43 +02:00
| | | |' '-' ' | | | '--' /.-' `)/'-' |/ '-.
`--' `--' `-----' `--' `-------' `----' `----' '-----'
2017-07-26 11:16:55 +02:00
| + |
2017-08-01 13:11:45 +02:00
by 🅴🆁🆁🅴🆄🆁32
2017-09-02 15:18:39 +02:00
https://git.echosystem.fr/Erreur32/MOTDs32
2017-07-26 11:16:55 +02:00
```
2018-01-22 16:14:45 +01:00
Show "Message Of The Day" in Unix terminal.
2017-08-01 14:16:50 +02:00
--------------------------------------------------
2017-08-01 12:50:49 +02:00
2018-03-16 13:48:48 +01:00
[What it is?](#what-it-is) | [Requirements](#requirements) | [Installation](#installation) | [Uninstall](#uninstall) | [Documentation](#documentation) | [Sample Report](#sample-motd32-report) | [Stats git Repo](#stats-repo) | [License](#license)
2017-08-08 23:47:32 +02:00
---------------|---------------------|------------------|-----------------|-----------------|-------------------------|----------------------|----------------------
2017-07-26 11:16:55 +02:00
2017-08-01 14:16:50 +02:00
--------------------------------------------------
2017-07-26 10:15:18 +02:00
2017-08-01 13:11:45 +02:00
What it is?
----------
2017-07-26 10:16:54 +02:00
2017-08-01 14:16:50 +02:00
MOTDs32 is a fork of the excelent MOTDstat ! [Original project modstat](http://www.gelogic.net/)
2017-07-26 10:15:18 +02:00
2017-08-01 13:11:45 +02:00
*Usage: generate dynamicaly the /etc/motd file with current information about system resources and usage
2017-07-30 22:40:45 +02:00
The original message of the day is now stored in /etc/motd.orig file.
2017-08-01 13:11:45 +02:00
Everytime you connect throught the SSH you will see some informations (customisable).*
2017-07-30 22:40:45 +02:00
2017-08-01 13:11:45 +02:00
- It's only for a g33k or adminsys for check some services status in the shell.
2017-07-30 22:40:45 +02:00
2017-08-05 23:33:13 +02:00
- Add a beautifull MOTD for shell bash, each ssh connection and also with bash command.
2017-08-01 13:11:45 +02:00
Requirements
------------
- SHELL >= bash: 4.3.30(1)
- figlet (*install auto in install.sh*)
- build-essential (package for build) (*install auto in install.sh*)
2018-03-16 11:57:21 +01:00
- Postfix
2017-07-30 22:40:45 +02:00
2018-03-16 13:45:58 +01:00
2017-08-01 13:11:45 +02:00
Installation
------------
2017-07-30 23:21:40 +02:00
2017-09-02 15:18:39 +02:00
(See [install](https://git.echosystem.fr/Erreur32/MOTDs32/blob/master/INSTALL) file.)
2017-07-23 16:00:53 +02:00
2017-07-30 22:40:45 +02:00
type inside the directory:
```bash
2019-12-08 11:37:53 +01:00
$ bash install.sh
2017-08-01 13:11:45 +02:00
--> Answer: y and enter (install the package if needed)
--> see option 3 for uninstall
2017-07-30 22:40:45 +02:00
```
2019-12-08 11:37:53 +01:00
2018-01-03 13:28:35 +01:00
2017-08-05 23:38:24 +02:00
You can set differents features in `/etc/motds32/motds32.conf`
2017-07-31 14:07:31 +02:00
2017-08-08 23:47:32 +02:00
2018-03-16 13:45:58 +01:00
Screen:
------------
[![asciicast](https://asciinema.org/a/Tzr3NNF8pEB9FZ13d3kYDMBw5.png)](https://echosystem.fr/MOTDs32/player/)
Update
2017-08-08 23:47:32 +02:00
-------
2017-08-08 23:50:06 +02:00
You Need to redownload (git pull) the lastest version form gitlab.
do the following:
2017-08-08 23:47:32 +02:00
```bash
2017-09-02 15:16:43 +02:00
$ git clone https://git.echosystem.fr/Erreur32/MOTDs32.git
2017-08-08 23:47:32 +02:00
$ cd MOTDs32
2019-12-08 11:37:53 +01:00
$ bash install.sh (option 3)
2017-08-08 23:47:32 +02:00
$ git pull
2019-12-08 11:37:53 +01:00
$ bash install.sh
2017-08-08 23:47:32 +02:00
```
Uninstall
-----------
2019-12-08 11:37:53 +01:00
Choose **option 3** with `install.sh` script !
2017-08-08 23:47:32 +02:00
2017-07-31 14:14:08 +02:00
Documentation
2017-07-31 14:07:31 +02:00
-------------
2019-12-08 11:37:53 +01:00
2017-08-05 23:38:24 +02:00
in your shell bash type: motd
2017-07-30 22:40:45 +02:00
```bash
$ motd
2017-07-19 12:58:45 +02:00
Usage: motds32 OPTIONS
-g, --generate Check system status and generate it to /etc/motd file
2020-05-18 11:20:49 +02:00
-s, --status Show limited content of MOTDs32 file
-o, --old Show limited content of old MOTD file
2017-07-19 12:58:45 +02:00
-v, --version Display information about motds32 version and author
2020-05-18 11:20:49 +02:00
-U, --update Update MOTD now!
2017-07-30 22:40:45 +02:00
```
2017-07-19 13:03:44 +02:00
2017-08-01 13:11:45 +02:00
Result with **CAT**:
2017-07-30 22:40:45 +02:00
```bash
$ cat /etc/motd
```
2017-07-19 13:09:02 +02:00
2017-08-01 13:11:45 +02:00
Result with **motds32**:
2017-07-30 22:40:45 +02:00
```bash
2017-08-01 13:11:45 +02:00
$ /usr/bin/motds32
2017-07-30 22:40:45 +02:00
```
2017-07-21 12:22:16 +02:00
2017-07-31 14:15:14 +02:00
--------------------------------------------------
2017-07-19 12:53:09 +02:00
2017-07-31 14:14:08 +02:00
Sample MOTD32 Report
--------------------
2017-07-19 00:05:06 +02:00
2017-07-30 22:40:45 +02:00
```bash
$ motd -m
2017-07-21 10:07:37 +02:00
Read motds32 file
echosystem.fr > status at 10:05 > 5min load is 0.82 on 8 cpu(s)
2017-07-19 00:05:06 +02:00
Disk status | Memory status | Service status
partition free usg | Memory used kB [%] | service(s) (count)
2017-07-21 10:07:37 +02:00
/ 4,9G 74% | Memory: 59711808 90% | tcp/0.0.0.0:2222
/home 1,5T 12% | Swap: 3560 0% | tcp6/:::2222
| Buffers: 1271192 | tcp/0.0.0.0:25
| Cached: 51624824 | tcp6/:::25
2017-07-19 00:05:06 +02:00
| | tcp/127.0.0.1:8080
| | tcp6/:::80
| | tcp6/:::443
| | udp/37.187.162.229:123
| | udp/127.0.0.1:123
| | udp/0.0.0.0:123
| | udp6/fe80::ec4:7aff:fe0f:123
| | udp6/2001:41d0:d:2e5:::123
| | udp6/::1:123
2017-07-21 10:07:37 +02:00
__ __ ___
.-----.----.| |--.-----.-----.--.--.-----.| |_.-----.--------. .' _|.----.
| -__| __|| | _ |__ --| | |__ --|| _| -__| |__| _|| _|
|_____|____||__|__|_____|_____|___ |_____||____|_____|__|__|__|__|__| |__|
|_____|
/bin/bash : root
10:05:39 up 66 days, 15:35, 2 users, load average: 1,40, 0,79, 0,67
2017-07-19 00:07:36 +02:00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
2017-07-31 04:59:39 +02:00
erreur32 pts/0 143.173.370.24 mar.15 2days 1.62s 0.26s sshd: erreur32 [priv]
erreur32 pts/1 2a01:e45:8ad3:7 08:57 4.00s 1.10s 0.01s sshd: erreur32 [priv]
2017-07-19 00:07:36 +02:00
Debian GNU/Linux 8.8 (jessie) (3.16.0-4-amd64).
Kernel Info: Linux 3.16.0-4-amd64 x86_64
----------- --- ------------ ----------
2017-07-31 04:59:39 +02:00
System load : 1.40 IP Address: 55.147.132.243
2017-07-21 10:07:37 +02:00
Memory usage: 10.3% System uptime: 66 days
Usage on / : 74% Swap usage: 0.0%
Local Users : 2 Processes: 282
2017-07-19 00:07:36 +02:00
----------- --- ------------ ----------
2017-07-21 10:07:37 +02:00
vendredi 21 juillet 2017, 10:05:39 (UTC+0200)
2017-07-30 22:40:45 +02:00
```
2017-07-21 10:07:37 +02:00
2017-07-30 22:40:45 +02:00
Explanation of the report
-----
2017-07-18 23:06:11 +02:00
2017-07-30 22:40:45 +02:00
```bash
2017-07-18 23:06:11 +02:00
system hostname report time system load
| | |
| NTP status | | Number of CPU(s)
| | | | |
V V V V V
2017-07-19 13:12:19 +02:00
echosystem.fr+-+ > status at 00:03 > 5min load is 0.75 on 8 cpu(s)</code></pre>
2017-07-20 14:25:21 +02:00
2017-07-30 22:40:45 +02:00
```
2017-07-31 14:15:14 +02:00
--------------------------------------------------
Stats Repo
----------
2020-04-04 11:57:16 +02:00
- https://l.echosystem.fr/MOTDs32stats
2017-07-31 14:15:14 +02:00
2017-07-30 22:40:45 +02:00
2018-02-22 23:41:33 +01:00
by 🅴🆁🆁🅴🆄🆁32
2017-07-30 22:40:45 +02:00
2019-12-08 11:37:53 +01:00
🆓🅴🅲🅷🅾️🆂🆈🆂🆃🅴🅼
2018-03-16 19:29:17 +01:00
2017-08-25 16:43:35 +02:00
## The MIT License (MIT)
[![CC0](https://licensebuttons.net/p/zero/1.0/88x31.png)](http://creativecommons.org/publicdomain/zero/1.0/)
Copyright (c) 2016 @echosystem.fr
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2017-07-30 22:40:45 +02:00
2019-12-08 11:37:53 +01:00