Last update at :2024-06-29,Edit by888u
Professional operation and maintenance personnel should be well aware of the current information of their VPS/servers, and cannot wait until problems arise before looking for and solving them like our personal websites do. Normal operation and maintenance personnel should have real-time monitoring of the VPS/servers they use and manage. Generally, we can also use third-party monitoring tools, such as NodeQuery, Monitoring Bao, etc. But our Linux VPS system itself can also use its own command tools for detection and monitoring. For example, you can use the top command to check system resources, memory and processes, and you can use netstat and nmap to detect network status.
Today, what Snail needs to sort out is to use iftop to detect the real-time traffic monitoring of the network. This is also my first time contacting and learning, so I have sorted out the learning content for easy reading in the future.
First, installation of iftop environment
Generally, iftop operating environment is not installed in the system, here we need to install it ourselves.
A. Install dependency packages in CentOS environment
yum install flex byacc libpcap ncurses ncurses-devel libpcap-devel
B. Debian environment installation dependency package
apt-get install flex byacc libpcap0.8 libncurses5
C – Install iftop environment software
wget https://soft.laozuo.org/tools/iftop-0.17.tar.gztar zxvf iftop-0.17.tar.gzcd iftop-0.17./configuremake && make install
According to the above steps, we can quickly install the iftop operating environment.
Second, use iftop and parameters
In a VPS/server that has installed iftop environment, log in to SSH and enter iftop directly to view the information.
The above is the interface. Because I used a new VPS to test, there is no traffic data. It is only used as a demonstration operation.
iftop related parameters:
1. Indicates two-way traffic
2. TX: Send traffic data
3. RX: Receive traffic data
4. TOTAL: total traffic data
5. Cumm: the number of traffic from the start of running iftop to the current time
6. peak: peak traffic data
7. Rates: represent the average traffic data information in the past 2s, 10s and 40s respectively
Third, common problems during the installation of iftop
1. Make: yacc: Command not found error message solution: yum install byacc / apt-get install byacc
2. Configure: error: Curses! Foiled again error message solution: yum install ncurses-devel / apt-get install libncurses5-dev
To summarize, iftop can monitor the data flow of the current VPS in real time. If there is an abnormality, use relative strategies to solve the problem. It is recommended to install the IFTOP environment before installing the VPS website environment. If installing in a VPS that is already running, please back up the data properly to avoid problems.
Recommended site search: cheap virtual host, US attack-proof server, shopex space, asp.net space, ip online query, ip proxy server, registered domain name query, domain name price, all-purpose space trial, cloud server rental,
p>
发表评论