Being a System or Community administrator tasked with monitoring and debugging Linux system efficiency issues every day is an immensely difficult accountability.
It calls for unwavering dedication, a profound understanding of Linux programs, and a relentless dedication to making sure optimum efficiency and reliability.
After dedicating a decade to working as a Linux Administrator within the IT trade, I’ve come to actually recognize the arduous process of monitoring and guaranteeing the continual operation of programs.
In gentle of this, now we have curated a complete checklist of the High 20 incessantly used command-line monitoring instruments. These invaluable instruments can show indispensable for each Linux/Unix System Administrator, empowering them to effectively monitor, diagnose, and keep the well being and efficiency of their programs.
These monitoring instruments can be found below all flavors of Linux and will be helpful to watch and discover the precise causes of efficiency issues. This checklist of instructions proven right here could be very sufficient so that you can decide the one that’s appropriate to your monitoring situation.
1. High – Linux Course of Monitoring
Linux high command is a efficiency monitoring program that’s used incessantly by many system directors to watch Linux efficiency and it’s obtainable below many Linux/Unix-like working programs.
The highest command is used to show all of the working and lively real-time processes in an ordered checklist and updates it frequently. It shows CPU utilization, Reminiscence utilization, Swap Reminiscence, Cache Measurement, Buffer Measurement, Course of PID, Person, Instructions, and way more.
It additionally reveals excessive reminiscence and cpu utilization of working processes. The highest command is way helpful for system directors to watch and take corrective motion when required. Let’s see the highest command in motion.
# high
2. VmStat – Digital Reminiscence Statistics
Linux VmStat command is used to show statistics of digital reminiscence, kernel threads, disks, system processes, I/O blocks, interrupts, CPU exercise, and way more.
Set up VmStat on Linux
By default vmstat command just isn’t obtainable below Linux programs you have to set up a package deal known as sysstat (a robust monitoring software) that features a vmstat program.
$ sudo yum set up sysstat [On Older CentOS/RHEL & Fedora]
$ sudo dnf set up sysstat [On CentOS/RHEL/Fedora/Rocky Linux & AlmaLinux]
$ sudo apt-get set up sysstat [On Debian/Ubuntu & Mint]
$ sudo pacman -S sysstat [On Arch Linux]
The frequent utilization of the vmstat command format is.
# vmstat
procs ———–memory———- —swap– —–io—- -system– ——cpu—–
r b swpd free buff cache si so bi bo in cs us sy id wa st
1 0 43008 275212 1152 561208 4 16 100 105 65 113 0 1 96 3 0
3. Lsof – Checklist Open Information
The lsof command is utilized in many Linux/Unix-like programs to show an inventory of all of the open recordsdata and processes. The open recordsdata included are disk recordsdata, community sockets, pipes, gadgets, and processes.
One of many primary causes for utilizing this command is when a disk can’t be unmounted and shows the error that recordsdata are getting used or opened. With this command, you possibly can simply determine which recordsdata are in use.
The most typical format for lsof command is.
# lsof
COMMAND PID TID TASKCMD USER FD TYPE DEVICE SIZE/OFF NODE NAME
systemd 1 root cwd DIR 8,2 224 128 /
systemd 1 root rtd DIR 8,2 224 128 /
systemd 1 root txt REG 8,2 1567768 134930842 /usr/lib/systemd/systemd
systemd 1 root mem REG 8,2 2714928 134261052 /usr/lib64/libm-2.28.so
systemd 1 root mem REG 8,2 628592 134910905 /usr/lib64/libudev.so.1.6.11
systemd 1 root mem REG 8,2 969832 134261204 /usr/lib64/libsepol.so.1
systemd 1 root mem REG 8,2 1805368 134275205 /usr/lib64/libunistring.so.2.1.0
systemd 1 root mem REG 8,2 355456 134275293 /usr/lib64/libpcap.so.1.9.0
systemd 1 root mem REG 8,2 145984 134261219 /usr/lib64/libgpg-error.so.0.24.2
systemd 1 root mem REG 8,2 71528 134270542 /usr/lib64/libjson-c.so.4.0.0
systemd 1 root mem REG 8,2 371736 134910992 /usr/lib64/libdevmapper.so.1.02
systemd 1 root mem REG 8,2 26704 134275177 /usr/lib64/libattr.so.1.1.2448
systemd 1 root mem REG 8,2 3058736 134919279 /usr/lib64/libcrypto.so.1.1.1c
…
4. Tcpdump – Community Packet Analyzer
The tcpdump command is without doubt one of the most generally used command-line community packet analyzer or packet sniffer applications that’s used to seize or filter TCP/IP packets which can be obtained or transferred on a selected interface over a community.
It additionally gives an possibility to save lots of captured packages in a file for later evaluation. tcpdump is sort of obtainable in all main Linux distributions.
# tcpdump -i enp0s3
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp0s3, link-type EN10MB (Ethernet), seize dimension 262144 bytes
10:19:34.635893 IP tecmint.ssh > 192.168.0.124.45611: Flags [P.], seq 2840044824:2840045032, ack 4007244093
10:19:34.636289 IP 192.168.0.124.45611 > tecmint.ssh: Flags [.], ack 208, win 11768, choices
10:19:34.873060 IP _gateway.57682 > tecmint.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; UNICAST
10:19:34.873104 IP tecmint > _gateway: ICMP tecmint udp port netbios-ns unreachable, size 86
10:19:34.895453 IP _gateway.48953 > tecmint.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; UNICAST
10:19:34.895501 IP tecmint > _gateway: ICMP tecmint udp port netbios-ns unreachable, size 86
10:19:34.992693 IP 142.250.4.189.https > 192.168.0.124.38874: UDP, size 45
10:19:35.010127 IP 192.168.0.124.38874 > 142.250.4.189.https: UDP, size 33
10:19:35.135578 IP _gateway.39383 > 192.168.0.124.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; UNICAST
10:19:35.135586 IP 192.168.0.124 > _gateway: ICMP 192.168.0.124 udp port netbios-ns unreachable, size 86
10:19:35.155827 IP _gateway.57429 > 192.168.0.124.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; UNICAST
10:19:35.155835 IP 192.168.0.124 > _gateway: ICMP 192.168.0.124 udp port netbios-ns unreachable, size 86
…
5. Netstat – Community Statistics
The netstat is a command-line software for monitoring incoming and outgoing community packet statistics in addition to interface statistics. It’s a very great tool for each system administrator to watch community efficiency and troubleshoot network-related issues.
# netstat -a | extra
Energetic Web connections (servers and established)
Proto Recv-Q Ship-Q Native Tackle International Tackle State
tcp 0 0 0.0.0.0:sunrpc 0.0.0.0:* LISTEN
tcp 0 0 tecmint:area 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN
tcp 0 0 localhost:postgres 0.0.0.0:* LISTEN
tcp 0 0 tecmint:ssh 192.168.0.124:45611 ESTABLISHED
tcp6 0 0 [::]:sunrpc [::]:* LISTEN
tcp6 0 0 [::]:ssh [::]:* LISTEN
tcp6 0 0 localhost:postgres [::]:* LISTEN
udp 0 0 0.0.0.0:mdns 0.0.0.0:*
udp 0 0 localhost:323 0.0.0.0:*
udp 0 0 tecmint:area 0.0.0.0:*
udp 0 0 0.0.0.0:bootps 0.0.0.0:*
udp 0 0 tecmint:bootpc _gateway:bootps ESTABLISHED
…
Whereas in present-day netstat has been deprecated in favor of the ss command, you should still uncover netstat in your networking toolkit.
6. Htop – Linux Course of Monitoring
htop is a a lot superior interactive and real-time Linux course of monitoring software, which is way just like Linux high command however it has some wealthy options like a user-friendly interface to handle processes, shortcut keys, vertical and horizontal views of the processes, and way more.
# htop
htop is a third-party software, which doesn’t include Linux programs, you have to set up it utilizing your system package deal supervisor software.
For extra info on htop set up learn our article – Set up Htop (Linux Course of Monitoring) in Linux.
7. Iotop – Monitor Linux Disk I/O
iotop can be a lot just like the highest command and htop program, however it has an accounting perform to watch and show real-time Disk I/O and processes.
iotop software is way helpful for locating the precise course of and extremely used disk learn/writes of the processes.
Set up Iotop on Linux
By default, the iotop command just isn’t obtainable below Linux and you have to set up it as proven.
$ sudo yum set up iotop [On Older CentOS/RHEL & Fedora]
$ sudo dnf set up iotop [On CentOS/RHEL/Fedora/Rocky Linux & AlmaLinux]
$ sudo apt-get set up iotop [On Debian/Ubuntu & Mint]
$ sudo pacman -S iotop [On Arch Linux]
The frequent utilization of the iotop command format is.
# iotop
8. Iostat – Enter/Output Statistics
iostat is a straightforward software that can gather and present system enter and output storage gadget statistics. This software is commonly used to hint storage gadget efficiency points together with gadgets, native disks, and distant disks reminiscent of NFS.
Set up Iostat on Linux
To get the iostat command, you have to set up a package deal known as sysstat as proven.
$ sudo yum set up sysstat [On Older CentOS/RHEL & Fedora]
$ sudo dnf set up sysstat [On CentOS/RHEL/Fedora/Rocky Linux & AlmaLinux]
$ sudo apt-get set up sysstat [On Debian/Ubuntu & Mint]
$ sudo pacman -S sysstat [On Arch Linux]
The frequent utilization of the iostat command format is.
# iostat
Linux 4.18.0-193.el8.x86_64 (tecmint) 04/05/2021 _x86_64_ (1 CPU)
avg-cpu: %consumer %good %system %iowait %steal %idle
0.21 0.03 0.59 2.50 0.00 96.67
System tps kB_read/s kB_wrtn/s kB_read kB_wrtn
sda 3.95 83.35 89.63 1782431 1916653
9. IPTraf – Actual-Time IP LAN Monitoring
IPTraf is an open-source console-based real-time community (IP LAN) monitoring utility for Linux. It collects a wide range of info reminiscent of IP site visitors monitor that passes over the community, together with TCP flag info, ICMP particulars, TCP/UDP site visitors breakdowns, TCP connection packets, and byte counts.
It additionally gathers info on common and detailed interface statistics of TCP, UDP, IP, ICMP, non-IP, IP checksum errors, interface exercise, and so forth.
10. Psacct or Acct – Monitor Person Exercise
psacct or acct instruments are very helpful for monitoring every consumer’s exercise on the system. Each daemons run within the background and hold an in depth watch on the general exercise of every consumer on the system and in addition what sources are being consumed by them.
These instruments are very helpful for system directors to trace every consumer’s exercise like what they’re doing, what instructions they issued, what number of sources are utilized by them, how lengthy they’re lively on the system and so forth.
11. Monit – Linux Course of and Providers Monitoring
Monit is a free open-source and web-based course of supervision utility that mechanically displays and manages system processes, applications, recordsdata, directories, permissions, checksums, and filesystems.
It displays providers like Apache, MySQL, Mail, FTP, ProFTP, Nginx, SSH, and so forth. The system standing will be considered from the command line or utilizing its personal net interface.
For set up and configuration, learn our article – Easy methods to Set up and Setup Monit (Linux Course of and Providers Monitoring) Program.
12. NetHogs – Monitor Per Course of Community Bandwidth
NetHogs is an open-source good small program (just like Linux high command) that retains a tab on every course of community exercise in your system. It additionally retains observe of real-time community site visitors bandwidth utilized by every program or software.
# nethogs
For set up and utilization, learn our article: Monitor Linux Community Bandwidth Utilizing NetHogs
13. iftop – Community Bandwidth Monitoring
iftop is one other terminal-based free open supply system monitoring utility that shows a incessantly up to date checklist of community bandwidth utilization (supply and vacation spot hosts) that passes by the community interface in your system.
iftop is analogous to ‘high‘ within the context of community utilization, very like how ‘high‘ gives insights into CPU utilization.
iftop belongs to the esteemed ‘high’ household of community monitoring instruments. Particularly designed to watch a user-selected community interface, it renders real-time information on the present bandwidth utilization between two specified hosts.
# iftop
For set up and utilization, learn our article: iftop – Monitor Community Bandwidth Utilization
14. Monitorix – System and Community Monitoring
Monitorix is a free light-weight utility that’s designed to run and monitor system and community sources as many as potential in Linux/Unix servers.
It has a built-in HTTP net server that frequently collects system and community info and shows them in graphs. It Screens system load common and utilization, reminiscence allocation, disk driver well being, system providers, community ports, mail statistics (Sendmail, Postfix, Dovecot, and so forth), MySQL statistics, and lots of extra.
It’s designed to watch general system efficiency and helps in detecting failures, bottlenecks, irregular actions, and so forth.
For set up and utilization, learn our article: Monitorix a System and Community Monitoring Instrument for Linux
15. Arpwatch – Ethernet Exercise Monitor
Arpwatch is a form of program that’s designed to watch the Tackle Decision of (MAC and IP tackle adjustments) of Ethernet community site visitors on a Linux community.
It repeatedly retains watch on Ethernet site visitors and produces a log of IP and MAC tackle pair adjustments together with a timestamp on a community. It additionally has a characteristic to ship e-mail alerts to directors, when a pairing is added or adjustments. It is extremely helpful in detecting ARP spoofing on a community.
For set up and utilization, learn our article: Arpwatch to Monitor Ethernet Exercise
16. Suricata – Community Safety Monitoring
Suricata is a high-performance open-source Community Safety and Intrusion Detection and Prevention Monitoring System for Linux, FreeBSD, and Home windows.
It was designed and owned by a non-profit basis OISF (Open Info Safety Basis).
For set up and utilization, learn our article: Suricata – A Community Intrusion Detection and Prevention System
17. VnStat PHP – Monitoring Community Bandwidth
VnStat PHP is a web-based frontend software for the preferred networking software known as “vnstat“. VnStat PHP displays community site visitors utilization in properly graphical mode.
It shows the overall IN and OUT community site visitors utilization in hourly, each day, month-to-month, and full abstract reviews.
For set up and utilization, learn our article: Monitoring Community Bandwidth Utilization
18. Nagios – Community/Server Monitoring
Nagios is a number one open-source highly effective monitoring system that allows community/system directors to determine and resolve server-related issues earlier than they have an effect on main enterprise processes.
With the Nagios system, directors can in a position to monitor distant Linux, Home windows, Switches, Routers, and Printers on a single window. It reveals vital warnings and signifies if one thing went fallacious in your community/server which not directly lets you start remediation processes earlier than they happen.
For set up, configuration, and utilization, learn our article – Set up Nagios Monitoring System to Monitor Distant Linux/Home windows Hosts
19. Nmon: Monitor Linux Efficiency
Nmon (stands for Nigel’s Efficiency Monitor) software, which is used to watch all Linux sources reminiscent of CPU, Reminiscence, Disk Utilization, Community, High processes, NFS, Kernel, and way more. This software is available in two modes: On-line Mode and Seize Mode.
The On-line Mode is used for real-time monitoring and Seize Mode is used to retailer the output in CSV format for later processing.
For set up and utilization, learn our article: Set up Nmon (Efficiency Monitoring) Instrument in Linux
20. Collectl: All-in-One Efficiency Monitoring Instrument
Collectl is yet one more highly effective and feature-rich command-line-based utility, that can be utilized to collect details about Linux system sources reminiscent of CPU utilization, reminiscence, community, inodes, processes, nfs, TCP, sockets, and way more.
For set up and utilization, learn our article: Set up Collectl (All-in-One Efficiency Monitoring) Instrument in Linux
We wish to know what sort of monitoring applications you employ to watch the efficiency of your Linux servers. If we’ve missed any vital software that you desire to us to incorporate on this checklist, please inform us through feedback, and please don’t overlook to share it.