- w,uptime命令:
[root@ligenkelong ~]# w
12:08:43 up 11:33, 2 users, load average: 0.00, 0.01, 0.05
[root@ligenkelong ~]# uptime
12:09:05 up 11:34, 2 users, load average: 0.00, 0.01, 0.05
2.top命令:
按M:按内存排序
按P:按cpu排序
按1:显示所有cpu负载
top -bn1:静态显示
显示cpu核数:cat /proc/cpuinfo
或者:lscpu
3.free 命令:
查看内存的使用情况:
total used free shared buff/cache available
Mem: 972M 588M 200M 7.7M 183M 203M
Swap: 2.0G 0B 2.0G
添加swap交换空间:
dd if=/dev/zero of=/file bs=1M count=1000
mkswap /file
swapon /file
4.iostat:
yum install -y sysstat
iostat -dx 1 10
iotop:
把所有的进程使用磁盘读写百分比显示出来:
yum install -y iotop
5.vmstat综合命令:
vmstat 1 10
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 0 202156 2076 188960 0 0 2 0 28 48 0 0 100 0 0
网卡流量:
sar -n DEV 1 10``
sar -n DEV -f /var/log/sa/sa13
sar -b
nload:
yum install -y epel-release
yum install -y nload
查看网卡:
ethtool ens33
或者
mii-tool ens33
查看进程:
ps aux
ps -elf
ps -eLf(查看进程)
< 高优先级进程
抓包:
tcpdump -nn -i ens33 port 80 -c 100 -w 1.cap
tcpdump -nn -r 1.cap
tcpdump -nn -i ens33 not port 22 and not port 80 and host 192.168.247.1
安装wireshark:
yum install -y wireshark
监控: