Skip to content

[inputs.procstat] Filter user NIS #17614

@tguenneguez

Description

@tguenneguez

Relevant telegraf.conf

[[inputs.procstat]]
  pid_finder = "native"
  [[inputs.procstat.filter]]
    name = "NAMENODE"
    process_names = ["java"]
    patterns = ["org\\.apache\\.hadoop\\.hdfs\\.server\\.namenode\\.NameNode"]
    users = ["hdfs"]

Logs from Telegraf

RAS

System info

Telegraf 1.36, Red Hat Enterprise Linux Server release 7.6 (Maipo)

Docker

No response

Steps to reproduce

  1. start processus with non local user
  2. try to find by username with telegraf running as non root

Expected behavior

Process not found

Actual behavior

Process should be found

Additional info

Because of the use of the "id" command, which must be run by root, searching by NIS user when Telegraf is not running as root doesn't work.
https://github.com/influxdata/telegraf/blob/master/plugins/inputs/procstat/os_linux.go#L46
I'm not a Go expert, but it would be interesting to see if a Golang primitive allows the equivalent of the "id -nu " command?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugunexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions