influxdata / influxdata/telegraf

[inputs.procstat] Filter user NIS

Open
#17,614 5 comments 0 reactions 1 assignee Claimed by @srebhan View on GitHub
bug
Dominant language
Go
Stars
17.8k
Forks
5.8k
Avg merge
1d 20h
Merged PRs (30d)
161

Description

### Relevant telegraf.conf

```toml
[[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

```text
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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.