Skip to content

Fix host user parsing on AIX#2021

Merged
shirou merged 3 commits intoshirou:masterfrom
pgimalac:pgimalac/aix-fix-hosts-user
Mar 13, 2026
Merged

Fix host user parsing on AIX#2021
shirou merged 3 commits intoshirou:masterfrom
pgimalac:pgimalac/aix-fix-hosts-user

Conversation

@pgimalac
Copy link
Copy Markdown
Contributor

@pgimalac pgimalac commented Mar 6, 2026

The output of w looks like that:

  11:46AM   up 10 days,   1:20,  1 user,  load average: 2.03, 2.14, 2.23
User     tty          login@       idle      JCPU      PCPU what
root     pts/0       11:48AM          0         0         0 w

For some reason the current version tries to ParseFloat the User and tty fields, which are strings, so it fails and doesn't fill them. The PR fixes this by assigning directly the value to the fields.

Note: the login@ column could be mapped to the Started field, but it would require parsing the value and knowing the date and timezone.

Copy link
Copy Markdown
Owner

@shirou shirou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Directly assigning the string fields makes the parsing simpler and more robust. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants