-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
n_users field in [inputs.system]] plugin stuck at 0 on ppc64le #10003
Comments
Thanks for opening this over here. It looks like the system input plugin pulls the number of users from the gopsutil library. It looks like the value itself comes from this function. Would you be willing to run the following go code snippet to help narrow down if this is in the gopsutil library itself or with telegraf: package main
import (
"fmt"
"os"
"github.com/shirou/gopsutil/host"
)
func main() {
users, err := host.Users()
if err == nil {
fmt.Println(len(users))
} else if os.IsNotExist(err) {
fmt.Println("Reading users: ", err.Error())
} else if os.IsPermission(err) {
fmt.Println(err.Error())
}
} Thanks! |
I'm not the best with go, so let me know if I'm doing something wrong here, but this is what I get:
Running code snippet:
|
to make this a little easier I threw some debugging messages into Telegraf, and put up a fake PR to get it to build. Can you try downloading the ppc64el.tar.gz and running that with the Thanks! |
I got the following:
|
Looks like the library itself is reporting 0 users. Can you open a bug in the upstream gopsutil project and see what they say? You can reference this bug as well. Thanks! |
I got the same problem. |
Have only seen this issue in raspberry pis. Modified the script from @jdmaloney into
|
More info here. shirou/gopsutil#1129 |
The bug has just been fixed (shirou/gopsutil#1129). I guess we need to wait for next release of gopsutil which could be at the beginning of April and then for updating of the dependency here in telegraf. |
Looks like gopsutil did a release recently, I've put up #15082 with the updated dependency. Could you give the artifacts in that PR a try and let me know if it resolves the issue? Thanks! |
Relevent telegraf.conf
System info
Telegraf 1.20.2, RHEL 8.4
Docker
Not Applicable
Steps to reproduce
telegraf --config test.conf --test
...
Expected behavior
Number of user session on the node is currently 35 (2 lines are output header):
Expect that telegraf would capture that for the n_users field for example:
Actual behavior
Telegraf records the number of user sessions as 0:
Additional info
No errors are recorded in the telegraf log complaining about not being able to retrieve that field.
The text was updated successfully, but these errors were encountered: