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

[[inputs.systemd_units]] scope="user" should support explicitly setting users other than telegraf #16047

Closed
daniel-trnk opened this issue Oct 20, 2024 · 2 comments
Assignees
Labels
feature request Requests for new plugin and for new features to existing plugins waiting for response waiting for response from contributor

Comments

@daniel-trnk
Copy link

Use Case

Collect systemd unit metrics for systemd units run with a user scope by users other than the telegraf user.

Since #15458, [[inputs.systemd_units]] allows gathering metrics on systemd units run with a user scope in addition to the default system scope. However, it does not allow explicitly setting a user and instead takes the telegraf user.

In most cases, however, relevant services that need to me observed are not run as the telegraf user, but as other users on the system.

Expected behavior

Allow a config like

 scope = "user"
 user = "prod"

Set the user for the systemd user scope unit metrics collection to that user instead of the telegraf user.

Actual behavior

User is set to the current telegraf user.

Additional info

No response

@daniel-trnk daniel-trnk added the feature request Requests for new plugin and for new features to existing plugins label Oct 20, 2024
@srebhan
Copy link
Member

srebhan commented Oct 24, 2024

@daniel-trnk this is not possible I think even with the systemctl command as root as you are connecting to the user service manager and this is per logged in user... So the only possibility to do this with systemctl is to execute the command as the user you want to query and therefore the same applies to Telegraf.

@srebhan srebhan added the waiting for response waiting for response from contributor label Oct 24, 2024
@srebhan srebhan self-assigned this Oct 24, 2024
@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented Nov 7, 2024

Hello! I am closing this issue due to inactivity. I hope you were able to resolve your problem, if not please try posting this question in our Community Slack or Community Forums or provide additional details in this issue and reqeust that it be re-opened. Thank you!

@telegraf-tiger telegraf-tiger bot closed this as completed Nov 7, 2024
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 waiting for response waiting for response from contributor
Projects
None yet
Development

No branches or pull requests

2 participants