-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_node.py
173 lines (141 loc) · 4.43 KB
/
config_node.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# Watchtower sample period (in s)
sample_period: float = 1
# Output CSV file path (relative to the executable, or absolute)
csv_path = "out.csv"
# Path to a reference output, considered safe
csv_safe = "safe.csv"
# Number of STD of deviation allowed
nb_std = 4
# MQTT client name
client_name = "/sentinel/node_1"
# MQTT broker address
broker_addr = "hub.local"
broker_port: int = 8883
# Root CA path
ca_cert = "/certs/CA.pem"
# Client certificate and key paths
certfile = "/certs/node.crt"
keyfile = "/certs/node.key"
# Info about all files to sample
files: list = [
{"path": "/sys/kernel/sentinel/nb_cpus",
"name": "Number of CPUs cores",
"unit": "N/A",
"topic": "/nb_cpus",
"differential": 0},
{"path": "/sys/kernel/sentinel/CPU_0",
"name": "CPU 0 freq",
"unit": "kHz",
"topic": "/CPU_0",
"differential": 0},
{"path": "/sys/kernel/sentinel/CPU_1",
"name": "CPU 1 freq",
"unit": "kHz",
"topic": "/CPU_1",
"differential": 0},
{"path": "/sys/kernel/sentinel/CPU_2",
"name": "CPU 2 freq",
"unit": "kHz",
"topic": "/CPU_2",
"differential": 0},
{"path": "/sys/kernel/sentinel/CPU_3",
"name": "CPU 3 freq",
"unit": "kHz",
"topic": "/CPU_3",
"differential": 0},
{"path": "/sys/kernel/sentinel/free_ram",
"name": "Free RAM",
"unit": "kB",
"topic": "/free_ram",
"differential": 0},
{"path": "/sys/kernel/sentinel/used_ram",
"name": "Used RAM",
"unit": "kB",
"topic": "/used_ram",
"differential": 0},
{"path": "/sys/kernel/sentinel/total_ram",
"name": "Total RAM",
"unit": "kB",
"topic": "/total_ram",
"differential": 0},
{"path": "/sys/kernel/sentinel/free_swap",
"name": "Free Swap",
"unit": "kB",
"topic": "/free_swap",
"differential": 0},
{"path": "/sys/kernel/sentinel/used_swap",
"name": "Used Swap",
"unit": "kB",
"topic": "/used_swap",
"differential": 0},
{"path": "/sys/kernel/sentinel/total_swap",
"name": "Total Swap",
"unit": "kB",
"topic": "/total_swap",
"differential": 0},
{"path": "/sys/kernel/sentinel/load_1m",
"name": "CPU load (1m)",
"unit": "%",
"topic": "/load_1m",
"differential": 0},
{"path": "/sys/kernel/sentinel/load_5m",
"name": "CPU load (5m)",
"unit": "%",
"topic": "/load_5m",
"differential": 0},
{"path": "/sys/kernel/sentinel/load_15m",
"name": "CPU load (15m)",
"unit": "%",
"topic": "/load_15m",
"differential": 0},
{"path": "/sys/kernel/sentinel/nb_processes",
"name": "Number of processes",
"unit": "N/A",
"topic": "/nb_processes",
"differential": 0},
{"path": "/sys/class/net/wlan0/statistics/rx_bytes",
"name": "Number of bytes received",
"unit": "bytes",
"topic": "/rx_bytes",
"differential": 1},
{"path": "/sys/class/net/wlan0/statistics/tx_bytes",
"name": "Number of bytes sent",
"unit": "bytes",
"topic": "/tx_bytes",
"differential": 1},
{"path": "/sys/class/net/wlan0/statistics/rx_packets",
"name": "Number of packets received",
"unit": "N/A",
"topic": "/rx_packets",
"differential": 1},
{"path": "/sys/class/net/wlan0/statistics/tx_packets",
"name": "Number of packets sent",
"unit": "N/A",
"topic": "/tx_packets",
"differential": 1},
{"path": "/sys/kernel/sentinel/hiwater_rss",
"name": "RSS high watermark",
"unit": "Bytes",
"topic": "/hiwater_rss",
"differential": 0},
{"path": "/sys/kernel/sentinel/hiwater_vm",
"name": "VM high watermark",
"unit": "Bytes",
"topic": "/hiwater_vm",
"differential": 0},
{"path": "/sys/kernel/sentinel/nb_fds",
"name": "Number of file decriptors",
"unit": "N/A",
"topic": "/nb_fds",
"differential": 0},
{"path": "/sys/kernel/sentinel/task_size",
"name": "Tracked task current size",
"unit": "Bytes",
"topic": "/task_size",
"differential": 0},
{"path": "/sys/kernel/sentinel/tracked_pid",
"name": "Tracked PID",
"unit": "N/A",
"topic": "/tracked_pid",
"differential": 0},
]