capture

bluewave-labsAGPL-3.0活跃维护

用 Go 写的开源硬件监控代理,为 Checkmate 采集服务器 CPU、内存等硬件指标,帮运维实时掌握机器健康状况。

An open source hardware monitoring agent for Checkmate

v1.4.0发布于 2026-03-12 21:17 UTC306star +1 / 7 天38fork同步于 2026-11-10 18:02 UTC

怎么上手

由 README 提炼,执行前请确认
docker run -d -v /etc/os-release:/etc/os-release:ro -p 59232:59232 -e API_SECRET=your-secret-key ghcr.io/bluewave-labs/capture:latest
硬件要求按 README 说明

README 未说明具体硬件要求;S.M.A.R.T. 监控需 smartmontools 7.0 或更新版本,GPU 监控标注为即将推出。

有 Docker 镜像
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

轻量级硬件监控采集代理,把主机硬件指标通过 REST API 暴露给 Checkmate 使用

用 Go 写的开源硬件监控代理,为 Checkmate 采集服务器 CPU、内存等硬件指标,帮运维实时掌握机器健康状况。

核心能力

  • 采集 CPU 温度、负载、频率与使用率
  • 监控内存、磁盘用量与 inode、读写字节
  • 通过 smartmontools 读取 NVMe/SATA 的 S.M.A.R.T. 信息
  • 采集网络与 Docker 容器指标并通过 REST API 暴露
  • 提供 Docker、Helm、systemd、launchd 等多种部署方式

容易踩的坑

API_SECRET 为必填项,且需与 Checkmate 中配置的密钥一致;默认监听端口为 59232,如需改动用 PORT 环境变量;Docker 运行时需挂载 /etc/os-release 用于平台检测;S.M.A.R.T. 监控依赖 smartmontools 7.0+,SMART_DEVICES 配置非法会导致启动失败。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v1.4.0
  1. v1.4.0最新正式版2026-03-12 · 2026-03-12 21:17 UTC

    This release improves the data you get from Capture and makes it more reliable. Disk metrics now include mountpoint, LVM disks are detected more accurately, and ZFS I/O reporting is improved. Docker metrics now include runtime stats such as CPU, memory, network, block I/O, and PIDs, and the API/OpenAPI docs are updated to match these responses. Test coverage and dependency updates were also improved to reduce regressions.

    Changelog

    • 7600a4864b37dd2cbe7483835856de626276ed45 Added Helm Chart for deployment of Capture (#145)
    • 10b4a8fb6cd022f8efd2b04db043dc7d6cd2492b Feat/add mountpoint field disk data (#140)
    • beedb0655135826139be7e45cc7255a1d31bfdec build(deps): bump golang.org/x/crypto from 0.38.0 to 0.45.0 (#141)
    • e410c469f96c2e36efd1de8b71bb245344551482 docs(changelog): Update CHANGELOG for version 1.3.2
    • 0fc2b81954a6f428da7b5032e1ea11e0f1e64b46 docs(changelog): Update CHANGELOG for version 1.4.0
    • cbc4fe800290efa368e0a1d5f9af4d970cbeab14 feat(agents): add Go development instructions and best practices for GitHub Copilot
    • 134e22f97fede5f1ee81fd0d6a60ae1a2561d12b feat(ci): Workflow Update for Checks (#148)
    • bb8b06b01c217403a88c00504a014b52ad248a3b feat(docker): add Docker container metrics collection and OpenAPI documentation (#142)
    • 650596cd56e81620c2005e2fc18e9c56ca28fbe1 feat(metrics): enhance ZFS IO statistics collection and update test cases for ZFS metrics
    • 6681650870e3576ee1b152c130884e0c2b11deff feat: add installation scripts for Linux and Windows services, update README with service instructions (#149)
    • e2583a48071a9a34f0e88d8d658cd99b8aae7e79 fix(test): migrate disk metrics test to internal package and remove integration test
    • 1021e7b3e31bd5cf7646dcc9c02f406c3245dae7 fix: include internal tests in unit-test command
    • 9da66ff416f5489f2a6eeb56339ab32a1e35237d fix: issue #131, disk metric not shown when using LVM (#143)
    • 5da2c3aea22006163abc703e29b4e000af9f9023 fix: remove outdated 'check' GitHub Actions badge
    • cab166b1c915ef6f3d09b62623bfaecbc0a804fe fix: replace API_SECRET with hardcoded value in contract workflow (#146)
    • e665581df98c6cab0d81dbaeee25548ded439007 fix: streamline service management in installation scripts for Linux and Windows
    • c790cf14f54700f2ce6555124d478e4a34a7e6e5 fix: update file permissions to 600 for disk_test
    • f4c40cb7290ca95281158364617b42232bb5d039 test(disks): add disk filesystem metrics tests and helper functions (#147)

    Full Changelog

    Contributors: @Antoplt, @adosaiguas, @sharmajidotdev @mertssmnoglu

  2. v1.3.22025-10-09 · 2025-10-09 10:12 UTC
    查看更新说明

    Changelog

    Upgraded Go to v1.24.7, refactored disk metrics collection to improve accuracy and fix disk filtering issues, and cleaned up goreleaser configuration by removing redundant SBOM settings.

    • d2134de8eab8c7b1a1bb900ebb47f0d7ead4cbdc feat: upgrade go version to 1.24.7 (#130) by @mrtechit
    • f1945010a3110f81a8202383ebe24525565f3327 Refactor disk metrics collection and improve comments (#132) @VeNoMZiTo
    • 844f725742d09f5abfb5ec73e93c69a976e522b7 fix(goreleaser): remove extra sbom configuration from capture build (#129)

    Thanks to all contributors for their work on this release.

  3. v1.3.12025-09-21 · 2025-09-21 12:18 UTC
    查看更新说明

    This is a patch release that addresses a bug in the CPU temperature validation logic on some Linux systems and adding more build metadata to capture --version output.

    Changelog

    • 1e14393a8139b50503de7a90b07dd9de819cacdb Update linting tools to include go vet and staticcheck (#118)
    • ac0f516dbb25c808ccbb317d47fc597864c26155 feat: Add more build metadata like commit hash, commit date, build date and git tag (#121)
    • 515fa5cada6e5180a79b35af072fdb1af59c1d23 fix(linux-cpu): cover CPU temperature sensors without label files (#125)
  4. v1.3.02025-08-06 · 2025-08-06 20:14 UTC
    查看更新说明

    Capture v1.3.0 - Multi-Platform Support

    The most wanted Capture release is here. Capture supports 🔥 Windows (amd64 & arm64), macOS, Linux, and even ARMv6/v7 devices like Raspberry Pi.

    You can access new pre-built binaries from the releases page.

    Improved Clarity & Security
    Curious about what's inside Capture? Each platform build now includes a Software Bill of Materials (SBOM), giving you full transparency into dependencies and components.

    Changelog

    • af2e7a329e6cf74d700a8d10c70cdc5189598ebf CI Improvements for Check/Test/Build in each platform (#98)
    • 9f3dd0d6b9793d26a1200e4dff43e08873b97bfd build: Add support for SBOM generation (#110)
    • f658dbb945fbef0e59a9fa03689bc35046f5771f build: Enable Windows amd64 and arm64 builds (#109)
    • e33faa9e6f7cb167db38a30637b25f423a5021bd build: Ignore arm(arm32) architecture on Windows (#111)
    • 961b9848e2cb35c99c8202ac5ffaf69e19cf6ce1 cd(release): Install Syft for enhanced dependency scanning (#113)
    • 013b3aa3abe8e6f096d79ffc322d531fd32127d2 chore: Add support for armv6 and armv7 architecture in GoReleaser (#76)
    • a84f6edaef782743c6a866b8ca3e763c697e58d1 feat(ci): Add OpenAPI contract testing workflow (#102)
    • 6b9ac0dfb5a3820534dd096bf4db2ea2b0ce7215 feat(system): Migrate sysfs module to system for Multi Platform Support (#97)
    • 01104959f648453be1affadf0cd684c468e2fcb1 feat: Add unit and integration test commands to Justfile (#101)
    • a95f94c61072659f0784017cad434cac3622a9bc feat: Implement GetPrettyName for macOS, Linux, and Windows (#96)
    • 88fad86171529d615864aeb29833e0f2f582c177 refactor(disk): Improve device filtering compatibility on Windows (#108)
  5. v1.2.02025-06-24 · 2025-06-24 13:24 UTC
    查看更新说明

    Changelog

    • 2de06c3cf9acca167d05c6fde52c9c0177dbd6ee Capture metadata in API Responses (#82)
    • 7b98c15dfe2ee3feff8f55ba227e44f34f2da686 Issue and pr templates (#86)
    • d7c9c747767fcdb644a3e4d2dc6d0cc6ba9eb9e6 User friendly instructions in README for Quick Start (#93)
    • 8161d57102ee576ab462159acd135a422599048e build(deps): bump golang.org/x/net from 0.30.0 to 0.38.0 (#84)
    • d7d5824c2d53990077ba642777a78c0ed4f5cc10 chore: Add bug report issue template to improve issue tracking (#69)
    • 546e533e58342ee8051a0a59a7c9b966a8453cc5 chore: Enhance Dockerfile with additional comments and structure (#88)
    • 41283a5299a3f688b8d354dedb8a275092ccb042 ci: Add codeql.yml (#70)
    • 019c1ca41fc93f9821f6a297fda84e26efc64d7f ci: Make go workflow read-only (#74)
    • 442bf24ba9ea6da7a9b24abdbb2763a352707055 docs(security): Update vulnerability reporting guideline (#71)
    • c7ba4486c90b577d27afac13d37b9de0036b3b71 feat(api): Update OpenAPI specification to version 1.1.0 (#83)
    • e2580a9fc131224382255b1d2053ef7323d163a9 feat(metric): Docker container monitoring (#78)
    • e5ee49d4a5ffdaa2eb82017e65fd7729ab403879 feat(metrics): Add network metrics collection (#67)
    • f0f8fee5fe32d32790b4793e4dd430086f66e0d8 feat: host.prettyname added (#90)
    • 592cc722f8f4c48f1315687eb86007f50814c67a fix: Correct JSON key for SmartOverallHealthResult in metrics (#87)
    • 92de4a2aa2582d06ad316b1646450248b3a51d53 fix: Move health check route to the correct position in the handler initialization (#79)

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    github-license github-repo-size github-commit-activity github-last-commit-data github-languages github-issues-and-prs github-issues go-reference github-actions-go Ask DeepWiki

    Capture is a hardware monitoring agent that collects hardware information from the host machine and exposes it through a RESTful API. The agent is designed to be lightweight and easy to use.

    Features

    • CPU Monitoring
      • Temperature
      • Load
      • Frequency
      • Usage
    • Memory Monitoring
    • Disk Monitoring
      • Usage
      • Inode Usage
      • Read/Write Bytes
    • S.M.A.R.T. Monitoring (Self-Monitoring, Analysis and Reporting Technology) for NVMe and SATA drives. Requires smartmontools 7.0 or newer
    • Network Monitoring
    • Docker Container Monitoring
    • GPU Monitoring (coming soon)

    Quick Start (Docker)

    docker run -d \
        -v /etc/os-release:/etc/os-release:ro \
        -p 59232:59232 \
        -e API_SECRET=your-secret-key \
        ghcr.io/bluewave-labs/capture:latest
    

    Quick Start (Docker Compose)

    services:
      # Capture service
      capture:
        image: ghcr.io/bluewave-labs/capture:latest
        container_name: capture
        restart: unless-stopped
        ports:
          - "59232:59232"
        environment:
          - API_SECRET=REPLACE_WITH_YOUR_SECRET # Required authentication key. Do not forget to replace this with your actual secret key.
          - GIN_MODE=release
        volumes:
          - /etc/os-release:/etc/os-release:ro
    

    Configuration

    VariableDescriptionDefaultRequired
    API_SECRETAuthentication key (Must match the secret you enter on Checkmate)-Yes
    PORTServer port number59232No
    GIN_MODEGin(web framework) mode. Debug is for developmentreleaseNo
    SMART_DEVICESComma-separated SMART devices as path or path:type, e.g. /dev/sdb:sat,/dev/sdc:sat. Overrides the device type from smartctl --scan for those paths (symlinks such as /dev/disk/by-id/... are matched to the scanned disk) and adds devices the scan misses. Checked at startup; an invalid value stops Capture with an error-No

    Example configurations:

    # Minimal
    API_SECRET=your-secret-key ./capture
    
    # Complete
    API_SECRET=your-secret-key PORT=59232 GIN_MODE=release ./capture
    

    Installation Options

    Docker (Recommended)

    Pull and run the official image:

    docker run -d \
        -v /etc/os-release:/etc/os-release:ro \
        -p 59232:59232 \
        -e API_SECRET=your-secret-key \
        ghcr.io/bluewave-labs/capture:latest
    

    Or build locally:

    docker buildx build -t capture .
    docker run -d -v /etc/os-release:/etc/os-release:ro -p 59232:59232 -e API_SECRET=your-secret-key capture
    

    Docker options explained:

    • -v /etc/os-release:/etc/os-release:ro: Platform detection
    • -p 59232:59232: Port mapping
    • -e API_SECRET: Required authentication key
    • -d: Detached mode

    Helm

    You can deploy Capture on a Kubernetes cluster using the provided Helm chart.

    1. Go to the Helm chart directory:

      cd deployment/helm/capture
      
    2. Customize values.yaml and set your API_SECRET.

    3. Install the chart:

      helm install capture .
      

    For detailed instructions, refer to the Helm Installation Guide.

    System Installation

    Choose one of these methods:

    1. Pre-built Binaries: Download from GitHub Releases

    2. Go Package:

      go install github.com/bluewave-labs/capture/cmd/capture@latest
      
    3. Build from Source:

      git clone [email protected]:bluewave-labs/capture
      cd capture
      just build   # or: go build -o dist/capture ./cmd/capture/
      

    Linux Systemd Service

    An install script is provided at deployment/linux/install.sh. It automatically detects your CPU architecture, downloads the latest release from GitHub, installs the binary to /usr/local/bin, and registers a systemd service.

    Requirements: curl, tar, and a system running systemd. Must be run as root.

    1. Download and run in one step:

      curl -fsSL https://raw.githubusercontent.com/bluewave-labs/capture/main/deployment/linux/install.sh | sudo bash
      

      The script will prompt you for API_SECRET if it is not supplied as an argument.

    2. Supply options inline if preferred:

      curl -fsSL https://raw.githubusercontent.com/bluewave-labs/capture/main/deployment/linux/install.sh \
          | sudo bash -s -- --api-secret "your-secret-key"
      
    3. All available options:

      curl -fsSL https://raw.githubusercontent.com/bluewave-labs/capture/main/deployment/linux/install.sh \
          | sudo bash -s -- \
              --api-secret "your-secret-key" \
              --port 59232 \
              --install-dir /usr/local/bin \
              --service-name capture
      

      Or download the script first and run it locally:

      curl -fsSL -o install.sh https://raw.githubusercontent.com/bluewave-labs/capture/main/deployment/linux/install.sh
      sudo bash install.sh --api-secret "your-secret-key"
      
    4. Full option reference:

      OptionDescriptionDefault
      --api-secretAuthentication key (required)(prompted)
      --portPort the agent listens on59232
      --install-dirDirectory to install the binary/usr/local/bin
      --service-namesystemd service namecapture
    5. After installation, manage the service with systemctl:

      systemctl status capture
      systemctl stop capture
      systemctl start capture
      systemctl restart capture
      journalctl -u capture -f
      
    Manual setup

    If you prefer to configure the service manually, a template service file is provided at deployment/linux/capture.service.

    1. Edit the service file with your binary path, user, group, and secret key:

      nano deployment/linux/capture.service
      
    2. Copy it to the systemd unit directory:

      cp deployment/linux/capture.service /etc/systemd/system/
      
    3. Reload, enable, and start the service:

      systemctl daemon-reload
      systemctl enable capture
      systemctl start capture
      
    4. Verify the service is running:

      systemctl status capture
      

    macOS Launchd Service

    An install script is provided at deployment/macos/install.sh. It automatically detects your CPU architecture, downloads the latest release from GitHub, installs the binary to /usr/local/bin, and registers a system-wide launchd daemon.

    Requirements: curl, tar, macOS, and root access via sudo.

    1. Download and run in one step:

      curl -fsSL https://raw.githubusercontent.com/bluewave-labs/capture/main/deployment/macos/install.sh | sudo bash
      

      The script will prompt you for API_SECRET if it is not supplied as an argument.

    2. Supply options inline if preferred:

      curl -fsSL https://raw.githubusercontent.com/bluewave-labs/capture/main/deployment/macos/install.sh \
          | sudo bash -s -- --api-secret "your-secret-key"
      
    3. All available options:

      curl -fsSL https://raw.githubusercontent.com/bluewave-labs/capture/main/deployment/macos/install.sh \
          | sudo bash -s -- \
              --api-secret "your-secret-key" \
              --port 59232 \
              --install-dir /usr/local/bin \
              --service-name com.bluewavelabs.capture
      

      Or download the script first and run it locally:

      curl -fsSL -o install.sh https://raw.githubusercontent.com/bluewave-labs/capture/main/deployment/macos/install.sh
      sudo bash install.sh --api-secret "your-secret-key"
      
    4. Full option reference:

      OptionDescriptionDefault
      --api-secretAuthentication key (required)(prompted)
      --portPort the agent listens on59232
      --install-dirDirectory to install the binary/usr/local/bin
      --service-namelaunchd label and plist filenamecom.bluewavelabs.capture
    5. After installation, manage the service with launchctl:

      sudo launchctl load /Library/LaunchDaemons/com.bluewavelabs.capture.plist
      sudo launchctl start com.bluewavelabs.capture
      sudo launchctl list | grep com.bluewavelabs.capture
      tail -f /var/log/com.bluewavelabs.capture.log
      
    Manual setup

    If you prefer to configure the service manually, a template plist is provided at deployment/macos/capture.plist.

    1. Edit the plist with your binary path, working directory, secret key, and any other settings you need:

      nano deployment/macos/capture.plist
      
    2. Copy it to the launchd daemon directory and set the required permissions:

      cp deployment/macos/capture.plist /Library/LaunchDaemons/com.bluewavelabs.capture.plist
      chown root:wheel /Library/LaunchDaemons/com.bluewavelabs.capture.plist
      chmod 644 /Library/LaunchDaemons/com.bluewavelabs.capture.plist
      
    3. Load and start the service:

      sudo launchctl load /Library/LaunchDaemons/com.bluewavelabs.capture.plist
      sudo launchctl start com.bluewavelabs.capture
      
    4. Verify the service is running:

      sudo launchctl list | grep com.bluewavelabs.capture
      

    Windows Service

    A PowerShell install script is provided at deployment/windows/install.ps1. It automatically detects your CPU architecture, downloads the latest release from GitHub, installs the binary, and registers a Windows service.

    Requirements: PowerShell 5.1+ and an Administrator terminal.

    1. Open PowerShell as Administrator and run in one step:

      Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
      Invoke-RestMethod https://raw.githubusercontent.com/bluewave-labs/capture/main/deployment/windows/install.ps1 | Invoke-Expression
      

      The script will prompt you for API_SECRET if it is not supplied as a parameter.

    2. Supply parameters inline if preferred:

      & ([scriptblock]::Create(
          (Invoke-RestMethod https://raw.githubusercontent.com/bluewave-labs/capture/main/deployment/windows/install.ps1)
      )) -APISecret "your-secret-key"
      
    3. All available parameters:

      & ([scriptblock]::Create(
          (Invoke-RestMethod https://raw.githubusercontent.com/bluewave-labs/capture/main/deployment/windows/install.ps1)
      )) -APISecret "your-secret-key" -Port 59232 -InstallDir "C:\Program Files\Capture" -ServiceName "capture"
      

      Or download the script first and run it locally:

      Invoke-RestMethod https://raw.githubusercontent.com/bluewave-labs/capture/main/deployment/windows/install.ps1 -OutFile install.ps1
      Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
      .\install.ps1 -APISecret "your-secret-key"
      
    4. Full parameter reference:

      ParameterDescriptionDefault
      -APISecretAuthentication key (required)(prompted)
      -PortPort the agent listens on59232
      -InstallDirDirectory to install the binaryC:\Program Files\Capture
      -ServiceNameWindows service namecapture
    5. After installation, manage the service with standard PowerShell cmdlets:

      Get-Service capture
      Stop-Service capture
      Start-Service capture
      Restart-Service capture
      

    Reverse Proxy and SSL

    You can use a reverse proxy in front of the Capture service to handle HTTPS requests and SSL termination.

    Caddy
    ├deployment/reverse-proxy-compose/
    ├── caddy/
    │   └── Caddyfile
    └── caddy.compose.yml
    
    1. Go to the deployment/reverse-proxy-compose directory

      cd deployment/reverse-proxy-compose
      
    2. Replace replacewithyourdomain.com with your actual domain in deployment/reverse-proxy-compose/caddy/Caddyfile

    3. Set API_SECRET environment variable for the Capture service in deployment/reverse-proxy-compose/caddy.compose.yml.

    4. Ensure your domain’s DNS A/AAAA records point to this server’s IP.

    5. Open inbound TCP ports 80 and 443 on your firewall/security group.

    Start the Caddy reverse proxy

    docker compose -f caddy.compose.yml up -d
    

    Endpoints

    • Base URL: http://<host>:<PORT> (default port 59232)
    • Authentication: Every /api/v1/** route requires Authorization: Bearer $API_SECRET. /health stays public so you can use it for liveness checks.
    MethodPathAuthDescriptionNotes
    GET/health❌Liveness probe that returns "OK".Useful for container orchestrators.
    GET/api/v1/metrics✅Returns the complete capture payload with CPU, memory, disk, host, SMART, network, and Docker data.Aggregates every collector.
    GET/api/v1/metrics/cpu✅CPU temps, load, and utilization.
    GET/api/v1/metrics/memory✅Memory totals and usage metrics.
    GET/api/v1/metrics/disk✅Disk capacity, inode usage, and IO stats.
    GET/api/v1/metrics/host✅Host metadata (OS, uptime, kernel, etc.).
    GET/api/v1/metrics/smart✅S.M.A.R.T. drive health information.
    GET/api/v1/metrics/net✅Interface-level network throughput.
    GET/api/v1/metrics/docker✅Docker container metrics.Use ?all=true to include stopped containers.

    All responses share the same envelope:

    {
      "data": {
        // collector-specific payload
      },
      "capture": {
        "version": "1.0.0",
        "mode": "release"
      },
      "errors": [
        // optional array of error messages if any collectors failed, can be null
      ],
    }
    

    Collectors can partially fail; when that happens the API responds with HTTP 207 Multi-Status and fills errors with detailed reasons so you can alert without dropping other metric data.

    API Documentation

    Our API is documented in accordance with the OpenAPI spec.

    You can find the OpenAPI specifications in openapi.yml

    Contributing

    We welcome contributions! If you would like to contribute, please read the CONTRIBUTING.md file for more information.

    Star History

    Star History Chart

    License

    Capture is licensed under AGPLv3. You can find the license in the LICENSE file.