Skip to content

AKS1st/dsh-sysmon

30Last commit Aug 15, 2026

dsh-sysmon DSH plugin

dsh-sysmon adds a fixed-position indicator to the DSH Web interface, refreshing every second with CPU, memory, and disk utilization. It uses color thresholds (gray, orange, red) to signal load levels, and operates with minimal overhead by caching data server-side.

How to install the dsh-sysmon DSH plugin

dsh plugin --profile web add github:AKS1st/dsh-sysmon

Copying does not run this command. Review the repository and version before installing the dsh-sysmon DSH plugin.

dsh-sysmon DSH plugin data source

dsh-sysmon DSH plugin snapshot date: Aug 16, 2026

discovered

What the dsh-sysmon DSH plugin can do

  • Displays CPU usage as total core percentage (can exceed 100%) and core count
  • Shows memory usage percentage with thresholds at 80% (orange) and 90% (red)
  • Shows disk usage for root filesystem with same thresholds
  • Updates every 1 second with in-flight request guard on client side
  • Uses diff DOM updates to minimize re-renders
  • Server-side caching ensures sub-millisecond API responses

Where the dsh-sysmon DSH plugin fits

  • Monitor server resource usage while working in DSH Web console
  • Quickly detect high CPU or memory load without leaving the browser
  • Identify disk space pressure on the root filesystem
  • Track resource trends over short time windows (1-second intervals)
  • Integrate into a self-hosted DSH environment for real-time health checks

Who the dsh-sysmon DSH plugin is for

  • DSH Web users who need at-a-glance system metrics
  • Developers managing servers via DSH and wanting lightweight monitoring

dsh-sysmon DSH plugin limitations

  • Linux only – relies on /proc/stat, /proc/meminfo, and df
  • Only monitors root filesystem (/)
  • CPU usage is calculated over ~1-second sampling window, averaging short bursts
  • First sample shows 0% CPU until the second sample is taken

dsh-sysmon DSH plugin: from the repository README

Quoted from the AKS1st/dsh-sysmon README, the upstream source of the dsh-sysmon DSH plugin. Copyright remains with the original authors.

DSH Web 的系统状态悬浮窗:固定在页面右下角,每 1 秒刷新显示 CPU、内存、磁盘占用率。 ``` CPU 39%/16 MEM 46% DISK 22% ``` ## 显示规格 - **位置**:右下角固定悬浮,`pointer-events: none`,不遮挡界面操作。 - **配色**:默认浅灰色小字(等宽字体、11px)。 - **刷新**:1 秒一次。 ### 阈值规则 | 指标 | 默认(浅灰) | 橙色 | 红色 | | ---- | ----------- | ---- | ---- | | CPU(x%/y) | < 90%×核心数 | x ≥ 90%×核心数 | x ≥ 98%×核心数 | | 内存 | ≤ 80% | > 80% | > 90% | | 磁盘 | ≤ 80% | > 80% | > 90% | - **CPU**:`x%` 为所有核心使用率之和(可超过 100%),`y` 为总核心数;阈值按总容量比例计算。 - **内存 / 磁盘**:超过 80% 橙色、超过 90% 红色。 ## 安装 从 GitHub 仓库安装: ```sh dsh plugin --profile web add github:AKS1st/dsh-sysmon dsh web ``` 或 clone 到本地后从本地目录安装: ```sh git clone https://github.com/AKS1st/dsh-sysmon.git cd dsh-sysmon npm install npm run build dsh plugin --profile web add . dsh web ``` ## 工作方式 - **Host**(`src/index.ts`):`ctx.effect` 挂一个每秒运行的后台采样器,经 `ctx.shell` 采样(`/proc/stat`、`nproc`、`/proc/meminfo`、`df -P /`),把最新快照写入内存缓存。路由 `GET /dsh-sysmon/api` 只返回缓存(亚毫秒、零子进程开销),并拒绝非 GET 方法与跨源浏览器请求。CPU 使用率为相邻两次采样之间的增量(窗口约 1 秒),首次采样显示 0。 - **Client**(`src/client/index.ts`):创建 `#dsh-sysmon` 固定定位元素,每 1 秒 `fetch` 一次路由,带 in-flight 守卫避免请求重叠;重绘只更新三个数值节点(diff 式)。纯 DOM 实现、零运行时依赖。 ## 已知限制 - **仅 Linux**——宿主采集器读取 `/proc/stat`、`/proc/meminfo` 与 `df`;其他平台需要不同的采集

Read the full READMERepository license: BSD-3-Clause

dsh-sysmon DSH plugin questions

How do I install dsh-sysmon?

Run `dsh plugin --profile web add github:AKS1st/dsh-sysmon` and then restart DSH Web with `dsh web`. If you prefer a local clone, you can build from source and add the local directory.

Does dsh-sysmon work on Windows or macOS?

No. The plugin reads Linux-specific files (`/proc/stat`, `/proc/meminfo`, `df`) to collect metrics. It only works on Linux hosts. If you need cross-platform support, you would need to write a custom collector.

Can I change the update interval or the position of the monitor?

Currently the update interval is fixed at 1 second and the position is fixed at the bottom-right corner. These are not configurable via the plugin. You would need to fork and modify the source code.

Does the monitor affect my DSH Web performance?

Very little. The server-side API returns cached data in sub-millisecond time and the client uses a single fixed element with diff DOM updates. The fetch request has an in-flight guard to avoid overlap. The overhead is negligible.

Why does CPU show 0% at first?

CPU usage is calculated as the delta between two consecutive samples (about 1 second apart). The first sample has no previous data, so it displays 0% until the second sample is taken.