Check Server Vitals (CPU, RAM, DISK, I/O Usage)

Exported on 25-Sep-2021 15:10:38

Check Server Vitals Of A Linux Systems

This Blueprint shows current usage percentage of CPU, RAM and Storage for the target Linux system

CPU The computer's central processing unit (CPU) is the portion of a computer that retrieves and executes instructions. The CPU is essentially the brain of a CAD system. It consists of an arithmetic and logic unit (ALU), a control unit, and various registers. The CPU is often simply referred to as the processor. This blueprint prints the current usage percentage of all the CPUs available in the target machine.

RAM Random-access memory is a form of computer memory that can be read and changed in any order, typically used to store working data and machine code. This blueprint prints the current usage percentage of the RAM in the target machine.

Storage Computer data storage is a technology consisting of computer components and recording media that are used to retain digital data. It is a core function and fundamental component of computers. This blueprint prints the current usage percentage of the Storage in the target machine.

Pre-Blueprint Attune setup
  1. On the Inputs tab, create a Linux node for the host you wish to install the stack on.
  2. On the Inputs tab, create Linux credentials to connect to the host you wish to install the stack on.
Tested on following Linux distributions:
  • Arch Linux
  • Ubuntu
  • Debian10
  • CentOS
  • Fedora
  • Red Hat Linux

Basic Unix commands are used to make this script and it is expected to work on all other Linux distributions.


Name Type Script Reference Default Value Comment
Linux Node Linux / Unix Server linuxNode
Linux User Linux OS Credential linuxUser

1 - List CPU, RAM and Storage

These commands show the current usage for the following resources:

  • CPU
  • RAM
  • Storage

The output is simple scrap from the "top" command that comes by default in Linux.

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Use Linux Top command to scrap server vitals
# Witht the help of sed and awk utility commands

echo "CPU `LC_ALL=C top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1}'`% RAM `free -m | awk '/Mem:/ { printf("%3.1f%%", $3/$2*100) }'` HDD `df -h / | awk '/\// {print $(NF-1)}'`"