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

filecount input: support following symbolic links #6734

Closed
LINKIWI opened this issue Dec 1, 2019 · 0 comments · Fixed by #6735
Closed

filecount input: support following symbolic links #6734

LINKIWI opened this issue Dec 1, 2019 · 0 comments · Fixed by #6735
Labels
feature request Requests for new plugin and for new features to existing plugins
Milestone

Comments

@LINKIWI
Copy link
Contributor

LINKIWI commented Dec 1, 2019

Relevant telegraf.conf:

Default config as shown in https://github.com/influxdata/telegraf/blob/master/plugins/inputs/filecount/README.md#configuration

Steps to reproduce:

Set the directory parameter to a symbolic link that links to a directory, and run Telegraf.

Expected behavior:

File counts and sizes are reported for the directory.

Actual behavior:

Dec 01 14:03:20 SOLARA telegraf[20595]: 2019-12-01T22:03:20Z E! [inputs.filecount] Error in plugin: cannot Walk non-directory: /path/to/a/symlink/that/resolves/to/a/directory

Additional info:

The filecount input depends on karrick/godirwalk, which exposes an option to follow symbolic links:

https://github.com/karrick/godirwalk/blob/master/walk.go#L35

It doesn't seem to be enabled currently:

https://github.com/influxdata/telegraf/blob/master/plugins/inputs/filecount/filecount.go#L207

I'm happy to submit a PR to address this. I'm thinking it would be best to add a new plugin config option, follow_symlinks, so to not introduce any breaking changes.

(I haven't actually tried this yet, but from a quick grok of the code, this seems like the only change needed to support symlinks.)

@danielnelson danielnelson added this to the 1.13.0 milestone Dec 2, 2019
@danielnelson danielnelson added the feature request Requests for new plugin and for new features to existing plugins label Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requests for new plugin and for new features to existing plugins
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants