Luci-stats not working (mqtt plugin)

I have already installed luci-app-statistics but clicking on statistics > graphs ends up with this

my collected config.

OpenWrt 23.05.0 r23497-6637af95aa / LuCI openwrt-23.05 branch git-23.236.53405-fc638c8

It doesn't say it's broken, it says you have to wait ?

If you go to the 'Output plugins' tab on that settings page, is RRDTool enabled?

2 Likes

current setting


Did you enable any General plugins and/or Network plugins?
What does your system log say?

2 Likes

That all looks good.

Taking @WildCarrot's suggestion, I dumped out my last rrdtool restart and here's what you should see when things are working (of course depending on what plugins you have installed and enabled).

Thu Nov 23 00:00:01 2023 daemon.err collectd[24820]: configfile: stat (/etc/collectd/conf.d/*.conf) failed: No such file or directory
Thu Nov 23 00:00:01 2023 daemon.err collectd[24820]: plugin_load: plugin "cpu" successfully loaded.
Thu Nov 23 00:00:01 2023 daemon.err collectd[24820]: plugin_load: plugin "exec" successfully loaded.
Thu Nov 23 00:00:01 2023 daemon.err collectd[24820]: plugin_load: plugin "interface" successfully loaded.
Thu Nov 23 00:00:01 2023 daemon.err collectd[24820]: plugin_load: plugin "load" successfully loaded.
Thu Nov 23 00:00:01 2023 daemon.err collectd[24820]: plugin_load: plugin "memory" successfully loaded.
Thu Nov 23 00:00:01 2023 daemon.err collectd[24820]: plugin_load: plugin "rrdtool" successfully loaded.
Thu Nov 23 00:00:01 2023 daemon.err collectd[24820]: plugin_load: plugin "thermal" successfully loaded.
Thu Nov 23 00:00:01 2023 daemon.err collectd[24820]: Initialization complete, entering read-loop.



after doing a service collectd restart
saw this in system log

Thu Nov 23 22:13:58 2023 daemon.err collectd[5102]: Parse error in file `/etc/collectd/conf.d/mqtt.conf', line 83 near `': syntax error, unexpected $end, expecting EOL
Thu Nov 23 22:13:58 2023 daemon.err collectd[5102]: yyparse returned error #1
Thu Nov 23 22:13:58 2023 daemon.err collectd[5102]: configfile: Cannot read file `/etc/collectd/conf.d/mqtt.conf'.
Thu Nov 23 22:13:58 2023 daemon.err collectd[5102]: Unable to read config file /tmp/collectd.conf.
Thu Nov 23 22:13:58 2023 daemon.err collectd[5102]: Error: Parsing the config file failed!
Thu Nov 23 22:14:00 2023 cron.err crond[1656]: USER root pid 5129 cmd arp-scan -qxdlN -I br-lan
Thu Nov 23 22:14:03 2023 daemon.err collectd[5130]: Parse error in file `/etc/collectd/conf.d/mqtt.conf', line 83 near `': syntax error, unexpected $end, expecting EOL
Thu Nov 23 22:14:03 2023 daemon.err collectd[5130]: yyparse returned error #1
Thu Nov 23 22:14:03 2023 daemon.err collectd[5130]: configfile: Cannot read file `/etc/collectd/conf.d/mqtt.conf'.
Thu Nov 23 22:14:03 2023 daemon.err collectd[5130]: Unable to read config file /tmp/collectd.conf.
Thu Nov 23 22:14:03 2023 daemon.err collectd[5130]: Error: Parsing the config file failed!

Then you should fix the errors...

Well, apparently you have installed mqtt plugin, which is not part of the LuCI statistics.
Please remove it.

1 Like


mqtt is not installed I think

I'd just rm /etc/collectd/conf.d/mqtt.conf and restart.

Thu Nov 23 22:49:32 2023 daemon.err collectd[6575]: configfile: stat (/etc/collectd/conf.d/*.conf) failed: No such file or directory
Thu Nov 23 22:49:32 2023 daemon.err collectd[6575]: plugin_load: plugin "cpu" successfully loaded.
Thu Nov 23 22:49:32 2023 daemon.err collectd[6575]: plugin_load: Could not find plugin "cpufreq" in /usr/lib/collectd
Thu Nov 23 22:49:32 2023 daemon.err collectd[6575]: plugin_load: Could not find plugin "dns" in /usr/lib/collectd
Thu Nov 23 22:49:32 2023 daemon.err collectd[6575]: There is configuration for the `dns' plugin, but the plugin isn't loaded. Please check your configuration.
Thu Nov 23 22:49:32 2023 daemon.err collectd[6575]: plugin_load: plugin "interface" successfully loaded.
Thu Nov 23 22:49:32 2023 daemon.err collectd[6575]: plugin_load: Could not find plugin "ipstatistics" in /usr/lib/collectd
Thu Nov 23 22:49:32 2023 daemon.err collectd[6575]: plugin_load: plugin "iwinfo" successfully loaded.
Thu Nov 23 22:49:32 2023 daemon.err collectd[6575]: plugin_load: plugin "load" successfully loaded.
Thu Nov 23 22:49:32 2023 daemon.err collectd[6575]: plugin_load: plugin "memory" successfully loaded.
Thu Nov 23 22:49:32 2023 daemon.err collectd[6575]: plugin_load: plugin "network" successfully loaded.
Thu Nov 23 22:49:32 2023 daemon.err collectd[6575]: plugin_load: Could not find plugin "ping" in /usr/lib/collectd
Thu Nov 23 22:49:32 2023 daemon.err collectd[6575]: There is configuration for the `ping' plugin, but the plugin isn't loaded. Please check your configuration.
Thu Nov 23 22:49:32 2023 daemon.err collectd[6575]: plugin_load: plugin "rrdtool" successfully loaded.
Thu Nov 23 22:49:32 2023 daemon.err collectd[6575]: rrdtool plugin: RRASingle = true: creating only AVERAGE RRAs
Thu Nov 23 22:49:32 2023 daemon.err collectd[6575]: plugin_load: Could not find plugin "thermal" in /usr/lib/collectd
Thu Nov 23 22:49:32 2023 daemon.err collectd[6575]: plugin_load: Could not find plugin "uptime" in /usr/lib/collectd
Thu Nov 23 22:49:32 2023 daemon.err collectd[6575]: Error: Parsing the config file failed!

Now you need to fix those errors

issue is how?

Have you considered checking the config file? It's almost as if the error messages are telling you there's a problem with it...

1 Like

Two alternatives. Load the missing collectd-mod-??? files or remove the related config section from /etc/collectd.conf. After that restart the collectd and luci app statistics, log out and in. I do this all the time when I forget to add the collectd-mod-??? files in new images.

2 Likes

yes

it was edited on this format using this guide

LoadPlugin mqtt
<Plugin "mqtt">
  <Publish "OpenWRT">
    Host "192.168.1.101" #replace this with your Home Assistant IP
    Port "1883"
    User "mqtt_openwrt" #replace this with your MQTT User
    Password "MySuperSafePW2!@" #replace this with your MQTT password
    ClientId "OpenWRT"
    Prefix "collectd"
    Retain true
  </Publish>
</Plugin>```

removed all collectd packages and reinstalled them.

collected is working, but we need to set up mqtt to connect this to Homeassistant.

this guide mentions creating a new folder create a new folder called conf.d in /etc/collectd/ but there is no folder /etc/collectd/

but there is a colletd.conf files with the following content

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

LoadPlugin cpu
<Plugin cpu>
	ValuesPercentage true
	ReportByCpu true
	ReportByState true
</Plugin>

LoadPlugin interface
<Plugin interface>
	IgnoreSelected false
	Interface "br-lan"
</Plugin>

LoadPlugin iwinfo

LoadPlugin load

LoadPlugin memory
<Plugin memory>
	ValuesPercentage false
	ValuesAbsolute true
</Plugin>

LoadPlugin rrdtool
<Plugin rrdtool>
	DataDir "/tmp/rrd"
	RRARows 288
	RRASingle true
	RRATimespan 7200
	RRATimespan 86400
	RRATimespan 604800
	RRATimespan 2678400
	RRATimespan 31622400
</Plugin>