Centos7日常运维管理
1, review the system configuration process, I / O, LAN traffic
use w can view the status of the system, the current time, system boot time, login user, login from which IP, load value system.
Check the system load using uptime value
Use iptop, which I can specifically be used to view / more O, you need to install it
[root @ localhost ~] # yum -y install iotop
[root @ localhost ~] # iotop
use cat / proc / cpuinfo View system configuration
using vmstat can view CPU, memory, virtual disk, swap, I / O and disk information systems processes, add 1 can dynamically display every second
Use top to display dynamic process, using top -bn1 to show all the process information
Sar can use a comprehensive analysis of the state of the system, you need to install it
[root @ localhost ~] # yum -y install sysstat
use [root @ localhost ~] # sar -n DEV 1 3, view usage NIC traffic, every second display , a total of three display
using [root @ localhost ~] # sar -q 1 3, w is equivalent to the operation command, the display every second, a total of three display
using [root @ localhost ~] # sar -b 1 3 You can view the system disk data, the display every second, a total of three times displayed
when installing sysstat package iostat command installed by default, can be viewed using iostat disk usage, plus 1, it will display a dynamically every second
[root @ localhost ~] # iostat
后面加-x可以显示与I/O相关的扩展数据
使用nload可以监控网卡流量,需要安装一下,安装nload命令前要先安装epel源
[root@localhost ~]# yum -y install epel-release
[root@localhost ~]# yum -y install nload
安装完成直接运行nload
[root@localhost ~]# nload
2、查看内存使用情况
使用free,接-m可以以MB为单位查看数据
3、使用ps查看进程,这个日常使用比较多
使用[root@localhost ~]# ps aux查看所有进程
使用[root@localhost ~]# ps aux | grep httpd查看httpd进程
4、查看网络状态,抓包
使用netstat查看网络状态,查看的就是TCP/IP状态
使用netstat –lnp查看哪些服务处于监听状态
使用netstat –an查看所有服务的TCP/IP状态
使用ss也可以查看服务是否处于监听状态,使用ss -tnl | grep查看指定端口是否处于监听状态
使用tcpdump可以用来抓包,需要安装一下
[root@localhost ~]# yum -y install tcpdump
[root@localhost ~]# tcpdump -nn -i ens33 -c 10
[root@localhost ~]# tcpdump -nn -i ens33 port 22 -c 10
You can also specify a port not designated Host
[root @ localhost ~] # tcpdump -i ens33 not -nN Port 22 and Host 192.168.11.10
followed -w, can crawl into data packets are stored to a file
[root @ localhost ~] # tcpdump -nn -i ens33 port 22 -c 10 -w /root/tcpdump.txt
Unfinished, continued ~