Linux常用系统监控命令
ps
查看系统进程状态(用户,进程id,cpu/内存占用率)
ps -u
[root@localhost ~]# ps -u USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1865 0.3 1.7 337472 30980 tty1 Ssl+ 16:16 0:06 /usr/bin/X :0 -backgr root 3321 0.0 0.1 116480 3012 pts/0 Ss 16:19 0:00 bash root 4129 0.0 0.1 155360 1896 pts/0 R+ 16:55 0:00 ps -u
uptime
查看系统负载状态(运行时间,用户数,1,5,15分钟平均负载值)
uptime
[root@localhost ~]# uptime 17:00:43 up 44 min, 2 users, load average: 0.00, 0.01, 0.05
ifconfig 查看网卡配置,网络状态等信息
ifconfig
[root@localhost ~]# ifconfig ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.72.136 netmask 255.255.255.0 broadcast 192.168.72.255 inet6 fe80::2f6b:6ef7:bc0e:6b5f prefixlen 64 scopeid 0x20<link> ether 00:0c:29:76:64:d3 txqueuelen 1000 (Ethernet) RX packets 901 bytes 70843 (69.1 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 335 bytes 35046 (34.2 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 19 base 0x2000
free [-h] 查看内存使用量
free -h
019 x86_64 x86_64 x86_64 GNU/Linux [root@localhost ~]# free -h total used free shared buff/cache available Mem: 1.7G 791M 347M 13M 615M 735M Swap: 2.0G 0B 2.0G
uname
查看系统内核版本
uname -a
[root@localhost ~]# uname -a Linux localhost.localdomain 3.10.0-957.27.2.el7.x86_64 #1 SMP Mon Jul 29 17:46:05 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux