Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions thorlog/v3/hostinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,27 @@ func NewWindowsPlatformInfo() *PlatformInfoWindows {
},
}
}

type PlatformInfoAIX struct {
jsonlog.ObjectHeader

Name string `json:"name" textlog:"name"`
KernelName string `json:"kernel_name" textlog:"kernel_name"`
KernelVersion string `json:"kernel_version" textlog:"kernel_version"`
Proc string `json:"proc" textlog:"proc"`
Arch string `json:"arch" textlog:"arch"`
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This not match necessarily match useful information for an AIX system. And we need ensure that the information is gathered correctly: first, we need to use the native binary /usr/bin/uname (and not the GNU version possibly in /opt/freeware/bin/uname) and second, use the appropriate flags (/usr/bin/uname -r displays the release number of the OS which happens to be reported as the minor version of the system (3 in 7.3) but this is insufficient without the operating system version that you get with -v).

Compare this output for reference:

# for flag in {a..z} {A..Z}; do out=$(/usr/bin/uname -$flag 2>/dev/null); if [[ -n "$out" ]]; then echo "uname -$flag: $out"; man uname | grep -A 1 "^ *-$flag\$"; fi; done
uname -a: AIX testgobuild 3 7 00C63DC04B00
       -a
            Displays all information specified with the -m, -n, -r, -s, and -v flags. Cannot be used
uname -f: 800009C2C4000021
       -f
            Similar to the F flag, except that the partition number is also used in the calculation of
uname -l: 3325935691
       -l
            Displays the LAN network number.
uname -m: 00C63DC04B00
       -m
            Displays the machine ID number of the hardware running the system. Note: The -m flag cannot
uname -n: testgobuild
       -n

uname -p: powerpc
       -p
            Displays the architecture of the system processor.
uname -r: 3
       -r
            Displays the release number of the operating system.
uname -s: AIX
       -s
            Displays the system name. This flag is on by default. The -s option is mutually exclusive
uname -u: IBM,067863DC0
       -u
            Displays the system ID number. If this attribute is not defined, the output is the same as
uname -v: 7
       -v
            Displays the operating system version.
uname -x: AIX testgobuild 3325935691 3 7 00C63DC04B00
       -x
            Displays the information specified with the  -a flag as well as the LAN network number, as
uname -B: AIX
uname -F: 800009C2C4000000
       -F
            Displays a system identification string comprised of hexadecimal characters. This
uname -L: 33 TestGoBuild-371a10ab-00023336
       -L
            Displays LPAR number and LPAR name. If LPAR does not exist, -1 is displayed for LPAR number
uname -M: IBM,9009-22A
       -M
            Displays the system model name. If the model name attribute does not exist, a null string is
uname -V: AIX 7.3
       -V
            Displays the VIOS Complete version detail if ran in a LPAR that contains VIOS, else displays
uname -W: 0
       -W
            Displays the static workload partition identification number. If the uname command runs in

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, /usr/bin/uname -p reports the architecture of the system processor as powerpc which is not helpful. prtconf is way better in that regard, e.g.,

# prtconf | grep "^Processor Type:"
Processor Type: PowerPC_POWER9


func (PlatformInfoAIX) platform() {}

const typePlatformInfoAIX = "AIX platform information"

func init() { AddLogObjectType(typePlatformInfoAIX, &PlatformInfoAIX{}) }

func NewAIXPlatformInfo() *PlatformInfoAIX {
return &PlatformInfoAIX{
ObjectHeader: jsonlog.ObjectHeader{
Type: typePlatformInfoAIX,
},
}
}