How to get System Information about CPU, Memory, Network, and Disk I/O on the Linux operating system. Linux the essential for DevOps Roles.
To obtain system and hardware information on a Linux system, you can use various commands and utilities. Here are a few commonly used ones.
Table of Contents
Linux System information
CPU
You can use the mpstat command to get processor-related statistics.
[huupv@huupv devopsroles]$ mpstat 2 10
The screen output terminal:
Using the lscpu command to get CPU information
[huupv@huupv devopsroles]$ lscpu
The screen output terminal:
Find CPU model/speed information
[huupv@huupv devopsroles]$ cat /proc/cpuinfo
Count processor
[huupv@huupv devopsroles]$ grep -c processor /proc/cpuinfo
DISK
To get information about your disk in real-time with the iostat command
[huupv@huupv devopsroles]$ iostat -kx 2
NETWORK
To see your network services with the netstat command
The command as below
[huupv@huupv devopsroles]$ netstat -ntlp # Open TCP sockets [huupv@huupv devopsroles]$ netstat -nulp # Open UDP sockets [huupv@huupv devopsroles]$ netstat -nxlp # Open Unix sockets
LIST HARDWARE
You can report the exact memory configuration, Mainboard configuration, Firmware version, CPU version, and speed cache.
Using lshw command
[huupv@huupv devopsroles]$ sudo lshw
To show PCI info
[huupv@huupv devopsroles]$ lspci -tv
Getting USB info
[huupv@huupv devopsroles]$ lsusb -tv
Display BIOS Infomation
[huupv@huupv devopsroles]$ sudo dmidecode -q | less
How to read speed test on disk sda
[huupv@huupv devopsroles]$ sudo hdparm -tT /dev/sda
The screen output terminal:
[sudo] password for huupv: /dev/sda: Timing cached reads: 5668 MB in 2.00 seconds = 2837.23 MB/sec Timing buffered disk reads: 110 MB in 3.08 seconds = 35.73 MB/sec
Using badblocks command test for an unreadable block on disk sda
[huupv@huupv devopsroles]$ badblocks -s /dev/sda
Process monitoring
List processes in a hierarchy
[huupv@huupv devopsroles]$ ps -e -o pid,args --forest
How to list processes “% CPU” usage
[huupv@huupv devopsroles]$ ps -e -o pcpu,cpu,nice,state,cputime,args --sort pcpu | sed '/^ 0.0 /d'
List processes mem (KB) usage
[huupv@huupv devopsroles]$ ps -e -orss=,args= | sort -b -k1,1n
Interactive monitoring
You can use the tool for dynamic monitoring
[huupv@huupv devopsroles]$ top [huupv@huupv devopsroles]$ htop [huupv@huupv devopsroles]$ atop [huupv@huupv devopsroles]$ sudo iotop
Conclusion
Through the article, you can use Linux system information and hardware Information as above. These are just a few examples of commands you can use to obtain system and hardware information on Linux. Depending on your distribution and installed packages, there may be additional tools available. I hope will this your helpful. Thank you for reading the DevopsRoles page!