huangyulong пре 4 година
родитељ
комит
477467cbd6
4 измењених фајлова са 1236 додато и 1236 уклоњено
  1. 9
    9
      Makefile
  2. 34
    34
      readme.md
  3. BIN
      server-monitor
  4. 1193
    1193
      server-monitor.c

+ 9
- 9
Makefile Прегледај датотеку

@@ -1,9 +1,9 @@
1
-cc  = gcc 
2
-cflags = -Wall -lmosquitto -lpthread -ldl -I /root/x86/mqtt_install/root/x86/mqtt_install/include -L /root/x86/mqtt_install/root/x86/mqtt_install/lib
3
-main:
4
-	$(cc) server-monitor.c -o server-monitor $(cflags)
5
-	
6
-.phony:clean
7
-clean:
8
-	rm *.o server-monitor -fr
9
-
1
+cc  = gcc 
2
+cflags = -Wall -lmosquitto -lpthread -ldl -I /root/x86/mqtt_install/root/x86/mqtt_install/include -L /root/x86/mqtt_install/root/x86/mqtt_install/lib
3
+main:
4
+	$(cc) server-monitor.c -o server-monitor $(cflags)
5
+	
6
+.phony:clean
7
+clean:
8
+	rm *.o server-monitor -fr
9
+

+ 34
- 34
readme.md Прегледај датотеку

@@ -1,35 +1,35 @@
1
-# sever-monitor v1.0
2
-
3
-#### mqtt服务器默认端口:127.0.0.1:1883
4
-
5
-#### 主题:server-status,5秒钟采集一次发送到服务器
6
-
7
-**以上都是默认配置可自己修改源码**
8
-
9
-- 通过C语言实现的采集内存、cpu使用情况、cpu温度、硬盘温度。
10
-
11
-- cpu温度通过读取liux内核伪文件获得:"/sys/class/hwmon/hwmon1/temp3_input"或者 "/sys/class/therma/temp"。
12
-
13
-- 硬盘温度通过通过Smartmontools api获取。
14
-
15
-- CPU使用率通过读取linux内核伪文件计算获得:"/proc/stat"。
16
-
17
-- 内存使用率通过读取linux内核伪文件计算获得:"/proc/meminfo"。
18
-
19
-> 需要安装的依赖:mosquitto客户端、emqx或mosquitto服务器、Smartmontools ,测试基于centos7.9
20
-
21
-**运行效果**:
22
-
23
-
24
-![](https://www.huangyulong-iot.com/zb_users/upload/2021/05/202105142003496064051.png)
25
-![](https://www.huangyulong-iot.com/zb_users/upload/2021/05/202105142007255715004.png)
26
-
27
-- **shell启动命令**:
28
-
29
-Usage:  sever-monitor  /dev/sda
30
-      
31
-
32
-![](https://www.huangyulong-iot.com/zb_users/upload/2021/05/202105142004062967103.png)
33
-
34
-#### 源码地址: http://gitea.huangyulong-iot.com/private/server-monitor.git
1
+# sever-monitor v1.0
2
+
3
+#### mqtt服务器默认端口:127.0.0.1:1883
4
+
5
+#### 主题:server-status,5秒钟采集一次发送到服务器
6
+
7
+**以上都是默认配置可自己修改源码**
8
+
9
+- 通过C语言实现的采集内存、cpu使用情况、cpu温度、硬盘温度。
10
+
11
+- cpu温度通过读取liux内核伪文件获得:"/sys/class/hwmon/hwmon1/temp3_input"或者 "/sys/class/therma/temp"。
12
+
13
+- 硬盘温度通过通过Smartmontools api获取。
14
+
15
+- CPU使用率通过读取linux内核伪文件计算获得:"/proc/stat"。
16
+
17
+- 内存使用率通过读取linux内核伪文件计算获得:"/proc/meminfo"。
18
+
19
+> 需要安装的依赖:mosquitto客户端、emqx或mosquitto服务器、Smartmontools ,测试基于centos7.9
20
+
21
+**运行效果**:
22
+
23
+
24
+![](https://www.huangyulong-iot.com/zb_users/upload/2021/05/202105142003496064051.png)
25
+![](https://www.huangyulong-iot.com/zb_users/upload/2021/05/202105142007255715004.png)
26
+
27
+- **shell启动命令**:
28
+
29
+Usage:  sever-monitor  /dev/sda
30
+      
31
+
32
+![](https://www.huangyulong-iot.com/zb_users/upload/2021/05/202105142004062967103.png)
33
+
34
+#### 源码地址: http://gitea.huangyulong-iot.com/private/server-monitor.git
35 35
 #### Web体验地址: http://nodeui.huangyulong-iot.com/


+ 1193
- 1193
server-monitor.c
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


Loading…
Откажи
Сачувај