OpenWrt Forum Archive

Topic: Can't get LuCI Graph Statistics to work

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

Hi,

I installed all nessesary packages, configured collectd plugins, but I can't get any graphs but only "The statistics package is based onCollectd and uses RRD Tool to render diagram images from collected data."

Whats wrong?

Marek

(Last edited by Marek on 20 Sep 2008, 16:10)

Hi.

Per default only th rrdtool plugin is installed. You need to install more collectd plugins to add different graphs the statistics.

You can obtain a list of installable plugins with this commands:

opkg update
opkg list | grep collectd-mod

~ JoW

I have installed some plugins

root@OpenWrt:~# opkg list_installed |grep collectd
collectd - 4.4.3-1 -
collectd-mod-cpu - 4.4.3-1 -
collectd-mod-interface - 4.4.3-1 -
collectd-mod-network - 4.4.3-1 -
collectd-mod-ping - 4.4.3-1 -
collectd-mod-processes - 4.4.3-1 -
collectd-mod-rrdtool1 - 4.4.3-1 -

Have you already the corresponding plugin menu entries in place?
http://jo.wwsnet.net/luci-stats.png

Since OpenWrt does not enable init scripts by default when you install a package via opkg you have to enable them too:

/etc/init.d/luci_statistics enable
/etc/init.d/collectd enable

And if you don't have rebooted the device yet it would be a good idea to do that, otherwise the new menu points won't appear.

~ JoW

(Last edited by jow on 20 Sep 2008, 16:24)

Yes, I have those menu entries.

There is some progress.After executing your commands and clicking Graph entry now I can choose time window (10min/1hour/etc) but when I press 'Display timespan' nothing happens.

Okay, I need to test this locally and see what's going wrong. It's rather strange because the statistics should run ootb after installing. I'll write back once I have more info.

Maybe some outputs will help:

root@OpenWrt:~# opkg list_installed |grep rrd
collectd-mod-rrdtool1 - 4.4.3-1 -
librrd1 - 1.0.50-1 -
rrdcgi1 - 1.0.50-1 -
rrdtool1 - 1.0.50-1 -


root@OpenWrt:~# opkg list_installed |grep luci
luci-addons - 0.3-1 -
luci-admin-core - 0.9+svn3385-1 -
luci-admin-full - 0.9+svn3385-1 -
luci-admin-mini - 0.9+svn3385-1 -
luci-admin-rpc - 0.9+svn3385-1 -
luci-app-ddns - 0.9+svn3385-1 -
luci-app-firewall - 0.9+svn3385-1 -
luci-app-ntpc - 0.9+svn3385-1 -
luci-app-qos - 0.9+svn3385-1 -
luci-app-statistics - 0.8+svn3352-1 -
luci-app-upnp - 0.9+svn3385-1 -
luci-cbi - 0.9+svn3385-1 -
luci-core - 0.9+svn3385-1 -
luci-http - 0.9+svn3385-1 -
luci-i18n-english - 0.9+svn3385-1 -
luci-ipkg - 0.9+svn3385-1 -
luci-json - 0.9+svn3385-1 -
luci-sgi-cgi - 0.9+svn3385-1 -
luci-sys - 0.9+svn3385-1 -
luci-theme-openwrt - 0.9+svn3385-1 -
luci-uci - 0.9+svn3385-1 -
luci-uvl - 0.9+svn3385-1 -
luci-web - 0.9+svn3385-1 -

Hi.

The issue you observed is most likely related to a faulty rrdtool plugin. If you issue the following commands:

killall -9 collectd
collectd -C /var/etc/collectd.conf -f

... and get this error:

collectd: can't resolve symbol 'ceil'

... then the the problem is an improperly linked rrdtool plugin for collectd. I still don't fully understand when and why this occurs.

Is your buildroot a fresh checkout? Have you perhaps both enabled rrdtool and rrdtool1? This will lead to conflicts most times.


~ JoW

Jow,

I have r12633 and indeed I get 'collectd: can't resolve symbol 'ceil'' error.
I've installed only rrdtoll1 and corresponding packages ended with '1'.
What parameters are obligatory and what are correct values to properly configure RRDTool plugin for collectd?

