-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot get smart
plugin to work with passwordless sudo
#8690
Comments
smart
plugin to work with sudo
smart
plugin to work with passwordless sudo
@courtarro can you try with Telegraf 1.17.0? |
@p-zak I just upgraded via the InfluxDB PPA to 1.17.0 and the result is the same, unfortunately. |
For comparison, here's what it looks like when I test from the command line:
|
I have tried to reproduce this behaviour and here is what I got: System info: Ubuntu 18.04 (bionic), bare-metal
As you can see, I have no such problem with permission. Could you take the same steps and write your inputs and outputs? |
@courtarro Did you have time to check this? |
@p-zak Okay, I finally nailed this down. It's an estoteric issue related to a change made per the
If I understand correctly, this suggestion is not ideal. Because Instead, I changed the override file for ping to:
This enables the ping input plugin to do its job, while not limiting the |
for further readers: there are other limits as well, that can mess around with your config. in my case it was the |
I'm now having this problem with the sudo error. Was setting DynamicUser=no the solution for you? |
yes, indeed it was. i did not notice, that DynamicUser and NoNewPrivileges are excluding each other. However, if you don't have explicitly enabled DynamicUser, this most likely won't apply to you. |
Okay thanks. |
I'm unable to get the
smart
plugin to work with a locally-built and installed version ofsmartmontools
usingsudo
. Mytelegraf
runs as its own user (telegraf
), and I've got asudoers
clause set up to enable passwordless execution of/usr/local/sbin/smartctl
by Telegraf, yet I get an error.The log entries are visible below. I think the key message is "sudo: unable to change to root gid: Operation not permitted". I don't understand what this means or why it's appearing. When I manually run
sudo -u telegraf
to impersonate Telegraf, I'm able to runsudo -n /usr/local/sbin/smartctl --scan
just fine, no password needed. Any idea what might be wrong with my configuration?Relevant
telegraf.conf
:Relevant
sudoers
entries:System info:
Running Telegraf version
1.13.0-1
for Ubuntu Bionic (18.04)Expected behavior:
Telegraf runs
smartctl
and gathers the relevant metrics.Actual behavior:
Telegraf fails and the following log entries appear in its
systemd
log:The text was updated successfully, but these errors were encountered: