| 20 Linux System Monitoring Tools Every SysAdmin Should Know |
|
|
|
| Articles - Networking | |||||||||||||||||||
| Written by Nishant Kashyap | |||||||||||||||||||
|
Need to monitor Linux server performance? Try these built-in command and a few add-on tools. Most Linux distributions are equipped with tons of monitoring. These tools provide metrics which can be used to get information about system activities. You can use these tools to find the possible causes of a performance problem. The commands discussed below are some of the most basic commands when it comes to system analysis and debugging server issues such as:
#1: top - Process Activity CommandThe top program provides a dynamic real-time view of a running system i.e. actual process activity. By default, it displays the most CPU-intensive tasks running on the server and updates the list every five seconds. Commonly Used Hot KeysThe top command provides several useful hot keys:
#2: vmstat - System Activity, Hardware and System Information The command vmstat reports information about processes, memory, paging, block IO, traps, and cpu activity. procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------ Display Memory Utilization Slabinfo
Get Information About Active / Inactive Memory Pages
#3: w - Find Out Who Is Logged on And What They Are Doingw command displays information about the users currently on the machine, and their processes. 17:58:47 up 5 days, 20:28, 2 users, load average: 0.36, 0.26, 0.24 #4: uptime - Tell How Long The System Has Been RunningThe uptime command can be used to see how long the server has been running. The current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes. 18:02:41 up 41 days, 23:42, 1 user, load average: 0.00, 0.00, 0.00 1 can be considered as optimal load value. The load can change from system to system. For a single CPU system 1 - 3 and SMP systems 6-10 load value might be acceptable. #5: ps - Displays The Processesps command will report a snapshot of the current processes. To select all processes use the -A or -e option: PID TTY TIME CMD ps is just like top but provides more information. Show Long Format Output
To See Threads ( LWP and NLWP)
To See Threads After Processes
Print All Process On The Server
Print A Process Tree
Print Security Information
See Every Process Running As User Vivek
Set Output In a User-Defined Format
Display Only The Process IDs of Lighttpd
Display The Name of PID 55977
Find Out The Top 10 Memory Consuming Process
Find Out top 10 CPU Consuming Process
#6: free - Memory UsageThe command free displays the total amount of free and used physical and swap memory in the system, as well as the buffers used by the kernel. total used free shared buffers cached #7: iostat - Average CPU Load, Disk ActivityThe command iostat report Central Processing Unit (CPU) statistics and input/output statistics for devices, partitions and network filesystems (NFS). Linux 2.6.18-128.1.14.el5 (www03.nixcraft.in) 06/26/2009 #8: sar - Collect and Report System ActivityThe sar command is used to collect, report, and save system activity information. To see network counter, enter: Linux 2.6.18-128.1.14.el5 (www03.nixcraft.in) 06/26/2009 #9: mpstat - Multiprocessor UsageThe mpstat command displays activities for each available processor, processor 0 being the first one. mpstat -P ALL to display average CPU utilization per processor: Linux 2.6.18-128.1.14.el5 (www03.nixcraft.in) 06/26/2009 #10: pmap - Process Memory UsageThe command pmap report memory map of a process. Use this command to find out causes of memory bottlenecks. 47394: /usr/bin/php-cgi The last line is very important:
#11 and #12: netstat and ss - Network StatisticsThe command netstat displays network connections, routing tables, interface statistics, masquerade connections, and multicast memberships. ss command is used to dump socket statistics. It allows showing information similar to netstat. #13: iptraf - Real-time Network StatisticsThe iptraf command is interactive colorful IP LAN monitor. It is an ncurses-based IP LAN monitor that generates various network statistics including TCP info, UDP counts, ICMP and OSPF information, Ethernet load info, node stats, IP checksum errors, and others. It can provide the following info in easy to read format:
#14: tcpdump - Detailed Network Traffic AnalysisThe tcpdump is simple command that dump traffic on a network. However, you need good understanding of TCP/IP protocol to utilize this tool. For.e.g to display traffic info about DNS, enter: #15: strace - System CallsTrace system calls and signals. This is useful for debugging webserver and other server problems. #16: /Proc file system - Various Kernel Statistics/proc file system provides detailed information about various hardware devices and other Linux kernel information. Common /proc examples: 17#: Nagios - Server And Network MonitoringNagios is a popular open source computer system and network monitoring application software. You can easily monitor all your hosts, network equipment and services. It can send alert when things go wrong and again when they get better. 18#: Cacti - Web-based Monitoring ToolCacti is a complete network graphing solution designed to harness the power of RRDTool's data storage and graphing functionality. Cacti provides a fast poller, advanced graph templating, multiple data acquisition methods, and user management features out of the box. All of this is wrapped in an intuitive, easy to use interface that makes sense for LAN-sized installations up to complex networks with hundreds of devices. It can provide data about network, CPU, memory, logged in users, Apache, DNS servers and much more. #19: KDE System Guard - Real-time Systems Reporting and GraphingKSysguard is a network enabled task and system monitor application for KDE desktop. This tool can be run over ssh session. It provides lots of features such as a client/server architecture that enables monitoring of local and remote hosts. The graphical front end uses so-called sensors to retrieve the information it displays. A sensor can return simple values or more complex information like tables. For each type of information, one or more displays are provided. Displays are organized in worksheets that can be saved and loaded independently from each other. So, KSysguard is not only a simple task manager but also a very powerful tool to control large server farms.
#20: Gnome System Monitor - Real-time Systems Reporting and GraphingThe System Monitor application enables you to display basic system information and monitor system processes, usage of system resources, and file systems. You can also use System Monitor to modify the behavior of your system. Although not as powerful as the KDE System Guard, it provides the basic information which may be useful for new users:
Did I miss something? Please add your favorite system motoring tool in the comments.
Set as favorite
Bookmark
Email This
Hits: 172 Comments (1)
![]()
Chetan Ghorpade
said:
|
| < Prev |
|---|