Skip to content

Instantly share code, notes, and snippets.

  • Select an option

Select an option

Revisions

  1. @ruzickap ruzickap revised this gist Apr 16, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions openwrt_luci_statistics.sh
    Original file line number Diff line number Diff line change
    @@ -6,11 +6,11 @@ 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/sda1
    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=sda
    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"
  2. @ruzickap ruzickap revised this gist Apr 14, 2014. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion openwrt_luci_statistics.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,7 @@
    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
    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
    @@ -22,11 +23,13 @@ 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
  3. @ruzickap ruzickap revised this gist Apr 14, 2014. 1 changed file with 1 addition and 6 deletions.
    7 changes: 1 addition & 6 deletions openwrt_luci_statistics.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    opkg install collectd-mod-conntrack collectd-mod-cpu collectd-mod-df collectd-mod-disk collectd-mod-dns collectd-mod-exec *collectd-mod-irq collectd-mod-memory *collectd-mod-ping collectd-mod-processes collectd-mod-syslog collectd-mod-tcpconns collectd-mod-uptime
    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
    uci set luci_statistics.collectd_rrdtool.DataDir=/etc/collectd
    @@ -22,11 +22,6 @@ uci set luci_statistics.collectd_olsrd.enable=0
    uci set luci_statistics.collectd_rrdtool.CacheTimeout=120
    uci set luci_statistics.collectd_rrdtool.CacheFlush=900

    uci set luci_statistics.collectd_exec.enable=1
    uci commit
    uci add luci_statistics collectd_exec_input
    uci set luci_statistics.@collectd_exec_input[-1].cmdline="/etc/digitemp.script"

    cat > /etc/collectd/conf.d/my_collectd.conf << EOF
    LoadPlugin syslog
    <Plugin syslog>
  4. @ruzickap ruzickap created this gist Apr 6, 2014.
    37 changes: 37 additions & 0 deletions openwrt_luci_statistics.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,37 @@
    opkg install collectd-mod-conntrack collectd-mod-cpu collectd-mod-df collectd-mod-disk collectd-mod-dns collectd-mod-exec *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
    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/sda1
    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=sda
    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

    uci set luci_statistics.collectd_exec.enable=1
    uci commit
    uci add luci_statistics collectd_exec_input
    uci set luci_statistics.@collectd_exec_input[-1].cmdline="/etc/digitemp.script"

    cat > /etc/collectd/conf.d/my_collectd.conf << EOF
    LoadPlugin syslog
    <Plugin syslog>
    LogLevel "info"
    </Plugin>
    EOF

    chmod 644 /etc/config/luci_statistics