Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add support for HP-UX 11i #1106

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add support for HP-UX 11i #1106

wants to merge 2 commits into from

Conversation

nfinit
Copy link

@nfinit nfinit commented Oct 23, 2018

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 IRIX
  • get_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

  • HP-UX 11i on PA-RISC systems does not seem to ship with any particularly useful utilities for obtaining detailed CPU information as a non-root user, thus the current get_cpu() implementation is not very dynamic, instead it uses information obtained by get_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 an HP PA-8x00 or simply PA-RISC with no speed. Perhaps a specific workaround can be implemented for these particular systems?

TODO

  • Proper support for Itanium systems in get_model() and get_cpu()
  • Testing and implementation of some functions from the existing 11.31-focused branch (mainly get_packages() and get_disk() among others)
  • Need more information on the C8000, rp34x0, rp44x0, rp84x0 and possibly other PA-8800+ based systems to see if any workarounds can be implemented for proper detection.
  • Testing on other systems. This code has been tested and confirmed to work only on my own C3000, and might benefit from being tested with some older workstations, headless systems and systems running HP-UX 11.00, 10.20 and 11.23.

@dylanaraps
Copy link
Owner

Thanks for this!

I'll add some comments later today. Looks good overall though from first glance 👍

@nfinit
Copy link
Author

nfinit commented Oct 23, 2018

Somehow I forgot the entire lineup of RP series servers in get_cpu(). It shouldn't cause any real problems (the CPU will just be reported as a generic PA-RISC on those systems) but I'll have to throw those in as well. It looks like the one CPU to one model rule also holds true for those with the exception of some later PA-8800 and PA-8900 systems similar to the C8000.

@@ -1127,6 +1133,24 @@ get_model() {
model="$(/usr/bin/uname -M)"
;;

"HP-UX")
machine_type="$(model | awk -F'/' '{print $1}')"
Copy link
Owner

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 [[ ]].

Copy link
Author

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.

Copy link
Contributor

@konimex konimex Oct 23, 2018

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).

Copy link
Author

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}')"
Copy link
Owner

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.

Copy link
Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants