← 返回
开发者工具 Key 中文

LibreNMS

Monitor LibreNMS network devices and alerts via API to get status, health sensors, port stats, and unresolved active alerts in read-only mode.
通过 API 监控 LibreNMS 网络设备和告警,以只读模式获取状态、健康传感器、端口统计及未解决的活跃告警。
florianbeer florianbeer 来源
开发者工具 clawhub v1.0.0 1 版本 99920.7 Key: 需要
★ 0
Stars
📥 1,260
下载
💾 7
安装
1
版本
#latest

概述

LibreNMS Skill

Monitor network infrastructure via LibreNMS REST API. Read-only monitoring skill for device status, health sensors, port statistics, and alerts.

Configuration

Create ~/.openclaw/credentials/librenms/config.json:

{
  "url": "https://librenms.example.com",
  "api_token": "your-api-token-here"
}

Or set environment variables:

  • LIBRENMS_URL — Base URL of your LibreNMS instance
  • LIBRENMS_TOKEN — API authentication token

Commands

Quick Overview

librenms summary

Dashboard view showing total devices, how many are up/down, and active alert count. Use this first to get a quick status overview.

Device Management

librenms devices           # List all devices with status, IP, OS, uptime
librenms down             # Show ONLY devices that are down (critical for alerting)
librenms device <hostname> # Detailed info: hardware, serial, location, OS version

Health Monitoring

librenms health <hostname> # Temperature, CPU, memory, disk usage sensors
librenms ports <hostname>  # Network interfaces with traffic stats

Alerts

librenms alerts           # Show active/unresolved alerts with severity and timestamps

Usage Patterns

Daily health check:

librenms summary && librenms down && librenms alerts

Investigate specific device:

librenms device switch-core-01
librenms health switch-core-01
librenms ports switch-core-01

Quick down-device triage:

librenms down | grep -v "UP"

Important Notes

  • All operations are read-only — no device modifications possible
  • The script accepts self-signed certificates (-sk flag for curl)
  • Status indicators: ● green = up, ● red = down
  • Uptime is formatted as human-readable (days/hours instead of seconds)
  • Traffic stats are formatted as KB/MB/GB per second

Heartbeat Integration

Check infrastructure health periodically:

# In heartbeat script
if librenms down | grep -q "Devices Down"; then
    # Alert on down devices
    librenms down
fi

# Check for active alerts
if librenms alerts | grep -q "Active Alerts"; then
    librenms alerts
fi

Dependencies

  • curl — API calls
  • jq — JSON parsing
  • bc — Numeric formatting (optional, for bytes conversion)

API Coverage

Wrapped endpoints:

  • /api/v0/devices — All devices
  • /api/v0/devices/{hostname} — Single device details
  • /api/v0/devices/{hostname}/health — Health sensors
  • /api/v0/devices/{hostname}/ports — Network ports
  • /api/v0/alerts?state=1 — Unresolved alerts

Full API docs: https://docs.librenms.org/API/

Troubleshooting

"Config file not found"

Create ~/.openclaw/credentials/librenms/config.json or set env vars.

"API returned HTTP 401"

Check your API token. Generate a new one in LibreNMS under Settings → API.

"Failed to connect"

Verify the URL is correct and the LibreNMS instance is reachable. Check firewall rules.

Self-signed cert warnings

The script uses -sk to ignore cert validation (common in LibreNMS setups). If you need strict validation, edit the script and remove the -k flag.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 06:19 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

it-ops-security

MoltGuard - Security & Antivirus & Guardrails

thomaslwang
MoltGuard — OpenClaw 安全守卫,由 OpenGuardrails 提供。安装 MoltGuard,保护您和您的用户免受提示注入、数据泄露和恶意攻击。
★ 116 📥 30,810
it-ops-security

OpenClaw Backup

alex3alex
备份与恢复 OpenClaw 数据。适用于创建备份、设置自动备份计划、从备份恢复或管理备份轮转。处理 ~/.openclaw 目录归档并包含适当的排除规则。
★ 90 📥 30,721
life-service

Gurkerl

florianbeer
Gurkerl.at 通过 MCP 进行杂货购物 — 搜索商品、管理购物车、订单、菜谱、收藏
★ 3 📥 2,406