Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
OpenWrt LuCI Statistics additions
opkg install collectd-mod-conntrack collectd-mod-cpu collectd-mod-df collectd-mod-disk collectd-mod-dns collectd-mod-irq collectd-mod-memory collectd-mod-ping collectd-mod-processes collectd-mod-syslog collectd-mod-tcpconns collectd-mod-uptime
mkdir -p /etc/collectd/conf.d
#Make the stats permanent
uci set luci_statistics.collectd_rrdtool.DataDir=/etc/collectd
uci set luci_statistics.collectd_ping.enable=1
uci set luci_statistics.collectd_ping.Hosts=www.google.com
uci set luci_statistics.collectd_df.enable=1
uci set luci_statistics.collectd_df.Devices=/dev/mmcblk0p1
uci set luci_statistics.collectd_df.MountPoints=/data
uci set luci_statistics.collectd_df.FSTypes=ext4
uci set luci_statistics.collectd_disk.enable=1
uci set luci_statistics.collectd_disk.Disks=mmcblk0
uci set luci_statistics.collectd_dns.enable=1
uci set luci_statistics.collectd_dns.Interfaces=any
uci set luci_statistics.collectd_interface.Interfaces="eth2 wlan0 br-lan"
uci set luci_statistics.collectd_iptables.enable=0
uci set luci_statistics.collectd_irq.enable=1
uci set luci_statistics.collectd_irq.Irqs="19 24 28"
uci set luci_statistics.collectd_processes.Processes="lighttpd collectd transmission-daemon ucollect unbound"
uci set luci_statistics.collectd_tcpconns.LocalPorts="2222 443 80"
uci set luci_statistics.collectd_olsrd.enable=0
uci set luci_statistics.collectd_rrdtool.CacheTimeout=120
uci set luci_statistics.collectd_rrdtool.CacheFlush=900
#Use syslog for logging
cat > /etc/collectd/conf.d/my_collectd.conf << EOF
LoadPlugin syslog
<Plugin syslog>
LogLevel "info"
</Plugin>
EOF
#Fix some graphing issues
chmod 644 /etc/config/luci_statistics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.