| Ten commands to help you diagnose a problem on Linux |
|
|
|
Your server is slow? You want to know what is using the bandwidth? Need to monitor your server performance? Try these commands or tools. You can use them to find the possible causes of a performance problem. The commands introduced below are some of the most basic commands when it comes to system analysis and debugging server issues such as:
Htop - Process activity The htop command is an interactive process monitor aiming to replace top, which can display the list of processes in a tree form, sort and search processes and define a priority for each process. Htop also uses color and gives visual information about processor, swap and memory status.
Visit the website: Htop homepage
Smartcl - Hard disk information
The smartctl command displays information on your hard drives. This requires that you installed the smartmontools package and configured it. Its main purpose is to monitor the installed hard disk to detect and report on various indicators of reliability, in the hope of anticipating failures.
Visit the website: Smartmontools Homepage
IOStats - CPU and Hard Disk Usage
The iostat command report CPU statistics and input/output statistics for devices, partitions and network filesystems (NFS). It generates reports that can be used to change system configuration to better balance the input/output load between physical disks.
IPTraf - Network live monitoring by IP or Protocol
The iptraf command is an interactive colorful IP LAN monitor. It generates various network statistics including TCP info, UDP counts, ICMP... It can provide the following info in easy to read format.
Visit the website: IPTraf homepage
Nethogs - Network monitoring by process
The NetHogs command is a small 'net top' tool. Instead of breaking the traffic down per protocol or per subnet, like Iptraf, it groups bandwidth by process. It is then easy to identify programs that have gone wild and are suddenly taking up your bandwidth.
Visit the website: NetHogs Homepage
Netstat - Network information
The Netstat command displays network connections, routing tables, interface statistics, masquerade connections, and multicast memberships
Dstat - resource statistic tool
The Dstat command gives you detailed selective information in columns and clearly indicates in what magnitude and unit the output is displayed. Less confusion, less mistakes. You can write your own dstat plugins to monitor whatever you like in just a few minutes with a little bit of Python knowledge. By default it combines vmstat, iostat, ifstat, netstat information and more
Visit the website: Dstat Homepage
Df/Du - disk space usage
The df command gives you the disk space usage on the space available on all currently mounted file systems while the du command summarizes the disk usage of each file, recursively for directories.
Lsof - Opened file
The lsof command gives you the list of opened files by processes.
Screen and Tail
The screen command in itself won't give you any information regarding your system but will help you to work efficiently by allowing you to have as many shells as you want running in parallel and navigate between them. On the other hand the tail command used with the "-f" option allows you in real time writings done in a file. Using these two (2) tools while you are making some tests to debug will allow you to switch quickly between shells and see in real time the content of your logs.
|
For any Inquiry