Unbound DNS data not showing up in Influxdb

I’m using telegraf to send data from host-1 over to influxdb on host-2.

Apart from the usual suspects (cpu, mem, network, etc.), I am also sending data from the unbound DNS server. Data for all other services is showing up fine on influxdb except the data for unbound. When I run “telegraf --test | grep -i unbound” I see that there is unbound related data being captured by telegraf on host-1 but none of this data is showing up on influxdb. I expected that the data will manifest itself on host-2 in a measurement called “unbound” but there’s no such thing there.

A bit stumped here as I don’t know the internals of telegraf and the logs are not telling me anything useful. Can someone provide a helpful suggestion on how to troubleshoot this?

The next step after --test is usually to add a file output. The data being printed by the file output ought to be very similar to the output of --test but it will also pass through the processors, aggregators, and outputs giving you a more end-to-end check.

Since unbound runs the command unbound-control, a likely culprit is a change in user permissions between the service, which usually runs as a telegraf user, versus --test which is usually run as a user account or as root.

[SOLVED]

That was very helpful, thank you for the hint. When I output to a file and review the data, there’s nothing related to unbound in there. So indeed a permissions issue.

I added telegraf to the sudo file but with only permission to run the unbound-control command:
telegraf ALL=(ALL) NOPASSWD: /usr/sbin/unbound-control

Now, unbound data shows up as expected!

> show measurements
name: measurements
name
----
cpu
disk
diskio
kernel
mem
net
processes
swap
system
unbound
1 Like