内容简介:本文风哥教程参考Linux官方文档、Red Hat Enterprise Linux官方文档、Ansible Automation Platform官方文档、Docker官方文档、Kubernetes官方文档和Podman官方文档等内容,详细介绍了相关技术的配置和使用方法。
风哥提示:
本文档介绍Linux系统日常巡检与合规检查的方法和最佳实践。
Part01-系统状态巡检
1.1 系统基础信息检查
[root@fgedu-server ~]# cat /etc/redhat-release
Red Hat Enterprise Linux release 9.2 (Plow)
# 检查内核版本
[root@fgedu-server ~]# uname -a
Linux fgedu-server 5.14.0-284.11.1.el9_2.x86_64 #1 SMP Tue Mar 14 18:05:47 EDT 2026 x86_64 x86_64 x86_64 GNU/Linux
# 检查主机名
[root@fgedu-server ~]# hostnamectl
Static hostname: fgedu-server
Icon name: computer-vm
Chassis: vm
Machine ID: 12345678-1234-1234-1234-1234567890ab
Boot ID: 87654321-4321-4321-4321-ba0987654321
Operating System: Red Hat Enterprise Linux 9.2 (Plow)
CPE OS Name: cpe:/o:redhat:enterprise_linux:9::baseos
Kernel: Linux 5.14.0-284.11.1.el9_2.x86_64
Architecture: x86-64
# 检查系统运行时间
[root@fgedu-server ~]# uptime
10:00:00 up 10 days, 2:30, 2 users, load average: 0.10, 0.15, 0.20
# 检查登录用户
[root@fgedu-server ~]# w
10:00:00 up 10 days, 2:30, 2 users, load average: 0.10, 0.15, 0.20
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/0 192.168.1.100 09:50 0.00s 0.03s 0.00s w
root pts/1 192.168.1.101 09:55 0.00s 0.02s 0.00s bash
1.2 资源使用情况检查
[root@fgedu-server ~]# top -b -n 1 | head -20
top -from PG视频:www.itpux.com 10:00:00 up 10 days, 2:30, 2 users, load average: 0.10, 0.15, 0.20
Tasks: 200 total, 1 running, 199 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.5 us, 0.3 sy, 0.0 ni, 99.2 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 8192000 total, 6144000 free, 1024000 used, 1024000 buff/cache
KiB Swap: 4096000 total, 4096000 free, 0 used.
# 检查内存使用情况
[root@fgedu-server ~]# free -h
total used free shared buff/cache available
Mem: 8.0G 1.0G 6.0G 100M 1.0G 6.8G
Swap: 4.0G 0B 4.0G
# 检查磁盘使用情况
[root@fgedu-server ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 50G 10G 38G 21% /
/dev/sda2 200G 80G 110G 43% /data
/dev/sdb1 500G 200G 280G 42% /backup
# 检查磁盘I/O情况
[root@fgedu-server ~]# iostat -x 1 3
Linux 5.14.0-284.11.1.el9_2.x86_64 (fgedu-server) 01/15/2026 _x86_64_ (8 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
0.50 0.00 0.30 0.00 0.00 99.20
Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd avgrq-sz avgqu-sz await r_await w_await aqu-sz %ut更多学习教程公众号风哥教程itpux_comil
sda 0.50 0.00 4.00 0.00 0 12 0 16.00 0.00 0.00 0.00 0.00 0.00
# 检查网络使用情况
[root@fgedu-server ~]# netstat -tuln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 ::1:25 :::* LISTEN
本文由风哥教程整理发布,仅用于学习测试使用,转载注明出处:http://www.fgedu.net.cn/10327.html
