Commit 4626349b authored by Muhammad Herdiansyah's avatar Muhammad Herdiansyah

CPU: Added initial support for AIX

parent 0cfe6f36
...@@ -278,6 +278,10 @@ get_model() { ...@@ -278,6 +278,10 @@ get_model() {
"Solaris") "Solaris")
model="$(prtconf -b | awk -F':' '/banner-name/ {printf $2}')" model="$(prtconf -b | awk -F':' '/banner-name/ {printf $2}')"
;; ;;
"AIX")
model="$(prtconf | awk -F':' '/System Model/ {printf $2}')"
;;
esac esac
# Remove dummy OEM info. # Remove dummy OEM info.
...@@ -911,6 +915,22 @@ get_cpu() { ...@@ -911,6 +915,22 @@ get_cpu() {
# Get CPU cores. # Get CPU cores.
cores="$(sysinfo -cpu | grep -c -F 'CPU #')" cores="$(sysinfo -cpu | grep -c -F 'CPU #')"
;; ;;
"AIX")
# Get CPU name.
cpu="$(prtconf | awk -F':' '/Processor Type/ {printf $2}')"
# Get CPU speed.
speed="$(prtconf | awk -F':' '/Processor Clock Speed/ {printf $2}')"
speed="${speed/MHz}"
speed="$((speed / 100))"
# Get CPU cores.
case "$cpu_cores" in
"logical" | "on") cores="$(lparstat -i | awk -F':' '/Online Virtual CPUs/ {printf $2}')" ;;
"physical") cores="$(lparstat -i | awk -F':' '/Active Physical CPUs/ {printf $2}')"
esac
;;
esac esac
# Fix for speeds under 1ghz. # Fix for speeds under 1ghz.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment