最後更新: 2022-02-07
介紹
LuCI 是 OpenWrt 的 Web Panel
Homepage:
http://luci.subsignal.org/trac
luci depends on:
libc, uhttpd, uhttpd-mod-ubus,
luci-mod-admin-full, luci-theme-bootstrap, luci-app-firewall,
luci-app-opkg, luci-proto-ppp, libiwinfo-lua,
luci-proto-ipv6, rpcd-mod-rrdns
目錄
- Inatallation
- Useful Package
- luci-app-statistics
Installation
openwrt by default ship with the LuCI WebUI
如果沒有安裝, 那可以用以下 CLI 安裝
opkg update
opkg install luci
Useful Package
QoS
- luci-app-qos
- luci-app-nft-qos # QoS over Nftables, Menu 多了 "Services->QoS over Nftables"
Block
- luci-app-adblock
- luci-app-banip # 多了 "Services->banip"
- luci-app-fwknopd
Tools
- luci-app-commands # Menu 會多了 "System -> Custom Commands", 可以在 "Configure" 新增 CLI
- luci-app-ttyd # ttyd - Command-line tool for sharing terminal over the web (7681/tcp)
- luci-app-wol #
- luci-app-watchcat # ping-watchdog utility. Services->Watchcat
- luci-app-cshark # Cloudshark capture tool Web UI
- luci-app-diag-core # LuCI Diagnostics Tools (Core). Menu 會多了 "Network -> Disgnostics" 內有 ping, traceroute, nslookup
Function
- luci-app-ddns
- luci-app-wifischedule
- luci-app-upnp
Status
- luci-app-nlbwmon # Netlink based bandwidth accounting
- luci-app-vnstat2 # LuCI Support for vnStat 2
- luci-app-statistics # Manu Bar 多了 "Statistics"
VPN
- luci-app-openvpn # opkg install openvpn-openssl
- luci-app-wireguard # https://www.wireguard.com/
- luci-app-eoip
- luci-app-vpn-policy-routing # Provides Web UI for vpn-policy-routing service.
穿牆
- luci-app-frpc # frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the Internet.
- luci-app-frps
luci-app-statistics
依賴
# 本身有
libc, luci-base, luci-lib-jsonc,
# rrdtool
rrdtool1,
# collectd
collectd, collectd-mod-rrdtool, collectd-mod-iwinfo,
collectd-mod-cpu, collectd-mod-memory, collectd-mod-interface,
collectd-mod-load, collectd-mod-network
Install
opkg install luci-app-statistics
Enable
/etc/init.d/luci_statistics enable
/etc/init.d/luci_statistics start
ps | grep col
4786 root 3184 SN /usr/sbin/collectd -C /tmp/collectd.conf -f
/etc/init.d/luci_statistics
... restart() { ### regenerate config / prepare environment start ### restart collectd /etc/init.d/collectd restart }
Storage directory:
Default: /tmp/rrd # 所以 reboot 後數據會無晒
永久保存
mkdir /home/rrd
chown nobody: /var/rrd
設定:
雖然它是用 collectd, 但 GUI 不是修改 /etc/config/collectd 的,
而是修改 /etc/config/luci_statistics
config statistics 'collectd_rrdtool'
option RRARows '288'
option RRASingle '1'
option StepSize '30'
option HeartBeat '60'
list RRATimespans '1hour'
list RRATimespans '4hour'
list RRATimespans '1day'
list RRATimespans '1week'
list RRATimespans '1month'
option enable '1'
option DataDir '/home/rrd'
option CacheTimeout '30'
CacheFlush N
The entries found are written to disk.
Every N seconds the entire cache is searched for entries
which older than CacheTimeout + RandomTimeout seconds.
Default: CacheTimeout x 10
不建議設定得太大, 因為 Graph 不會 update
CacheTimeout Seconds
Writing multiple values at once reduces IO-operations
Screenshoot:
重裝
opkg remove luci-app-statistics collectd collectd-mod-*