麒麟自带了一款系统运维辅助工具——kylin-sysassist,只需几条命令,就能完成从信息采集到健康体检的全流程
查看系统版本和内核版本
[root@kylin-2 ~]# cat /etc/os-release
NAME="Kylin Linux Advanced Server"
VERSION="V10 (Halberd)"
ID="kylin"
VERSION_ID="V10"
PRETTY_NAME="Kylin Linux Advanced Server V10 (Halberd)"
ANSI_COLOR="0;31"
[root@kylin-2 ~]# uname -a
Linux kylin-2 4.19.90-89.11.v2401.ky10.x86_64 #1 SMP Tue May 7 18:33:01 CST 2024 x86_64 x86_64 x86_64 GNU/Linux
安装检查诊断工具
[root@kylin-2 ~]# yum install kylin-sysassist -y
Last metadata expiration check: 3:08:17 ago on 2025年09月04日 星期四 07时32分43秒.
Dependencies resolved.
===========================================================================================================
Package Architecture Version Repository Size
===========================================================================================================
Installing:
kylin-sysassist x86_64 1.3-1.ky10 ks10-adv-os 3.3 M
Installing dependencies:
iotop noarch 0.6-24.p02.ky10 ks10-adv-updates 54 k
kylin-sysassist-db x86_64 1.3-1.ky10 ks10-adv-os 1.9 M
ltrace x86_64 0.7.91-31.ky10 ks10-adv-os 122 k
ltrace-help x86_64 0.7.91-31.ky10 ks10-adv-os 18 k
perf x86_64 4.19.90-89.25.v2401.ky10 ks10-adv-updates 5.0 M
Transaction Summary
===========================================================================================================
Install 6 Packages
Total download size: 10 M
Installed size: 69 M
Downloading Packages:
(1/6): ltrace-0.7.91-31.ky10.x86_64.rpm 452 kB/s | 122 kB 00:00
(2/6): ltrace-help-0.7.91-31.ky10.x86_64.rpm 260 kB/s | 18 kB 00:00
(3/6): iotop-0.6-24.p02.ky10.noarch.rpm 2.3 MB/s | 54 kB 00:00
(4/6): kylin-sysassist-1.3-1.ky10.x86_64.rpm 4.8 MB/s | 3.3 MB 00:00
(5/6): kylin-sysassist-db-1.3-1.ky10.x86_64.rpm 2.0 MB/s | 1.9 MB 00:00
(6/6): perf-4.19.90-89.25.v2401.ky10.x86_64.rpm 7.3 MB/s | 5.0 MB 00:00
-----------------------------------------------------------------------------------------------------------
Total 9.8 MB/s | 10 MB 00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : perf-4.19.90-89.25.v2401.ky10.x86_64 1/6
Installing : iotop-0.6-24.p02.ky10.noarch 2/6
Installing : ltrace-help-0.7.91-31.ky10.x86_64 3/6
Installing : ltrace-0.7.91-31.ky10.x86_64 4/6
Installing : kylin-sysassist-db-1.3-1.ky10.x86_64 5/6
Running scriptlet: kylin-sysassist-1.3-1.ky10.x86_64 6/6
Installing : kylin-sysassist-1.3-1.ky10.x86_64 6/6
Running scriptlet: kylin-sysassist-1.3-1.ky10.x86_64 6/6
Verifying : kylin-sysassist-1.3-1.ky10.x86_64 1/6
Verifying : kylin-sysassist-db-1.3-1.ky10.x86_64 2/6
Verifying : ltrace-0.7.91-31.ky10.x86_64 3/6
Verifying : ltrace-help-0.7.91-31.ky10.x86_64 4/6
Verifying : iotop-0.6-24.p02.ky10.noarch 5/6
Verifying : perf-4.19.90-89.25.v2401.ky10.x86_64 6/6
Installed:
iotop-0.6-24.p02.ky10.noarch kylin-sysassist-1.3-1.ky10.x86_64 kylin-sysassist-db-1.3-1.ky10.x86_64
ltrace-0.7.91-31.ky10.x86_64 ltrace-help-0.7.91-31.ky10.x86_64 perf-4.19.90-89.25.v2401.ky10.x86_64
Complete!
查看工具支持的子命令
[root@kylin-2 ~]# kylin-sysassist-cli -h
kylin-sysassist
Usage: kylin-sysassist-cli [OPTIONS] SUBCOMMAND
Options:
-h,--help Print this help message and exit
Subcommands:
collect collecting system information
monitor Start system monitoring(Supports starting as a service only: systemctl start kylin-sysassist-monitor)
syscheck Comprehensive physical examination of the system
collect 收集系统信息
monitor 监控系统状态(作为monitor服务)
syscheck 系统全面体检
collect
[root@kylin-2 ~]# kylin-sysassist-cli collect
Start collect:
[############################## ] (80%) sosreport
[#####################################] (100%) completed
Collection completed, successful: 9 ,failed: 0
Saved in: "/var/kylin-sysassist/collect/systemlog-2025-09-04-10-53-18.tar.gz"
文件打包存储到/var/kylin-sysassist/collect/systemlog-2025-09-04-10-53-18.tar.gz,解压这个压缩包.
解压后看到很多目录,比如:
activeinfo/:激活信息、KMS 日志。
mem/:内存碎片信息(extfrag_index、unusable_index)。
network/:网络配置、端口、UDP/TCP 状态。
processXXXX/mem/:某些进程的内存采样数据,包括 mem_info 和调用栈 stack.txt。
sosreport/:系统完整 sosreport 报告。
作用:这是 sysassist 收集到的系统快照,能用来定位问题(内存、网络、进程等)。
[root@kylin-2 collect]# tar zxvf systemlog-2025-09-04-10-53-18.tar.gz
systemlog-2025-09-04-10-53-18/
systemlog-2025-09-04-10-53-18/activeinfo/
systemlog-2025-09-04-10-53-18/activeinfo/kyinfo
systemlog-2025-09-04-10-53-18/activeinfo/LICENSE
systemlog-2025-09-04-10-53-18/activeinfo/ky_kms_activation.log
systemlog-2025-09-04-10-53-18/activeinfo/ky_kms_activation.log-20250706
systemlog-2025-09-04-10-53-18/activeinfo/ky_kms_activation.log-20250805
systemlog-2025-09-04-10-53-18/activeinfo/ky_kms_activation.log-20250901
systemlog-2025-09-04-10-53-18/activeinfo/kylin-activation-check
systemlog-2025-09-04-10-53-18/activeinfo/sh_kylin_activation_check
systemlog-2025-09-04-10-53-18/OS-system.info
systemlog-2025-09-04-10-53-18/core_user/
systemlog-2025-09-04-10-53-18/kernel_crash/
systemlog-2025-09-04-10-53-18/iotop/
systemlog-2025-09-04-10-53-18/iotop/iostat_-x
systemlog-2025-09-04-10-53-18/iotop/iotop_-n_1
systemlog-2025-09-04-10-53-18/mem/
systemlog-2025-09-04-10-53-18/mem/extfrag_index
systemlog-2025-09-04-10-53-18/mem/unusable_index
systemlog-2025-09-04-10-53-18/mem/memory_fragment
systemlog-2025-09-04-10-53-18/messages/
systemlog-2025-09-04-10-53-18/messages/messages
systemlog-2025-09-04-10-53-18/messages/messages-20250610
systemlog-2025-09-04-10-53-18/messages/messages-20250612
systemlog-2025-09-04-10-53-18/messages/messages-20250619
systemlog-2025-09-04-10-53-18/messages/messages-20250622
systemlog-2025-09-04-10-53-18/messages/messages-20250623
systemlog-2025-09-04-10-53-18/messages/messages-20250624
systemlog-2025-09-04-10-53-18/messages/messages-20250707
systemlog-2025-09-04-10-53-18/messages/messages-20250713
systemlog-2025-09-04-10-53-18/messages/messages-20250810
systemlog-2025-09-04-10-53-18/messages/messages-20250815
systemlog-2025-09-04-10-53-18/messages/messages-20250820
systemlog-2025-09-04-10-53-18/messages/messages-20250825
systemlog-2025-09-04-10-53-18/messages/messages-20250830
systemlog-2025-09-04-10-53-18/messages/messages-20250904
systemlog-2025-09-04-10-53-18/network/
systemlog-2025-09-04-10-53-18/network/nmcli_dev
systemlog-2025-09-04-10-53-18/network/netstat_antp
systemlog-2025-09-04-10-53-18/network/snmp
systemlog-2025-09-04-10-53-18/network/dev
systemlog-2025-09-04-10-53-18/network/tcp
systemlog-2025-09-04-10-53-18/network/sockstat
systemlog-2025-09-04-10-53-18/network/udp
systemlog-2025-09-04-10-53-18/process3583/
systemlog-2025-09-04-10-53-18/process3583/mem/
systemlog-2025-09-04-10-53-18/process3583/mem/2025-09-04-10-53-19/
systemlog-2025-09-04-10-53-18/process3583/mem/2025-09-04-10-53-19/stack.txt
systemlog-2025-09-04-10-53-18/process3583/mem/2025-09-04-10-53-19/mem_info
systemlog-2025-09-04-10-53-18/process687631/
systemlog-2025-09-04-10-53-18/process687631/mem/
systemlog-2025-09-04-10-53-18/process687631/mem/2025-09-04-10-53-19/
systemlog-2025-09-04-10-53-18/process687631/mem/2025-09-04-10-53-19/stack.txt
systemlog-2025-09-04-10-53-18/process687631/mem/2025-09-04-10-53-19/mem_info
systemlog-2025-09-04-10-53-18/process925227/
systemlog-2025-09-04-10-53-18/process925227/mem/
systemlog-2025-09-04-10-53-18/process925227/mem/2025-09-04-10-53-19/
systemlog-2025-09-04-10-53-18/process925227/mem/2025-09-04-10-53-19/stack.txt
systemlog-2025-09-04-10-53-18/process925227/mem/2025-09-04-10-53-19/mem_info
systemlog-2025-09-04-10-53-18/sosreport/
systemlog-2025-09-04-10-53-18/sosreport/sosreport-kylin-2-20250904105325.tar.xz
systemlog-2025-09-04-10-53-18/sosreport/sosreport-kylin-2-20250904105325.tar.xz.md5
monitor
[root@kylin-2 collect]# systemctl cat kylin-sysassist-monitor
# /usr/lib/systemd/system/kylin-sysassist-monitor.service
[Unit]
Description=kylin sysassist monitor
[Service]
Type=simple
EnvironmentFile=/etc/kylin-sysassist/kylin-sysassist.ini
ExecStart=/usr/bin/kylin-sysassist-cli monitor
Restart=always
RestartSec=42s
KillMode=process
[Install]
WantedBy=multi-user.target
systemctl cat:查看服务定义,确认它加载 /etc/kylin-sysassist/kylin-sysassist.ini 配置,并执行 kylin-sysassist-cli monitor。
start:启动监控服务。
enable:设置为开机自启。
status:确认当前正在运行(active running)。
作用:开启长期后台监控,定期采集信息,支撑 panalysis/nanalysis 分析。
[root@kylin-2 collect]# cat /etc/kylin-sysassist/kylin-sysassist.ini
[CollectOption]
#activate information,1:trun on, 0:trun off. same for similar options in this conf!!
activeinfo=1
#basic information system configuration and version
baseinfo=1
#core file
core=1
#IO information
iotop=1
#memory information
mem=1
#message information
messages=1
#network information
network=1
#process Information
process=1
#To specify a custom collection path, only one
custom=
#cpu threshold of the process collect with percent
processcputhreshold=90
[Log]
#log level(debug,info,warn,error,fatal: 1-->5)
LogLevel=2
[Monitor]
#monitor file (0:off 1:on). Filemonitor only works on x86_64 or aarch64
FileLoad=0
#the file name or folder to monitor, separated them by ',' if there are multiple values
FileName=
#Whether to monitor directories recursively
FileRecursive=1
#Maximum depth of monitoring
FileDepth=2
#the process being monitored
TaskPid=
#cpu or mem fluctuation of the monitored process with percent
MonitorCpuMemFluctuation=10
#cpu or mem absolute value of the monitorer process with percent
MonitorCpuMemAbsValue=80
#monitoring frequency(minute)
MonitorFrequency=1
#maximum collection time(minute)
MonitorMaxCollectTime=10
#how many hours are logs store
LogStoreTime=72
#net monitor(0:off, 1:on), Netmonitor only works on x86_64 or aarch64
NetmonitorLoad=0
#net monitor host, ex:192.168.1.1
NetmonitorHost=
#net monitor protocol, Netmonitor only support icmp,udp,tcp
NetmonitorProtocol=
#net monitor port, if monitor protocol is tcp or udp, can set this param
NetmonitorPort=
#memory reclaim monitor(0:off, 1:on), reclaim monitor only works on x86_64 or aarch64
ReclaimLoad=0
#memory reclaim monitor's mask.
#1 means turning on direct recycling monitoring
#2 means turning on indirect recycling(kswapd) monitoring
#The values that can be recognized are: 1, 2, 3
ReclaimMask=
#memory leak monitor(0:off, 1:on), only works on x86_64 or aarch64
MemleakLoad=0
#Min size to monit, -1 is unlimited.
MemleakMinSize=-1
#Max size to monit, -1 is unlimited.
MemleakMaxSize=-1
#Number of stacks displayed
MemleakTopN=5
#The time(seconds) between two outputs
MemleakInterval=5
#memory fragmentation monitor(0:off, 1:on)
MemFragmentationLoad=0
#The order that the fragmentation monitoring program focuses on
MemFragmentationOrder=
syscheck
[root@kylin-2 collect]# kylin-sysassist-cli syscheck
Start system check:
[#####################################] (100%) complete
Check complete
Report path: /var/kylin-sysassist/syscheck/sysCheckReport
工具执行全面检查,生成报告 /var/kylin-sysassist/syscheck/sysCheckReport。
作用:一次性做健康体检,快速发现风险配置或隐患。
ls /var/kylin-sysassist/syscheck/
bugreport:显示高危 bug(这里 0 个)。
cvereport:显示系统已知漏洞(这里 0 个)。
rpm_qa.txt:系统安装的 rpm 包列表,便于复现环境或排障。
sysCheckReport:详细的健康检查结果,包括:
漏洞/bug 数量。
基础配置(kdump、sysstat 已启用,serial 未配置)。
内核参数检查(哪些 panic 选项没启用,给出建议)。
irqbalance 服务状态。
IO 调度策略(mq-deadline)。
logrotate 策略(30 份,单文件 4MB)。
内存健康:未检测到高压力,无严重碎片,无 OOM 记录。
系统资源使用率:CPU 2.26%,内存 10.55%,磁盘 3.43%,swap 未用。
最后给出优化建议(如配置串口、调整内核参数、提高 vm.min_free_kbytes)。
作用:让管理员快速看到潜在风险(安全漏洞、内核参数、资源不足),并给出优化建议。
总结
你执行的整个流程其实就是 安装工具 → 收集系统状态 → 开启监控 → 做健康体检 → 查看报告。
collect → 全面采集并保存快照。
monitor → 长期后台监控,支撑后续 panalysis/nanalysis。
syscheck → 一次性体检,发现 bug、cve、安全隐患。
报告文件在 /var/kylin-sysassist/{collect,syscheck}/,可供后续分析或上报支持团队。