已开启
[24.03 LTS SP2][RISC-V] sysmonitor 测试cpu监控和网卡监控问题 #19
AtomGit-Bot创建于  2025年6月30日
AtomGit-Bot
2025年6月30日 创建

描述特性测试的软件环境信息
版本信息

OS镜像 RISC-V-2403-sp2
http://121.36.84.172/dailybuild/EBS-openEuler-24.03-LTS-SP2/openeuler-2025-06-24-19-53-02/virtual_machine_img/riscv64/

内核
Linux openeuler-riscv64 6.6.0-96.0.0.101.oe2403sp2.riscv64

环境 host

问题1 网卡监控

参照:参照:https://docs.openeuler.openatom.cn/zh/docs/24.03_LTS/docs/sysmonitor/sysmonitor-使用手册.html

复现过程:

不支持虚拟网卡
目前是测试镜像的问题无法测试
https://gitee.com/openeuler/RISC-V/issues/IBD7B8 这里有 riscv64-sp1 其他同学关于网卡的测试方案

问题2 cpu监控

复现过程:

[root@localhost ~]# vim /etc/sysmonitor/cpu
# cpu usage alarm percent
ALARM="40"

# cpu usage alarm resume percent
RESUME="20"

# monitor period (second)
MONITOR_PERIOD="5"

# stat period (second)
STAT_PERIOD="5"

# cpu range in a domain, format can be "X,Y" or "X-Y" or mixed. Also can
# be followed by ALARM/RESUME to set usage alarm/resume percent in this domain.
# DOMAIN="0,1"
# DOMAIN="2-3" ALARM="50" RESUME="40"
DOMAIN=""

# command executed when cpu usage exceeds alarm percent
REPORT_COMMAND="mkdir -p /root/test_cpu"

[root@localhost ~]# stress-ng --cpu 4 --timeout 60
stress-ng: info:  [4938] setting to a 60 second run per stressor
stress-ng: info:  [4938] dispatching hogs: 4 cpu
stress-ng: info:  [4938] successful run completed in 60.31s (1 min, 0.31 secs)
[root@localhost ~]# ls /root
a.log  sysmonitor-kmod-1.3.2-1.6.oe2403sp2.riscv64.rpm
[root@localhost ~]# cat /var/log/sysmonitor.log
2025-06-29T11:50:20.955107+00:00|info|sysmonitor[609]: cpu monitor starting up
2025-06-29T11:55:21.118729+00:00|info|sysmonitor[609]: CPU usage resume: 16.6%
无预期输出

预期输出
2024-12-22T21:21:28.677858+08:00|warning|sysmonitor[7477]: CPU usage alarm: 99.8%
2024-12-22T21:21:28.778146+08:00|info|sysmonitor[7477]: cpu monitor: execute REPORT_COMMAND[mkdir -p /root/test_cpu] successfully
2024-12-22T21:22:28.793888+08:00|info|sysmonitor[7477]: CPU usage resume: 3.0%
可以看到测试的输出中缺少了 CPU usage alarm 和 execute REPORT_COMMAND[mkdir -p /root/test_cpu] successfully这两项

likedislike
AAtomGit-Bot
2025年6月30日 创建了任务
2025年6月30日 评论:

Hi feifei-fertilizer, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: sig-ops, and any of the maintainers: @solarhu , @cmss_dx , @yangzhao_kl , @dowzyx , @chenwei_kernel , @luanjianhai , @hjx_gitff , @snoweay , @MrRlu , @Lostwayzxc , @byrobins

likedislike
openeuler-ci-botopeneuler-ci-bot成员
2025年6月30日 添加了   sig/sig-ops 标签
AAtomGit-Bot
2025年6月30日 修改了描述
AtomGit-Bot
2025年6月30日 评论:

内存监控 x86 24.03 LTS 结果

[root@localhost ~]# cat /var/log/sysmonitor.log
2024-10-31T08:18:45.757535+08:00|info|sysmonitor[12643]: comm:systemd exe:systemd[1](parent comm:swapper/0 parent exe:[0]) send SIGTERM to comm:rsyslogd exe:rsyslogd[1515].
2024-10-31T08:18:46.284226+08:00|info|sysmonitor[12643]: comm:systemctl exe:systemctl[12813](parent comm:sudo parent exe:sudo[12812]) send SIGTERM to comm:systemd-tty-ask exe:systemd-tty-ask-password-agent[12814].(sudo[12811]<-bash[12525]<-sshd[12524]<-sshd[12519])
2024-10-31T08:19:44.968511+08:00|warning|sysmonitor[12643]: CPU usage alarm: 100.0%
2024-10-31T08:19:45.074451+08:00|info|sysmonitor[12643]: cpu monitor: execute REPORT_COMMAND[mkdir -p /root/test_cpu] successfully
2024-10-31T08:20:40.094194+08:00|info|sysmonitor[12643]: memory usage resume:  4.7%
2024-10-31T08:20:45.106467+08:00|info|sysmonitor[12643]: CPU usage resume:  4.4%

正常
内存监控 x86 24.03 LTS-sp2 结果

[root@localhost ~]# cat /var/log/sysmonitor.log
2025-06-30T19:27:46.958578+08:00|info|sysmonitor[9013]: comm:systemd exe:systemd[1](parent comm:swapper/0 parent exe:[0]) send SIGTERM to comm:rsyslogd exe:rsyslogd[1713].
2025-06-30T19:27:47.054819+08:00|info|sysmonitor[9013]: CPU usage resume: 13.5%
2025-06-30T19:27:47.323537+08:00|info|sysmonitor[9013]: comm:systemctl exe:systemctl[9222](parent comm:sudo parent exe:sudo[9221]) send SIGTERM to comm:systemd-tty-ask exe:systemd-tty-ask-password-agent[9223].(sudo[9219]<-bash[8746]<-sshd[8745]<-sshd[8741])
2025-06-30T19:27:57.057663+08:00|warning|sysmonitor[9013]: CPU usage alarm: 46.8%
2025-06-30T19:27:57.163064+08:00|info|sysmonitor[9013]: cpu monitor: execute REPORT_COMMAND[mkdir -p /root/test_cpu] successfully
2025-06-30T19:29:07.181864+08:00|info|sysmonitor[9013]: CPU usage resume:  2.9%

正常

likedislike
2025年7月14日 评论:

问题1请在原始issue跟踪,其中关于虚拟网卡不作为问题列出,有需求再说。

问题2请将STAT_PERIOD调整为4试试,在我的虚拟机上得到了预期结果

likedislike
AtomGit-Bot
2025年7月21日 评论:

问题1请在原始issue跟踪,其中关于虚拟网卡不作为问题列出,有需求再说。

问题2请将STAT_PERIOD调整为4试试,在我的虚拟机上得到了预期结果

感谢 laokz老师 ,我这里按这种方式也有了预期结果

2025-07-21T13:42:19.710253+00:00|info|sysmonitor[612]: cpu monitor: execute REPOO
RT_COMMAND[mkdir -p /root/test_cpu] successfully
2025-07-21T13:42:19.602990+00:00|warning|sysmonitor[612]: CPU usage alarm: 54.9%
likedislike
2025年7月21日 评论:

问题1请在原始issue跟踪,其中关于虚拟网卡不作为问题列出,有需求再说。

问题2请将STAT_PERIOD调整为4试试,在我的虚拟机上得到了预期结果

感谢确认!那这个issue关了吧)

likedislike