Then the last blog post continues to "top" Monitoring Linux Performance 25 command-line tools
10:mpstat--Shows the occupancy of each CPU
This command can show the occupancy of each CPU, if there is a particularly high CPU utilization, then it is possible that a single-threaded application caused by
mpstat -p all 1linux 3.13.0-75-generic (LNMP) 06/25/2016 _x86_64_ (2 CPU) 02:28:59 pm cpu %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle02:29:00 PM all 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.0002:29:00 PM 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.0002:29:00 pm 1 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 99.00
11:pidstat--View CPU utilization of the process
The command outputs the CPU utilization of the process, which continues to output and does not overwrite previous data, allowing for easy observation of system dynamics
$ pidstat 1linux 3.13.0-75-generic (LNMP) 06/25/2016 _x86_64_ (2 CPU) 02:30:20 pm uid pid %usr %system %guest %cpu cpu command02:30:21 PM 0 9 0.00 0.98 0.00 0.98 1 rcuos/102:30:21 PM UID pid %usr %system %guest %cpu CPU Command02:30:22 PM 0 977 1.00 0.00 0.00 1.00 1 redis-server02:30:22 pm uid pid %usr %system %guest %cpu cpu command02:30:23 pm 1000 19938 0.00 1.00 0.00 1.00 1 sshd02:30:23 pm 1000 20909 0.00 1.00 0.00 1.00 0 sshd
12:free--View the usage of system memory
The free command can see how the system memory is used, and the-m parameter indicates that it is displayed in megabytes. The last two columns represent the number of memory used for the IO cache, and the number of memory used for the file system page cache. It is important to note that the second row-/+ Buffers/cache, which looks like the cache is taking up a lot of memory space. This is the memory usage policy of the Linux system, using the memory as much as possible, and if the application needs memory, this part of the memory is immediately reclaimed and allocated to the application. Therefore, this part of the memory is also generally considered to be available memory.
If there is very little available memory, the system may use the Swap area (if configured), which increases the IO overhead (which can be iostat in the command) and reduces system performance.
$ free -m total used free shared buffers cachedMem: 363 313 50 0 3 104-/+ buffers/cache: 204 159Swap: 767 155 612
13:sar--View throughput rates for network devices
The SAR command here can see the throughput rate of the network device. When troubleshooting performance issues, you can determine whether the network device is saturated through the throughput of the network device.
sar -n dev 1linux 3.13.0-75-generic (LNMP) 06/25/2016 _x86_64_ (2 CPU) 02:33:01 pm iface rxpck/s txpck/s rxkb/s txkb/s rxcmp/s txcmp/s rxmcst/s %ifutil02:33:02 PM eth0 15.84 15.84 0.93 1.69 0.00 0.00 0.00 0.0002:33:02 pm eth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.0002:33:02 pm lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
View TCP connection Status
$ sar-n tcp,etcp 1Linux 3.13.0-75-generic (LNMP) 06/25/2016 _x86_64_ (2 CPU) 02:35:21 PM active/s passive/s iseg/s o Seg/s02:35:22 PM 0.00 0.00 8.00 8.00
ACTIVE/S: Number of locally initiated TCP connections per second, TCP connections created through connect calls
PASSIVE/S: The number of remote TCP connections initiated per second, that is, the TCP connection created through the Accept call
RETRANS/S: Number of TCP retransmissions per second
14:nethogs-monitoring the network bandwidth used by each process
Nethogs is a very small program of Open source code (similar to the top command under Linux), which closely monitors the network activity of each process on the system. It also tracks the real-time network bandwidth used by each program or application
$ sudo apt-get install nethogs$ sudo nethogs
15:iftop-Monitoring network bandwidth
Iftop is another open source system monitoring application running in the console that shows a list of application network bandwidth usage (source host or destination host) on the system over the network interface, which is updated periodically. Iftop is used to monitor network usage, while ' top ' is used to monitor CPU usage. Iftop is a member of the ' top ' tool family that monitors selected interfaces and displays current network bandwidth usage among two hosts
$ sudo apt-get install iftop$ sudo iftop
Tools List
Iptraf
PSACCT or Acct
Monit
Monitorix
Arpwatch
Suricata
Vnstat PHP
Nagios
Zabbix
1:iptraf-real-time LAN IP monitoring
Iptraf is an open source real-time network (LAN) monitoring application running on the Linux console. It collects a lot of information, such as IP traffic monitoring over the network, including TCP tokens, ICMP details, TCP/UDP traffic separation, TCP connection packets, and bytes. It also collects common information and details about the state of the interface: TCP, UDP, IP, ICMP, non-IP,IP checksum error, interface activity, and so on.
For more information about Iptraf tool usage and more, visit: Iptraf Network monitoring Tool
2:PSACCT or Acct-Monitor user Activity
PSACCT or Acct tools are used to monitor the activity status of each user in the system. These two service processes run in the background, and they are closely monitored for all activities of each user running on the system, while also monitoring the resources used by these activities.
The system administrator can use these two tools to track each user's activity, such as what the user is doing, how many resources they are using, how much time they have spent on the system, and so on.
For an example of installation and usage of these commands, see the article: Monitor user activity with PSACCT or acct
3:monit-linux process and service monitoring tools
Monit is a free open source software and a web-based process monitoring tool. It can automatically monitor and manage system processes, programs, files, folders, permissions, sum verification codes and file systems.
This software can monitor services like Apache, MySQL, Mail, FTP, ProFTP, Nginx, SSH, and so on. You can use the command line or the network excuse provided by this software to view the status of the system.
For more information, see: Monitoring Linux processes with Monit
4:monitorix-System and Network monitoring
Monitorix is a free lightweight application tool designed to run and monitor Linux/unix server systems and resources. It has an HTTP Web server that has a regular collection of information about the system and the network and displays it graphically. It monitors the average load and usage of the system, memory allocations, disk health, system services, network ports, message statistics (SENDMAIL,POSTFIX,DOVECOT, etc.), MySQL statistics, and so on. It is used to monitor the overall performance of the system, helping to identify errors, bottlenecks and abnormal activity
5:arpwatch– Ethernet Activity Monitor
The Arpwatch is designed to monitor Ethernet address resolution (changes in Mac and IP addresses) on Linux. He continuously monitors Ethernet activity for a period of time and outputs a log of changes in IP and MAC address pairs. It can also send an email notification to an administrator, alerting you to an increase in address pairing. This is useful for detecting ARP attacks on a network.
For more information, see: Arpwatch to Monitor Ethernet Activity
6:suricata– Network Security Monitoring
Suricata is an open source high-performance network security, intrusion detection and anti-monitoring tool that can run on Linux, FreeBSD, and Windows. Nonprofit organization OISF (Open Information Security Foundation) develops and owns its copyrights.
For more information, see: Suricata–a Network intrusion Detection and prevention System
7:vnstat php– Network traffic monitoring
Vnstat PHP is a web-based front-end rendering of popular web Tools "Vnstat". Vnstat PHP presents the network usage in a beautiful graphical interface. He can display upload and download traffic in hours, days, months, and output summary reports.
For more information, see: Vnstat php–monitoring Network Bandwidth
8:nagios– Network/server monitoring
Nagios is a leading and powerful open source monitoring system that allows network/system administrators to identify and resolve problems before they affect normal business. With the Nagios system, administrators can remotely detect Linux, Windows, switches, routers, and printers within a single window. It can warn of danger and indicate whether there is an exception to the system/server, which can indirectly help you to take rescue measures before the problem occurs.
9:zabbix with Nagios
Original address: "No.2" Monitoring Linux Performance 25 command-line tools
Tags: CPU loads load Linux performance monitoring
"No.2" Monitoring of Linux Performance 25 command-line tools