Skip to content
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

PowerDNS-Recursor malformed TOML #6564

Closed
zimmertr opened this issue Oct 22, 2019 · 1 comment · Fixed by #6572
Closed

PowerDNS-Recursor malformed TOML #6564

zimmertr opened this issue Oct 22, 2019 · 1 comment · Fixed by #6572
Assignees
Labels
bug unexpected problem or unintended behavior
Milestone

Comments

@zimmertr
Copy link

zimmertr commented Oct 22, 2019

I'm having two issues with the PowerDNS Inputs.

Issue #1

Summary:

the pdns_recusor input is not able to start up. The socket_mode declarative expects an integer value to indicate the permissions mode of the control socket. Furthermore, the documentation indicates that the integer should be encapsulated in double quotes. telegraf will not start up with either configuration.

System info:

  • Telegraf Version: Telegraf 1.12.3 (git: HEAD 16784bc)
  • Operating System: Arch Linux ARM - Fully Updated
  • PowerDNS-Recursor Version: 4.2.0

Steps to reproduce:

  1. Configure Input like so:
[[inputs.powerdns_recursor]]
  unix_sockets = ["/var/run/pdns_recursor.controlsocket"]
  socket_dir = "/var/run/pdns/"
  socket_mode = 0666
  1. Receive STDERR:
$> telegraf -config /etc/telegraf/telegraf.conf
2019-10-22T19:13:40Z I! Starting Telegraf 1.12.3
2019-10-22T19:13:40Z E! [telegraf] Error running agent: Error parsing /etc/telegraf/telegraf.conf, line 35: invalid TOML syntax
  1. Configure input like so:
[[inputs.powerdns_recursor]]
  unix_sockets = ["/var/run/pdns_recursor.controlsocket"]
  socket_dir = "/var/run/pdns/"
  socket_mode = "0666"
  1. Receive STDERR:
$> telegraf -config /etc/telegraf/telegraf.conf
2019-10-22T19:14:38Z I! Starting Telegraf 1.12.3
2019-10-22T19:14:38Z E! [telegraf] Error running agent: Error parsing /etc/telegraf/telegraf.conf, line 34: (powerdns_recursor.PowerdnsRecursor.SocketMode) cannot unmarshal TOML string into uint32

Expected behavior:

  • powerdns_recursor should Start up without using strings to wrap around the integer.
  • Documentation here should not depict integer as a string.

Issue #2

Summary:

the pdns input is starts up successfully. However, fails to scrape any data due to permission being denied. The documentation does not indicate it is necessary to create a telegraf user like the pdns_recursor input does. However, if it were necessary for those declaratives to be set, the documentation does not indicate they exist.

System info:

  • Telegraf Version: Telegraf 1.12.3 (git: HEAD 16784bc)
  • Operating System: Arch Linux ARM - Fully Updated
  • PowerDNS-Recursor Version: 4.2.0

Steps to reproduce:

  1. Configure Input like so:
[[inputs.powerdns]]
  1. Receive STDERR:
$> telegraf -config /etc/telegraf/telegraf.conf
2019-10-22T19:31:43Z I! Starting Telegraf 1.12.3
2019-10-22T19:31:43Z W! Telegraf is not permitted to read /etc/telegraf/telegraf.d
2019-10-22T19:31:43Z I! Loaded inputs: internal interrupts iptables powerdns mem system linux_sysctl_fs nstat temp net cpu docker sensors kernel kernel_vmstat processes swap netstat disk
2019-10-22T19:31:43Z I! Loaded aggregators: basicstats final
2019-10-22T19:31:43Z I! Loaded processors:
2019-10-22T19:31:43Z I! Loaded outputs: influxdb
2019-10-22T19:31:43Z I! Tags enabled: host=sputnik
2019-10-22T19:31:43Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"sputnik", Flush Interval:30s
2019-10-22T19:31:50Z E! [inputs.powerdns] Error in plugin: dial unix /var/run/pdns.controlsocket: connect: permission denied

Expected behavior:

  • powerdns should start scraping metrics from the control socket without adding any additional permissions. If it does, the documentation here should be updated to reflect those declaratives.
@danielnelson danielnelson added the bug unexpected problem or unintended behavior label Oct 22, 2019
@danielnelson
Copy link
Contributor

Thanks for opening a bug report, I'll split my answer into separate parts:

  1. I'd like to fix this by requiring an octal string and fixing the internal type conversion. The TOML spec does appear to support octal literals, via 0o666 but they do not seem to be accepted by our current parser. I believe if you use the integer workaround you will need to mind the decimal to octal conversion in order to get the correct values. (0666 == 438).
  2. Can you help me determine the right instructions? On a Debian based system it appears that adding the telegraf user to the pdns group would be sufficient:
    usermod telegraf -a -G pdns
    
    Could you try that and let me know if it works on your system as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants