OpenWrt Forum Archive

Topic: Collectd and Luci-app-statistics

The content of this topic has been archived on 19 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi All!

I've configured the statistics section following this guide:
h-t-t-p-s://wiki.openwrt.org/doc/howto/luci_app_statistics

I've enabled the collection of data in the Statistics-->Setup section for several plugins, but now if I go to the Statistics --> Graphics section in Luci, I just see 2 tabs : Interfaces and System Load ( which were the 2 that were already enabled in the firmware image I've installed ).

Tip: I just have 2 directories under : /tmp/rrd/RouterName ... those are "load" and 'interface-br-lan'...

Any ideas on how to enable seeing the rest?

Also, I have added a thumbdrive to my router ( Linksys 1900ACS v2 ) to move the collection files and tmp into it... can anyone send me a link on how to configure moving the collectd files into the thumbdrive so i don't wear out the router flash memory? I'm not an expert in Linux so I don't even know which is the mnt point nor the DEV for the usbdrive ... so really detailed instructions will help smile

Thanks in advance!

Regards,
Mariano

* Make sure that you have installed the collectd-mod-XXX plugins for each of the stats you want
* by default the stats are stored in the router RAM, so there is no flashwear (but stats get cleared at every reboot)

If you have edited settings in LuCI, the stats config should get updated automaticallt, but if you have edited stat config manually, you need to restart the luci_statistics service or reboot he device

If you do from console "/etc/init.d/luci_statistics restart", do you get errors in console or in system log?

Which exact build you are running? Openwrt 15.05.1? Openwrt master? LEDE master (with kernel 4.9?) LEDE 17.01?  (I am asking because I found a bug in ubifs+overlayfs in kernel 4.9, and your symptoms might be due to that if you use LEDE master or a private build with kernel 4.9 or above.)

(Last edited by hnyman on 8 Mar 2017, 14:57)

WOW!! That was a QUICK response! I really appreciate it!

Responding to your questions, yes, i have all of the collectd-mod-xxx plugins. I've edited the settings in LuCI, but I get the errors that I've described anyway... I'm using LuCI for-15.05 branch (git-16.206.66468-6f5c466) / OpenWrt Chaos Calmer 15.05.1 r49389 .

I tried what you suggested, and is giving an error when restarting the service:

root@RouterACS:~# /etc/init.d/luci_statistics restart
mv: can't rename '/etc/collectd.conf': Invalid argument
ln: /etc/collectd.conf: File exists
configfile: stat (/etc/collectd/conf.d) failed: No such file or directory
rrdtool plugin: RRASingle = true: creating only AVERAGE RRAs
root@RouterACS:~#

And I would like to still move the logs to the USB so not to loose the history when i reboot the router... any guides to do so Sir?

mariano.silva wrote:

mv: can't rename '/etc/collectd.conf': Invalid argument
ln: /etc/collectd.conf: File exists

That sounds exactly as the ubifs rename bug.the file can't be renamed, so the creation of the symlink fails on the next line. In some conditions the wrt1900ac series router (and other ubifs users) fails to rename/move files that are both on flashed firmware and on "overlay".

You might try this: first delete the file failing to rename, so that luci_statistics restart can re-create the file.

rm /etc/collectd.conf
/etc/init.d/luci_statistics restart

You should be able to move the datadir in Luci stats settings. And note the the datadir and its parents need to be "world-readable", chmod 744 or so.

GREAT!! ALL of the graphs are working now! I've deleted the file, and the restart just recreates it the same way ( not sure where it's pulling all the config from ... the file that's recreated contains all of my configuration i.e. the sites to ping for the ping plugin, etc)

This is what's the restart output looks like:

root@RouterACS:/etc/config# /etc/init.d/luci_statistics restart
configfile: stat (/etc/collectd/conf.d) failed: No such file or directory
rrdtool plugin: RRASingle = true: creating only AVERAGE RRAs

You're great ,thanks a lot!

Now to move the datadir ... can you guide me through the process? "move the datadir in Luci stats settings. And note the the datadir and its parents need to be "world-readable", chmod 744 or so." is almost like Japanese to me sad

I currently have the datadir ( I think ) in /tmp/rrd/RouterACS ... but I see no options to change that in the Luci interface... also I wouldn't know where to put it (I've formatted the USB drive and created the filesystem following another guide already , but I don't have it mounted as I don't know which device it is ... )

Regards,
Mariano

mariano.silva wrote:

I currently have the datadir ( I think ) in /tmp/rrd/RouterACS ... but I see no options to change that in the Luci interface...

Statistics / Setup / output plugins / RRDtool / storage directory

Regarding the usb mount, you need to read wiki about that. There is good advice for that.

It worked great! Thanks a lot!

I've been collecting these metrics for a few months now - and it seems they get progressively more inaccurate - the longer the timespan collected. e.g. looking at 1 month  - I've downloaded 350Gb in total - but looking at 1 year - (across 2 months) - I've only downloaded 88Gb. Why are the number so inaccurate? How can I make them more accurate?

The discussion might have continued from here.