Skip to content

Commit

Permalink
[feature] Add Linux process monitoring (#1857)
Browse files Browse the repository at this point in the history
Co-authored-by: zhangshenghang <[email protected]>
Co-authored-by: zhangshenghang <[email protected]>
Co-authored-by: 铁甲小宝 <[email protected]>
  • Loading branch information
4 people authored Apr 26, 2024
1 parent 1905d83 commit 72ff8c3
Show file tree
Hide file tree
Showing 4 changed files with 525 additions and 0 deletions.
91 changes: 91 additions & 0 deletions home/docs/help/process.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
id: process
title: Monitoring Linux Process Monitoring
sidebar_label: Process
keywords: [Open Source Monitoring System, Operating System Process Monitoring, Process Monitoring]
---
> Collect and monitor basic information of processes on Linux systems, including CPU usage, memory usage, physical memory, IO, etc.
## Configuration Parameters


| Parameter Name | Parameter Description |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| Target Host | The IPv4, IPv6, or domain name of the monitored endpoint. Note ⚠️: Do not include the protocol header (e.g., https://, http://). |
| Task Name | Identifies the name of this monitoring, ensuring uniqueness. |
| Port | SSH port of the Linux system, default: 22 |
| Timeout | Sets the timeout for the connection in milliseconds, default is 6000 milliseconds. |
| Reuse Connection | Sets whether SSH connection is reused, default is false. When false, a new connection is created for each information retrieval. |
| Username | Username for the server. |
| Password | Password for the server. |
| Process Name | Name or part of the name of the process to be monitored. |
| Collector | Specifies which collector to use for scheduling this monitoring. |
| Monitoring Interval | Interval for periodic data collection, in seconds. Minimum interval that can be set is 30 seconds. |
| Tags | Used for categorizing and managing monitoring resources. |
| Description | Additional notes and descriptions for identifying this monitoring. Users can add remarks here. |
| Private Key | Private key required for connecting to the server. |

### Metrics Collected

#### Metric Set: Process Basic Information


| Metric Name | Metric Unit | Metric Description |
| ----------- | ----------- | ------------------ |
| PID | NONE | Process ID |
| User | NONE | User |
| CPU | NONE | CPU Usage |
| MEM | NONE | Memory Usage |
| rss | NONE | Physical Memory |
| cmd | NONE | Command |

#### Metric Set: Memory Usage Information


| Metric Name | Metric Unit | Metric Description |
| ----------- | ----------- | ------------------ |
| PID | NONE | Process ID |
| detail | NONE | Detailed metrics |

Includes metrics for:

- Peak Virtual Memory
- Current Virtual Memory Usage
- Locked Memory
- Fixed Memory
- Peak Physical Memory
- Current Physical Memory Usage
- Data Segment Size
- Stack Size
- Code Size
- Shared Library Size
- Page Table Entry Size

#### Metric Set: Other Monitoring Information


| Metric Name | Metric Unit | Metric Description |
| ----------- | ----------- | --------------------------------- |
| PID | NONE | Process ID |
| path | NONE | Execution Path |
| date | NONE | Start Time |
| fd_count | NONE | Number of File Descriptors Opened |

#### Metric Set: IO


| Metric Name | Metric Unit | Metric Description |
| ----------- | ----------- | ------------------ |
| PID | NONE | Process ID |
| metric | NONE | Metric Name |
| value | NONE | Metric Value |

Includes metrics for:

- rchar (Total bytes read by the process from disk or other files)
- wchar (Total bytes written by the process to disk or other files)
- syscr (Number of read operations initiated by the process)
- syscw (Number of write operations initiated by the process)
- read_bytes (Actual number of bytes read by the process from disk)
- write_bytes (Actual number of bytes written by the process to disk)
- cancelled_write_bytes (Actual number of bytes cancelled by the process while writing to disk)
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
id: process
title: 监控:Linux 进程监控
sidebar_label: Process
keywords: [开源监控系统, 操作系统进程监控, 进程监控]
---
> 对Linux系统进程基础信息进行采集监控,包括进程的 CPU使用率、内存使用率、物理内存、IO 等监控
## 配置参数


| 参数名称 | 参数帮助描述 |
| -------- | ------------------------------------------------------------------------- |
| 目标Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 端口 | Linux系统的ssh端口,默认: 22 |
| 超时时间 | 设置连接的超时时间,单位ms毫秒,默认6000毫秒。 |
| 复用连接 | 设置SSH连接是否复用,默认为:false。为false每次回去信息都会创建一个连接 |
| 用户名 | 服务器用户名 |
| 密码 | 服务器密码 |
| 进程名称 | 需要监控的进程名称或进程部分名称 |
| 采集器 | 配置此监控使用哪台采集器调度采集 |
| 监控周期 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 |
| 绑定标签 | 用于对监控资源进行分类管理 |
| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息 |
| 私钥 | 连接服务器所需私钥 |

### 采集指标

#### 指标集合:进程基本信息


| 指标名称 | 指标单位 | 指标帮助描述 |
| -------- | -------- | ------------ |
| PID || 进程ID |
| User || 用户 |
| CPU || CPU使用率 |
| MEM || 内存使用率 |
| rss || 物理内存 |
| cmd || 运行命令 |

#### 指标集合:内存使用信息


| 指标名称 | 指标单位 | 指标帮助描述 |
| -------- | -------- | ------------ |
| PID || 进程ID |
| detail || 详细监控指标 |

包含的指标:

- 虚拟内存峰值
- 当前虚拟内存使用
- 锁定内存
- 固定内存
- 物理内存峰值
- 当前物理内存使用
- 数据段大小
- 堆栈大小
- 代码大小
- 共享库大小
- 页表项大小

#### 指标集合:其他监控信息


| 指标名称 | 指标单位 | 指标帮助描述 |
| -------- | -------- | ------------------ |
| PID || 进程ID |
| path || 执行路径 |
| date || 启动时间 |
| fd_count || 打开文件描述符数量 |

#### 指标集合:IO


| 指标名称 | 指标单位 | 指标帮助描述 |
| -------- | -------- | ------------ |
| PID || 进程ID |
| metric || 监控指标名称 |
| value || 监控指标值 |

包含的指标:

- rchar(进程从磁盘或其他文件读取的总字节数)
- wchar(进程写入到磁盘或其他文件的总字节数)
- syscr(进程发起的读取操作的次数)
- syscw(进程发起的写入操作的次数)
- read_bytes(进程从磁盘实际读取的字节数)
- write_bytes(进程写入到磁盘的实际字节数)
- cancelled_write_bytes(进程写入到磁盘的实际字节数)
1 change: 1 addition & 0 deletions home/sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
"type": "category",
"label": "program",
"items": [
"help/process",
"help/jvm",
"help/springboot2",
"help/springboot3",
Expand Down
Loading

0 comments on commit 72ff8c3

Please sign in to comment.