Skip to content

plugins/filestat: probing files that don't exist results in Unable to get info for file "/does/not/exist", possible permissions issue #7315

@antifuchs

Description

@antifuchs

Relevant telegraf.conf:

[[inputs.filestat]]
  files = ["/does/not/exist"]

System info:

Telegraf 1.14.0-1 from the bionic repo https://repos.influxdata.com/ubuntu/.

Steps to reproduce:

  1. Ensure the file /does/not/exist does not exist
  2. Setup an input config with the configuration snippet above & restart telegraf

Expected behavior:

If the file doesn't exist: No log message.

If the file does exist but can't be probed (e.g. on an unreadable directory): A log message giving the actual error.

Actual behavior:

  1. In system logs: telegraf logs that it can't probe the file, but guesses incorrectly that the permissions are wrong: [inputs.filestat] Unable to get info for file "/does/not/exist", possible permissions issue
  2. The filestat measurement about the file is correctly reported with exists: 0.

Additional info:

A PR exists for this issue, at #6940: it attempts to fix this with an additional configuration flag. I think that is unnecessary & will submit another PR with a less config-heavy fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions