This translation is older than the original page and might be outdated. See what has changed.

luci-app-statistics

OpenWrt 包含实时统计功能,但默认情况下不存储历史数据供查看。基于 collectd 和 rrdtool 的 luci-app-statistics 软件包将显示历史图表,包括 ping、接口带宽利用率、CPU 负载、内存、磁盘、运行时间等。 有关更多信息,请参阅 statistical.data.overview 和 collectd blog post。 有关其他带宽监控工具,请参阅 bwmon 页面。

1. 安装软件包 luci-app-statistics。如果使用 SSH,请运行:opkg update && opkg install luci-app-statistics

2. 安装所需的插件:

下面建议了一些插件,但还有许多其他插件可用。要查看所有可用的 collectd 模块,请运行:opkg list | grep collectd-mod

opkg install collectd-mod-ethstat collectd-mod-ipstatistics collectd-mod-irq collectd-mod-load collectd-mod-ping collectd-mod-powerdns collectd-mod-sqm collectd-mod-thermal collectd-mod-wireless

3. 启用守护进程

/etc/init.d/collectd enable

注意,/tmp/rrd 目录位于 RAM 中,重启后统计数据将丢失。要防止这种情况,您可以配置持久存储位置或设置备份——请参见下文。

  • 使用 uci export luci_statistics 查看配置
  • 编辑 /etc/config/luci_statistics 以进行更改

安装软件包后,在统计(Statistics) → 设置(Setup)菜单中会出现一个新的菜单。所有已安装的 collectd 模块都会显示在此处,但只有部分模块默认启用。

  • 通用插件选项卡: 查看子选项卡以选择要监控的统计信息
  • 网络插件选项卡: 选择要监控的接口
  • 输出插件选项卡:
    • RRDtool 子选项卡: 为了防止闪存磨损,默认的 存储目录 是 `/tmp/rrd`。所有统计数据将在重启时丢失。替代方案:
    • 网络子选项卡: collectd 可以监听其他路由器的数据,也可以将其数据发送到其他路由器。两个设备的数据收集间隔必须相同才能正常工作。
  • Last modified: 2025/02/27 06:57
  • by starsfall