Skip to content

fix(inputs.procstat): Resolve remote usernames on Posix systems #16986

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

srebhan
Copy link
Member

@srebhan srebhan commented May 12, 2025

Summary

The underlying gopsutil package relies on the Golang os/user package to resolve the process owner on posix systems. However, Golang parses the local user database only, rendering remote users (e.g. LDAP or NIS) unresolvable.
This PR detects the "unresolved UID" case and tries to execute the id command for the UID which takes all user-databases into account.

Note

The id command must be available on the system, in the PATH and executable by Telegraf!

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #16663

@telegraf-tiger telegraf-tiger bot added area/procstat fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels May 12, 2025
@srebhan srebhan self-assigned this May 13, 2025
@srebhan srebhan force-pushed the procstat_ear_6048 branch from b150221 to 567797e Compare May 15, 2025 11:05
@srebhan srebhan force-pushed the procstat_ear_6048 branch from 567797e to 7db8d9b Compare May 28, 2025 10:31
@telegraf-tiger
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/procstat fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

procstat on Linux does not report remote users
1 participant