(Last edited by Marek on 21 Sep 2008, 17:37)

I love the look of the new LuCI Interface!  Congrats to all involved.

I'm interested in getting collectd graphing traffic on my nas0 interface and in case of reboot, I'd like to log to a remote machine.
I'd use LuCI to do this, but I've grown accustomed to the CLI and would rather save FLASH space and do the graphing on my Ubuntu machine.

Can someone please advise what the base set of packages I'd need to accomplish this?

(Last edited by KillaB on 22 Sep 2008, 15:56)

You can use collectd with the network plugin to achive this. You setup collectd on your router with network plugin enabled and another collectd instance on your server. The statistics data can be sent via unicast from the router-collectd to your server-collectd.

Jow,

which release of rrdtool should I install ? rrdtool or rrdtool1?

Hi Marek.

The "rrdtool1" is the right one.
The problem is that once the other version was build, it's library (librrd.so.0.0.0) is copied to staging_dir/usr/lib. The linker always uses the wrong lib then. Remove librrd.so.0.0.0 from staging_dir/usr/lib, deselect "rrdtool" and "librrd", make collectd clean and rebuild. I'll try to find a suitable solution for this problem.

~ JoW

yesterday I installed night sneak from http://universe.freifunk-halle.net/kami … 6-atheros/
then installed statistics package for LuCI (this automatically downloaded rrdtool1 + others),
then executed:

/etc/init.d/luci_statistics enable
/etc/init.d/collectd enable
+reboot

and everything works like a charm now!

Thanks for help!

(Last edited by Marek on 23 Sep 2008, 12:35)

I added these modules:

collectd - 4.4.3-1 -
collectd-mod-cpu - 4.4.3-1 -
collectd-mod-interface - 4.4.3-1 -
collectd-mod-network - 4.4.3-1 -
collectd-mod-ping - 4.4.3-1 -
collectd-mod-processes - 4.4.3-1 -
collectd-mod-rrdtool1 - 4.4.3-1 -

And executed these commands:

/etc/init.d/luci_statistics enable
/etc/init.d/collectd enable

and rebooted--very nice graphing system, thanks for the help.

I am having hard time getting to see the graphs...
I have r13672/brcm-2.4 (lastest from snapshots) running on my ASUS WL-500W
I do see the .rrd files being created in /tmp/HOSTNAME folder for enabled plug-ins but when I click on the Luci graph for the same plugin I do not see the .png (image) and I don't see any files under /tmp/rrdimg/HOSTNAME folder (I see folders for plugins too but no .png files)

I do have rrdtool1 installed from snapshot.

Not sure where the issue is...any help is appreciated.

Thanks

Hi.

This command is executed by LuCI to generate the image for wireless signal quality:

rrdtool graph '/tmp/rrdimg/uplink/wireless-wl0/2.3600.png' '-a' PNG '-s' 'NOW-3600' '-w' 600 '-t' 'uplink: Wireless - Signal Quality' '-v' n 'DEF:1signal_quality_avg=/tmp/uplink/wireless-wl0/signal_quality.rrd:value:AVERAGE' 'CDEF:1signal_quality_nnl=1signal_quality_avg,UN,0,1signal_quality_avg,IF' 'CDEF:1signal_quality_stk=1signal_quality_nnl' 'LINE1:1signal_quality_stk#0000ff:Signal Quality' 'GPRINT:1signal_quality_avg:AVERAGE:%6.1lf Avg' 'GPRINT:1signal_quality_avg:LAST:%6.1lf Last\l'

Can you execute this on the shell and tell me what happens?

Edit:
Make sure to replace "uplink" with your hostname.

~ JoW

(Last edited by jow on 6 Jan 2009, 19:51)

Hi Jow,

I ran that and got back "691x172" and then I do see a PNG file on in rrdimg folder and able to see that thru LuCI (only bottom image)!

Here is the content of /etc/collectd.conf

