李光春

openWRT使用Prometheus

· 李光春

确认是否安装了下方插件

prometheus-node-exporter-lua
prometheus-node-exporter-lua-nat_traffic
prometheus-node-exporter-lua-netstat
prometheus-node-exporter-lua-openwrt
prometheus-node-exporter-lua-wifi
prometheus-node-exporter-lua-wifi_stations

修改 prometheus-node-exporter-lua 监听

nano /etc/init.d/prometheus-node-exporter-lua
config_get interface "main" listen_interface "lan"
config_get interface "main" listen_interface "lan"

nano /etc/config/prometheus-node-exporter-lua
option listen_interface 'lan'
/etc/init.d/prometheus-node-exporter-lua restart

配置 Prometheus


  - job_name: 'openwrt'
    scrape_interval: 5s
    static_configs:
      - targets: [ 'localhost:9100' ]