Skip to content
Menu

What Is This Linux Box? Health Summary

One table of facts about a Linux server: OS, load, memory, disk, failed services, waiting updates, firewall and SSH settings. It changes nothing and never alerts.

What is this Linux box? Health summary is free for members.

Enter your email to create your free account and get the file.

We'll email you the script and the weekly MSP Outpost email. Unsubscribe anytime. Privacy policy.

Already a member? Sign in.

Be the first to review What is this Linux box? Health summary. Tell other MSPs how it worked for you.

Write a Review

LanguageBash
Runs onUbuntu 22.04+, Debian 12+, RHEL/Rocky/Alma 9+; runs as root or a user
Needsbash 3.2, awk, /proc; root for the SSH and firewall rows
Read-onlyReads, changes nothing

What It Does

The script collects one table of facts about the machine and ends OK unless it cannot run at all. It covers the system (distribution, kernel, architecture, virtualization, CPU, uptime, boot time and signed-in sessions), load averages and CPU count, RAM and swap, and free space on mounted ext2, ext3, ext4, xfs, btrfs and zfs volumes it can identify, with each device counted once.

It lists failed systemd units by name, and the updates waiting in the package manager's current list, how many of them are security updates, how old that list is, and whether a reboot is needed. It names the firewall in use (ufw, firewalld, nftables or iptables), the effective sshd settings that matter (port, root login, password login, key login), the time zone and whether the clock is synchronized, and the five busiest processes by CPU and by memory.

It never refreshes package lists, so the update counts are as fresh as the last apt update or dnf makecache, and the Package list age row says how old that is. Run it as root to get the SSH and firewall rows. Without root, the firewall row says needs root, and so does the SSH settings row when sshd is installed. The answer is one line, and the table is there when you want the detail.

Before You Run It

  • Run as root to read the firewall state and effective SSH settings when sshd is installed.
  • Remember the update counts are only as fresh as the last package list refresh. Read the Package list age row before you trust them.
  • It was run on Ubuntu 24.04. The dnf, firewalld and RHEL paths (Debian 12, Rocky, Alma and RHEL 9) are written for but not yet run, so check a few rows by hand there first.
  • Set RESULT_FIELD to put the one-line answer on an RMM custom field of the device.

Type and Risk

  • Type: Report. It collects facts into a table and never alerts. It exits 0, or 2 when it could not run.
  • Risk: Low. It reads and changes nothing.
  • Restart: It never restarts the machine.
  • Typical run: Under 20 seconds.
  • Example answer: "Ubuntu 24.04.1 LTS, up 12d 3h; load 0.2; memory 41% used; / 70% free; 5 updates (2 security); no reboot needed; 0 failed units"
  • Tested before listing on Ubuntu 24.04 (Arm64 VM) with bash, run as root, against its own test cases.

Inputs

Pass an input as an argument (--input-name value), as an environment variable named as listed, which is how most RMMs pass script variables, or change its default in the DEFAULT_ lines near the top of the script. An argument wins over an environment variable, which wins over the default.

This script has no inputs of its own.

Every script also takes DRY_RUN, OUTPUT_FORMAT (Text, Answer, Json or Csv), EXPORT_PATH and RESULT_FIELD, which writes the answer to an RMM custom field, unless the list above words one differently.

License

Provided "as is" under the MIT License, without warranty of any kind. Test before production use. MSP Outpost and User First Digital Inc. accept no liability for any damage or loss.

The Script

get-linux-health.sh · 736 lines · 32.8 KB

Free for Members

Create a free account or sign in to read, copy and download this script.

Welcome Back

Sign in to your MSP Outpost account.