You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17607550577 ef409f5d34 解决读文件不存在时报段错误 преди 4 години
Makefile 解决读文件不存在时报段错误 преди 4 години
readme.md 添加另一个获取cpu温度的文件路径 преди 4 години
server-monitor 解决读文件不存在时报段错误 преди 4 години
server-monitor.c 解决读文件不存在时报段错误 преди 4 години

readme.md

sever-monitor v1.0

mqtt服务器默认端口:127.0.0.1:1883

主题:server-status,5秒钟采集一次发送到服务器

以上都是默认配置可自己修改源码

  • 通过C语言实现的采集内存、cpu使用情况、cpu温度、硬盘温度。

  • cpu温度通过读取liux内核伪文件获得:“/sys/class/hwmon/hwmon1/temp3_input”或者 “/sys/class/therma/temp”。

  • 硬盘温度通过通过Smartmontools api获取。

  • CPU使用率通过读取linux内核伪文件计算获得:”/proc/stat”。

  • 内存使用率通过读取linux内核伪文件计算获得:”/proc/meminfo”。

需要安装的依赖:mosquitto客户端、emqx或mosquitto服务器、Smartmontools ,测试基于centos7.9

运行效果

  • shell启动命令

Usage: sever-monitor /dev/sda

源码地址: http://gitea.huangyulong-iot.com/private/server-monitor.git

Web体验地址: http://nodeui.huangyulong-iot.com/