shirou / gopsutil

psutil for golang
Other
10.28k stars 1.56k forks source link

AIX Uptime parsing fails, returns error #1658

Closed aidangill-projects closed 1 month ago

aidangill-projects commented 1 month ago

Describe the bug

When using AIX, the uptime parser fails on the output:

10:16PM up 1 day, 21:30, 1 user, load average: 1.91, 1.98, 2.00

With an error of:

Uptime was not set, so cannot calculate boot time from it.

To Reproduce

Any date of 1 day will reproduce the error, due to the string parser expecting "days, ", as a result nothing is returned.

Expected behavior

Calculates correctly.

Environment (please complete the following information):

AIX 7.3

aidangill-projects commented 1 month ago

I will post a pull request for this as the fix is very simple

aidangill-projects commented 1 month ago

Resolved with pull request

https://github.com/shirou/gopsutil/pull/1659