Server Metrics Monitoring
ci/ps
component: v0.23.0+ Server metrics monitoring, used for monitoring server information such as CPU, memory, disk, and more.
# Configuration
Field | Type | Description | Default |
---|---|---|---|
options | []string | List of metrics to query; if empty, all metrics are queried | Empty |
Available options:
- host/info: Query host information
- cpu/info: Query CPU information
- cpu/percent: Query CPU usage
- mem/virtualMemory: Query virtual memory information
- mem/SwapMemory: Query swap memory information
- disk/usage: Query disk usage
- disk/ioCounters: Query disk I/O counter information
- net/ioCounters: Query network I/O counter information
- net/interfaces: Query network interface information
# Execution Results
Each metric corresponds to a specific structure, detailed as follows:
# Return Value Structure
Field | Type | Description |
---|---|---|
host/info | HostInfoStat | Host information |
cpu/info | []CpuInfoStat | CPU information |
cpu/percent | []float64 | CPU usage |
mem/virtualMemory | VirtualMemoryStat | Virtual memory info |
mem/swapMemory | SwapMemoryStat | Swap memory info |
disk/usage | UsageStat | Disk usage |
disk/ioCounters | []DiskIOCountersStat | Disk I/O counters |
net/ioCounters | []NetIOCountersStat | Network I/O counters |
net/interfaces | []NetInterfaceStat | Network interfaces |
# HostInfoStat: Host Information
Field | Type | Description |
---|---|---|
hostname | string | Hostname |
uptime | int | System uptime in seconds |
bootTime | int | System boot time, Unix timestamp |
procs | int | Number of running processes |
os | string | Operating system name |
platform | string | Platform name, e.g. Windows/Linux |
platformFamily | string | Platform family, e.g. Standalone Workstation |
platformVersion | string | Platform version number |
kernelVersion | string | Kernel version |
kernelArch | string | Kernel architecture, e.g. x86_64 |
virtualizationSystem | string | Virtualization system |
virtualizationRole | string | Virtualization role |
hostId | string | Unique host identifier, e.g. UUID |
# CpuInfoStat: CPU Information
Field | Type | Description |
---|---|---|
cpu | int | CPU ID |
vendorId | string | Vendor ID |
family | string | CPU family |
model | string | Model |
stepping | int | Stepping version |
physicalId | string | Physical ID |
coreId | string | Core ID |
cores | int | Number of physical cores |
modelName | string | Full CPU model name |
mhz | int | Clock speed |
cacheSize | int | Cache size |
flags | []string | CPU feature flags |
microcode | string | Microcode version |
# VirtualMemoryStat: Virtual Memory Information
Field | Type | Description |
---|---|---|
total | int | Total memory size |
available | int | Available memory size |
used | int | Used memory size |
usedPercent | int | Memory usage percentage |
free | int | Free memory size |
# SwapMemoryStat: Swap Memory Information
Field | Type | Description |
---|---|---|
total | int | Total swap size |
used | int | Used swap size |
free | int | Free swap size |
usedPercent | int | Swap usage percentage |
sin | int | Swap in count |
sout | int | Swap out count |
# UsageStat: Disk Usage
Field | Type | Description |
---|---|---|
path | string | Disk path |
fstype | string | Filesystem type |
total | int | Total disk size |
free | int | Free disk size |
used | int | Used disk size |
usedPercent | float | Disk usage percentage |
inodesTotal | int | Total inode count |
inodesUsed | int | Used inode count |
inodesFree | int | Free inode count |
inodesUsedPercent | float | Inode usage percentage |
# DiskIOCountersStat: Disk I/O Counter Information
Field | Type | Description |
---|---|---|
readCount | int | Read operation count |
writeCount | int | Write operation count |
readBytes | int | Bytes read |
writeBytes | int | Bytes written |
readTime | int | Read time |
writeTime | int | Write time |
# NetIOCountersStat: Network I/O Counter Information
Field | Type | Description |
---|---|---|
name | string | Network interface name |
bytesSent | int | Bytes sent |
bytesRecv | int | Bytes received |
packetsSent | int | Packets sent |
packetsRecv | int | Packets received |
errin | int | Errors in |
errout | int | Errors out |
# NetInterfaceStat: Network Interface Information
Field | Type | Description |
---|---|---|
index | int | Network interface index |
mtu | int | Maximum transmission unit |
name | string | Network interface name |
hardwareAddr | string | Hardware address, i.e., MAC address |
flags | []string | Network interface flags |
addrs | []Addr | Network interface addresses |
Addr structure may contain the following fields:
Field | Type | Description |
---|---|---|
addr | string | Network address |
# Return Value Example
{
"cpu/info": [
{
"cpu": 0,
"vendorId": "AuthenticAMD",
"family": "107",
"model": "",
"stepping": 0,
"physicalId": "",
"coreId": "",
"cores": 16,
"modelName": "AMD Ryzen 7 4800U with Radeon Graphics",
"mhz": 1800,
"cacheSize": 0,
"flags": [],
"microcode": ""
}
],
"cpu/percent": [
2.019230769230769
],
"disk/ioCounters": [
{
"readCount": 3551912,
"mergedReadCount": 0,
"writeCount": 3128504,
"mergedWriteCount": 0,
"readBytes": 146734894592,
"writeBytes": 106254207488,
"readTime": 2026,
"writeTime": 1708,
"iopsInProgress": 0,
"ioTime": 0,
"weightedIO": 0,
"name": "C:",
"serialNumber": "",
"label": ""
},
{
"readCount": 960056,
"mergedReadCount": 0,
"writeCount": 1004377,
"mergedWriteCount": 0,
"readBytes": 14221063168,
"writeBytes": 10532502016,
"readTime": 209,
"writeTime": 616,
"iopsInProgress": 0,
"ioTime": 0,
"weightedIO": 0,
"name": "D:",
"serialNumber": "",
"label": ""
}
],
"disk/usage": [
{
"path": "C:",
"fstype": "",
"total": 171798687744,
"free": 7824457728,
"used": 163974230016,
"usedPercent": 95.445566068782,
"inodesTotal": 0,
"inodesUsed": 0,
"inodesFree": 0,
"inodesUsedPercent": 0
},
{
"path": "D:",
"fstype": "",
"total": 338971062272,
"free": 3926061056,
"used": 335045001216,
"usedPercent": 98.84177102620943,
"inodesTotal": 0,
"inodesUsed": 0,
"inodesFree": 0,
"inodesUsedPercent": 0
}
],
"host/info": {
"hostname": "",
"uptime": 360057,
"bootTime": 1722819631,
"procs": 345,
"os": "windows",
"platform": "",
"platformFamily": "",
"platformVersion": "22H2",
"kernelVersion": "",
"kernelArch": "x86_64",
"virtualizationSystem": "",
"virtualizationRole": "",
"hostId": "1e81ede4-3433-8b94-990f-9438b1945ca2"
},
"mem/swapMemory": {
"total": 19346468864,
"used": 2621607936,
"free": 16724860928,
"usedPercent": 13.6,
"sin": 0,
"sout": 0,
"pgIn": 0,
"pgOut": 0,
"pgFault": 0,
"pgMajFault": 0
},
"mem/virtualMemory": {
"total": 16499134464,
"available": 900419584,
"used": 15598714880,
"usedPercent": 94,
"free": 900419584,
"active": 0,
"inactive": 0,
"wired": 0,
"laundry": 0,
"buffers": 0,
"cached": 0,
"writeBack": 0,
"dirty": 0,
"writeBackTmp": 0,
"shared": 0,
"slab": 0,
"sreclaimable": 0,
"sunreclaim": 0,
"pageTables": 0,
"swapCached": 0,
"commitLimit": 0,
"committedAS": 0,
"highTotal": 0,
"highFree": 0,
"lowTotal": 0,
"lowFree": 0,
"swapTotal": 0,
"swapFree": 0,
"mapped": 0,
"vmallocTotal": 0,
"vmallocUsed": 0,
"vmallocChunk": 0,
"hugePagesTotal": 0,
"hugePagesFree": 0,
"hugePagesRsvd": 0,
"hugePagesSurp": 0,
"hugePageSize": 0,
"anonHugePages": 0
},
"net/interfaces": [
{
"index": 14,
"mtu": 1500,
"name": "xx",
"hardwareAddr": "fe:3a:35:21:0a:10",
"flags": [
"broadcast",
"multicast"
],
"addrs": [
{
"addr": "fe51::3521:5d11:2560:3917/64"
},
{
"addr": "169.254.1.2/16"
}
]
}
],
"net/ioCounters": [
{
"name": "WLAN",
"bytesSent": 239207252,
"bytesRecv": 140244972,
"packetsSent": 161174,
"packetsRecv": 292636,
"errin": 0,
"errout": 0,
"dropin": 0,
"dropout": 0,
"fifoin": 0,
"fifoout": 0
}
]
}
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
174
175
176
177
178
179
180
181
182
183
184
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
174
175
176
177
178
179
180
181
182
183
184
Edit this page on GitHub (opens new window)
Last Updated: 2024/10/23, 10:13:01