Collectd dns plugin issue


Is the collectd dns plugin working for you guys? never worked for me. always stuck here.

Barebones configuration works here.

Post return of uci show luci_statistics | grep luci_statistics.collectd_dns.

root@router:~# uci show luci_statistics | grep luci_statistics.collectd_dns
luci_statistics.collectd_dns=statistics
luci_statistics.collectd_dns.enable='1'
luci_statistics.collectd_dns.Interfaces='br-lan'
luci_statistics.collectd_dns.IgnoreSources='127.0.0.1'

LGTM. Provide some details please: ubus call system board

Do you see any syslog anomalies? logread -e collectd

root@router:~# ubus call system board
{
	"kernel": "6.6.68",
	"hostname": "router",
	"system": "ARMv7 Processor rev 5 (v7l)",
	"model": "AVM FRITZ!Box 7530",
	"board_name": "avm,fritzbox-7530",
	"rootfs_type": "squashfs",
	"release": {
		"distribution": "OpenWrt",
		"version": "SNAPSHOT",
		"revision": "r28478-f0df6e3a4a",
		"target": "ipq40xx/generic",
		"description": "OpenWrt SNAPSHOT r28478-f0df6e3a4a",
		"builddate": "1735823339"
	}
}

collectd.err.log has nothing about dns. oh, and there is data available..

root@router:/mnt/router/usb/collectd/rrd/router/dns# ls
dns_octets.rrd          dns_opcode-Query.rrd    dns_qtype-#65.rrd       dns_qtype-DNSKEY.rrd    dns_qtype-NAPTR.rrd     dns_qtype-SOA.rrd       dns_qtype-WKS.rrd       dns_rcode-RCode0.rrd
dns_opcode-Iquery.rrd   dns_opcode-Status.rrd   dns_qtype-A.rrd         dns_qtype-DS.rrd        dns_qtype-NS.rrd        dns_qtype-SRV.rrd       dns_rcode-FORMERR.rrd   dns_rcode-REFUSED.rrd
dns_opcode-Opcode6.rrd  dns_qtype-#0.rrd        dns_qtype-AAAA.rrd      dns_qtype-HINFO.rrd     dns_qtype-NULL.rrd      dns_qtype-TXT.rrd       dns_rcode-NOTIMPL.rrd   dns_rcode-SERVFAIL.rrd
dns_opcode-Opcode7.rrd  dns_qtype-#64.rrd       dns_qtype-CNAME.rrd     dns_qtype-MX.rrd        dns_qtype-PTR.rrd       dns_qtype-URI.rrd       dns_rcode-NXDOMAIN.rrd  dns_rcode-YXDOMAIN.rrd

even deleted the data if there is any corruption. collectd created new data, but the GUI still can't read.

Do you really need to run on snapshot? Try on 23.05.5 if possible.

The fact that collectd isn’t crashing and rrd data for the DNS Plug-in is producing data leads me to suspect one of the DNS Resource Records data, query types, response codes, or opcode types being produced from one of your bridged interfaces could be buggy.

It would be interesting to see if just collecting collectd DNS data from each single interface in turn that encompasses your bridged interfaces instead of the totality of the br-lan bridged interfaces on your devices would produce visible graph data.

It has never worked ok in the openwrt context.
Even if you manage to configure it right, it will likely crash.
There is likely a threading race inside collected core - DNS plugin - pcap - something, which causes a crash.
(and as there is currently no real upstream development of collectd, the problem will not disappear)

See

I debugged it extensively in

Also with the current collected 5.12

And here the same recent in our packages repo issues:

1 Like

Yes! That was my inference as well. If I added the DNS plugin, most times the collectd instance would start up fine, and other times the whole collectd instance would crash after going into the read loop with no changes to any plugins. I also noted that almost without fail the DNS data would stop recording if I modded any other plugin after save/apply but all others continued to run without crashing the collectd instance. I got into the habit of checking syslog for collectd instance crash on boot and, invariably stopping/starting collectd/luci-statistics would right the collection of statistics.

Unfortunately I never saw your debug analysis. It was well before I started using OpenWrt.

Given that DNS stats are really non-essential in the scheme of things, maybe the DNS plugin should be removed from the repo?