Skip to content

About

An Enterprise Linux alternative to Ubuntu's landscape-sysinfo.

Topics

Resources

Stars

10 stars

Watchers

2 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

landscape-sysinfo for Enterprise Linux

An Enterprise Linux alternative to Ubuntu's landscape-sysinfo.

Compatibility

Distribution Earliest supported version
AlmaLinux 8.3
CentOS 7.5
CentOS Stream 8
Oracle Linux 7.5
RHEL 7.5
Rocky Linux 8.4

Description

landscape-sysinfo-el prints an overview of various system metrics. It is designed as a Message of the Day (MOTD) script, but it can be run on its own. When the system load is too high, the metrics are skipped.

It is powered by bash (with standard system tools) and awk.

Example output

System information as of Wed Jul  8 14:10:12 UTC 2020

Uptime: 12d 23h 56m

Usage of /:   16% of 8,0G (1,3G)  Processes:   383
Memory usage: 61.70% of 12G       System load: 0.62
Swap usage:   0.00% of 1,0G       SSH connections: 1 (10.220.10.100:51234)

IP address for eth0:             10.220.10.101
IP address for docker_gwbridge:  172.18.0.1
IP address for docker0:          172.17.0.1

Deployment

As root, run:

# Enter the /usr/local/bin/ dir
cd /usr/local/bin/

# Download landscape-sysinfo-el
curl --remote-name "https://raw.githubusercontent.com/alct/landscape-sysinfo-el/master/landscape-sysinfo-el"

# Download landscape-sysinfo-el hash file
curl --remote-name "https://raw.githubusercontent.com/alct/landscape-sysinfo-el/master/landscape-sysinfo-el.sha256"

# Verify the script integrity
sha256sum --check "landscape-sysinfo-el.sha256"

# (if and only if the previous command doesn't throw an error)
# Remove the hash file
rm -f "landscape-sysinfo-el.sha256"

# Make landscape-sysinfo-el executable
chmod +x "landscape-sysinfo-el"

MOTD

As root, run:

# 1. Deploy the script using the above instructions.
# 2. Add the script to the tail of /etc/profile.d/custom.sh
echo "/usr/local/bin/landscape-sysinfo-el" >> "/etc/profile.d/custom.sh"

Debugging

By default, landscape-sysinfo-el hides all error output (stderr) to avoid polluting the MOTD. A metric that cannot be gathered is simply displayed as - or omitted.

If a metric is unexpectedly missing or empty, set SYSINFO_DEBUG to 1 to make errors visible again, either by editing its value in place at the top of the script or, preferably, by setting it in /etc/profile.d/custom.sh right before calling the script.

export SYSINFO_DEBUG=1
/usr/local/bin/landscape-sysinfo-el

F.A.Q.

Is it compatible with older versions of RHEL (and derivatives)?

No. Older versions of system tools required (e.g. ss and free) lack modern features that the script relies upon.

Why are some IP addresses red in the SSH connections section?

Connections that do not match your current ip-address:port are highlighted in red. On a console login, or in a login shell started via su - or sudo -i, no session can be identified as yours, so the list is shown without colors.

Does the SSH session count work when sshd listens on a custom port?

Yes. The port is auto-detected from your current SSH connection when possible; otherwise the script assumes the standard ssh port.

If you use a custom port and want the session count to work for non-SSH logins (i.e. console logins, su -, sudo -i), set SYSINFO_SSHD_PORT to that port, either by editing its value in place at the top of the script or, preferably, by setting it in /etc/profile.d/custom.sh right before calling the script.

# Replace 2222 with your custom port
export SYSINFO_SSHD_PORT=2222
/usr/local/bin/landscape-sysinfo-el

License

MIT

About

An Enterprise Linux alternative to Ubuntu's landscape-sysinfo.

Topics

Resources

Stars

10 stars

Watchers

2 watching

Forks

Contributors

Languages