I’m attempting to use the intel_rdt plugin, which uses the /usr/local/bin/pqos command and requires root privs, but after enabling that input plugin and running the following, I get nothing:
root@stg-19 mddut ~]# telegraf --input-filter intel_rdt --test
2021-06-21T16:10:32Z I! Starting Telegraf 1.19.0
2021-06-21T16:10:32Z I! Using config file: /etc/telegraf/telegraf.conf
So, I add the following line with visudo:
telegraf ALL=(ALL) NOPASSWD: /usr/local/bin/pqos
And then I add “use_sudo = true” in telegraf.conf for the plugin, so that the full configuration looks like this:
[[inputs.intel_rdt]]
## Optionally set sampling interval to Nx100ms.
## This value is propagated to pqos tool. Interval format is defined by pqos itself.
## If not provided or provided 0, will be set to 10 = 10x100ms = 1s.
#sampling_interval = "10"
## Optionally specify the path to pqos executable.
## If not provided, auto discovery will be performed.
pqos_path = "/usr/local/bin/pqos"
## Optionally specify if IPC and LLC_Misses metrics shouldn't be propagated.
## If not provided, default value is false.
shortened_metrics = false
## Specify the list of groups of CPU core(s) to be provided as pqos input.
## Mandatory if processes aren't set and forbidden if processes are specified.
## e.g. ["0-3", "4,5,6"] or ["1-3,4"]
cores = ["0-15"]
## Specify the list of processes for which Metrics will be collected.
## Mandatory if cores aren't set and forbidden if cores are specified.
## e.g. ["qemu", "pmd"]
use_sudo = true
But when I run a test again, I now get the following error:
[root@stg-19 mddut ~]# telegraf --input-filter intel_rdt --test
2021-06-21T16:14:59Z I! Starting Telegraf 1.19.0
2021-06-21T16:14:59Z I! Using config file: /etc/telegraf/telegraf.conf
2021-06-21T16:14:59Z E! [telegraf] Error running agent: Error loading config file /etc/telegraf/telegraf.conf: plugin inputs.intel_rdt: line 2747: configuration specified the fields ["use_sudo"], but they weren't used
How can I get this plugin working properly under the telegraf user?