BaseDir "/var/run/collectd"
Include "/etc/collectd/conf.d"
PIDFile "/var/run/collectd.pid"
PluginDir "/usr/lib/collectd"
TypesDB "/usr/lib/collectd/types.db"
Interval 30
ReadThreads 2

...plugin info...

LoadPlugin rrdtool
<Plugin rrdtool>
    DataDir "/tmp"
    RRARows 100
    RRASingle true
    RRATimespan 600
    RRATimespan 3600
    RRATimespan 86400
    RRATimespan 604800
    RRATimespan 2678400
    RRATimespan 31622400
</Plugin>

....other plugin info...

I am quite not sure if the datadir in rrdtool & BaseDir in collectd needs to be same etc., and how the .rrd files are generated in /tmp/HOSTNAME/ folder. Also, not sure if I have to add HOSTNAME related stuff in collectd.conf. And FYI, I see total of 8 collectd processes thru ps -ef - not how it relates with readthreads!

Thanks again for the help.

Okay, so the image generation works. Could it be that you changed the hostname but have not rebooted the device since then?

Yes. Image creation is good...how to know what LuCI is issuing to create the image on my router?
Nope, I haven't changed it recently and for sure have rebooted the initial hostname change...
Not sure if it matters but I am booting from USB stick
I do not see enable for any of the init.d scripts...probably because of 2.4 kernel? I do use LuCI initscripts to disable/enable packages.

jow wrote:

Okay, so the image generation works. Could it be that you changed the hostname but have not rebooted the device since then?

You need to modify the source code a bit...
- edit /usr/lib/lua/luci/statistics/rrdtool.lua
- search for "local rrdtool = io.popen( cmdline )"
- add this before:

local fd = io.open("/tmp/debug", "w")
fd:write(cmdline)
fd:close()

Save and close the file.
Now the used command line is written to /tmp/debug everytime you access a statistics page.

I did that and here is what I got...similar to your example...

rrdtool graph '/tmp/rrdimg/BEAR/wireless-wl0/2.600.png' '-a' PNG '-s' 'NOW-600' '-w' 400 '-t' 'BEAR: Wireless - Signal Quality' '-v' n 'DEF:1signal_quality_avg=/tmp/BEAR/wireless-wl0/signal_quality.rrd:value:AVERAGE' 'CDEF:1signal_quality_nnl=1signal_quality_avg,UN,0,1signal_quality_avg,IF' 'CDEF:1signal_quality_stk=1signal_quality_nnl' 'LINE1:1signal_quality_stk#0000ff:Signal Quality' 'GPRINT:1signal_quality_avg:AVERAGE: Avg\: %6.1lf' 'GPRINT:1signal_quality_avg:LAST:      Last\: %6.1lf\l'

But still I can't get the file generated. If I take the same command and run thru SSH (Putty) with root user, I can get the .png generated. Does it have anything to do with permissions? I do see the /tmp/debug generated as nobody/nogroup

Yes, rrdtool should be executable by nobody and the target directory for the images should be writeable.

I do not see any issues with permissions

root@BEAR:/tmp/rrdimg/BEAR# ls -l
drwxr-xr-x    2 nobody   nogroup        40 Jan  6 19:48 wireless-wl0
root@BEAR:/# find / -name rrdtool
/usr/bin/rrdtool
/usr/lib/lua/luci/statistics/rrdtool
root@BEAR:/# ls -l /usr/bin/rrdtool
-rwxr-xr-x    1 root     root        14335 Dec 17 19:24 /usr/bin/rrdtool

I tried with changing permissions on rrdtool with 777 with noluck!

What should I do/check next?

EDIT:
I checked read permissions for .rrd files and seems to be OK

root@BEAR:/# ls -l /tmp/BEAR/wireless-wl0/
-rw-r--r--    1 root     root         6540 Jan  6 19:59 signal_noise.rrd
-rw-r--r--    1 root     root         6540 Jan  6 19:59 signal_power.rrd
-rw-r--r--    1 root     root         6540 Jan  6 19:59 signal_quality.rrd

(Last edited by premi on 7 Jan 2009, 02:00)