-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add support for HP-UX 11i #1106
base: master
Are you sure you want to change the base?
Conversation
Thanks for this! I'll add some comments later today. Looks good overall though from first glance 👍 |
Somehow I forgot the entire lineup of RP series servers in |
@@ -1127,6 +1133,24 @@ get_model() { | |||
model="$(/usr/bin/uname -M)" | |||
;; | |||
|
|||
"HP-UX") | |||
machine_type="$(model | awk -F'/' '{print $1}')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the output of model
? We could read it into an array and save calling it (and awk) multiple times.
Also, change all occurrences of [ ]
to [[ ]]
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
model
output on PA-RISC systems seems to most often be a three or two-part string delimiting the system's model using the old HP 9000 naming convention, on older systems the second and third component correspond to the model and submodel (e.g. 9000/715/100
) while on newer systems it seems to correspond more to family and model (9000/785/C3000
) hence why I'm cutting up the string differently depending on whether characters are present in the last string or not.
It's definitely consistent enough that you could just parse it into an array, I'll take a look at it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On IA64 systems, the usual format would be ia64 hp server <actual model>
. For both models, I think it'd be good if we keep the family and model (in case of ia64, maybe we can truncate the ia64 hp server
output later).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I found some useful resources with model
strings from a number of systems:
ftp://ftp.mrynet.com/operatingsystems/HP-MPE/docs.hp.com/en/5991-6552/ch02s03.html
ftp://ftp.mrynet.com/operatingsystems/HP-MPE/docs.hp.com/en/5991-1247B_ed2/ch02s04.html
There's even some Superdome output on here, which is great. There's also a couple four-part strings by the looks of it.
@@ -2358,7 +2507,7 @@ get_song() { | |||
|
|||
printf -v players "|%s" "${players[@]}" | |||
player="$(ps aux | awk -v pattern="(${players:1})" \ | |||
'!/ awk / && !/iTunesHelper/ && match($0,pattern){print substr($0,RSTART,RLENGTH); exit}')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this branch needs a rebase with master.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry about this, but I'm not terribly experienced with git (especially working on a larger project like this) and I can't for the life of me get this branch to rebase properly. I've tried a couple different methods so far (most recently this) and it still doesn't seem to apply the changes from these more recent commits, though it definitely seems to go through and says it's up to date with the remote master.
Am I just missing something simple? It's driving me crazy.
…X when width/height variables are empty
Description
Adds initial support for HP-UX 11i (11.11+) on PA-RISC systems. Also should provide basic support on Itanium systems.
This is intended to be separate from the existing HP-UX 11.31+ branch, which mostly focuses on the later Itanium systems running the latest versions of HP-UX that have different tool sets for system information gathering. (I'm still more than happy to move my work over to that branch, I just didn't want to contaminate it with anything potentially incompatible)
Features
Modified functions
get_os()
get_distro():
Basic identification (needs further testing with other 11i versions to ensure version output is properly trimmed)get_model():
Identifies and formats machine architecture, family and model numbers on PA-RISC systems.get_kernel():
Function skipped as on AIX and IRIXget_uptime():
Functions properly on 11i using similar methods to AIX and IRIX, may need to be tested on 11.23 and 11.31.get_cpu():
Implemented in detail for most PA-RISC systems except the C8000 and rp series, extremely basic support for Itanium and some unsupported PA-RISC systems.get_gpu():
Should work for all VISUALIZE graphics options and likely FireGL products as well.get_memory():
Gets total memory size and gets usage using the method from the 11.31 branch, not sure about the accuracy.Issues
get_cpu()
implementation is not very dynamic, instead it uses information obtained byget_model()
to determine the CPU configuration. As almost every PA-RISC system built by HP had a single fixed CPU configuration which is not upgradeable (to my knowledge,) this is still a safe strategy, though not an ideal one. The only exceptions to this rule are the HP C8000 and some later rp series servers, which shipped with both PA-8800 and PA-8900 processors at multiple speed grades and have no distinguishing model numbers corresponding to what is inside them.get_cpu()
should currently report the processor in one of these systems as anHP PA-8x00
or simplyPA-RISC
with no speed. Perhaps a specific workaround can be implemented for these particular systems?TODO
get_model()
andget_cpu()
get_packages()
andget_disk()
among others)