Check if the Disk is Full
To check if the disk is full, use the df
command:
df -h
-h
: Displays sizes in human-readable format (e.g., GB, MB).- Look for the % column to see disk usage.
To find which directories are consuming the most space, use du:
du -h --max-depth=1 / | sort -h
- Replace
/
with the directory you want to analyze.
What is using memory resources?
To check memory usage, use the free command:
free -h
-h
: Displays memory usage in human-readable format.
For a more detailed view, use top or htop. Look at the %MEM
column to see which processes are using the most memory.
top
Check memory paging status
To check if the system is paging or swapping, use:
vmstat 1
- Look at the
si
(swap in) andso
(swap out) columns. Non-zero values indicate swapping.
Alternatively, check swap usage directly:
swapon --show
What is using CPU resources?
To see which processes are consuming the most CPU, use:
top
Look at the %CPU
column.
For a more user-friendly interface, use htop
(if installed):
htop
To view CPU usage over time:
sar -u 1 5
Requires the sysstat package.
What is using GPU resources?
If you have an NVIDIA GPU, use the nvidia-smi command:
nvidia-smi
Displays GPU usage, memory usage, and running processes. For AMD GPUs, use:
radeontop
Requires the radeontop package.
What shared memory segments are being used?
To list shared memory segments, use:
ipcs -m
-m
: Displays shared memory segments.
To remove unused shared memory segments:
ipcrm -m <shmid>
What is using port 8080?
To check which process is using port 8080, use:
sudo lsof -i :8080
-i
:8080: Filters for processes using port 8080.
Alternatively, use netstat:
sudo netstat -tuln | grep 8080
-tuln
: Displays TCP/UDP connections in numeric format.
Or with ss:
sudo ss -tuln | grep 8080
What so files are being used by this process?
To list the shared object (.so) files used by a process, use:
sudo lsof -p <pid> | grep '\.so'
- Replace
<pid>
with the process ID.
Alternatively, use ldd to check the shared libraries of an executable:
ldd /path/to/executable
What Hypervisor Am I Running On
To determine the identity and status of the parent hypervisor on a VM, you can use different methods depending on the operating system and the virtualization technology being used. Here’s a breakdown of how to do it:
Identify the Hypervisor - check for Hypervisor Vendor
cat /sys/class/dmi/id/product_name
This will return something like:
VMware Virtual Platform
→ VMware ESXiVirtual Machine
→ Microsoft Hyper-VKVM
orQEMU
→ KVM/QEMUParallels
→ ParallelsXen
→ Xen
Or using virt-what
(if installed)
sudo virt-what
Output examples:
kvm
→ Running on KVMvmware
→ Running on VMwarehyperv
→ Running on Microsoft Hyper-Vxen
→ Running on Xen
Check the Hypervisor Status. Once you've identified the hypervisor, you may want to check its status.
If you are on a VM running on VMware, you can query vSphere using (Run this on the ESXi host, not the VM):
esxcli system version get
Or from the VM - if vmware-toolbox-cmd
is installed, this checks communication with the ESXi host.
vmware-toolbox-cmd stat hosttime
On KVM/QEMU
Check if KVM is running on the host:
sudo systemctl status libvirtd
Or check virtualization capabilities:
lsmod | grep kvm