Make luci-app-statistics graphs public

according to this issue https://github.com/openwrt/luci/issues/4375

this feature was removed

You've configured luci-app-statistics to your liking and now you want to share the charts.

One way is to serve them via LuCI but without authentication:

  1. create /usr/lib/lua/luci/controller/public_stats.lua with the following content:
    module("luci.controller.public_stats", package.seeall)
    
    function index()
        assign({"graph"}, {"admin", "statistics", "graph"}, nil)
    end
  2. wipe out some caches that are now stale: rm -rf /tmp/luci-indexcache /tmp/luci-modulecache/
  3. log out from LuCI if you're still logged in
  4. add /usr/lib/lua/luci/controller/public_stats.lua to /etc/sysupgrade.conf so it survives upgrades

“Graph” will now appear in the page footer, including on the login page, so you shouldn't need a custom index.

Another way might be to use a collectd network output plugin and log the data to a more powerful remote host running something like Cacti.

(Thanks to jow for these instructions.)

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • Last modified: 2020/08/21 19:50
  • by davidea