Issue #11612 has been updated by Alex Harvey.

This has proved to be even more of a headache than I anticipated.  After I 
started testing I discovered that there is in fact no method that solves the 
general problem of getting the HP-UX processor name on some of the HP-UX kit I 
have access to.

Situation seems to be -

*) most of the newer HP-UX kit has a command '/usr/contrib/bin/machinfo' 
installed, which is used in Hongbo Hu's original code.

*) some versions of machinfo present a line 'processor model:' which contains a 
processor model string.  In other versions - even on Itanium - the output can 
be formatted differently.  E.g. a single line might say '4 Intel(R) Itanium 2 
9100 series processors (1.59 GHz, 18 MB)'.

*) when 'machinfo' is not available the 'model' command may give you the 
"marketing" name of the processor which can be converted to the PA version and 
model by looking up a file 'sched.models'.  This works most of the time.

What do we do when both of these methods fail?  There are other methods - 
(pdcinfo, cstm) - that also sometimes work.  But still no general solution.

In my opinion the ideal solution would be 

(1) use machinfo when it's available - that's least likely to surprise the 
majority of HP users.  (2) use complete documentation of getconf CPU_VERSION 
and CPU_CHIP_TYPE and encode a static table inside the puppet code to convert 
this to a human readable string.  Although this table may not be completely up 
to date it's highly likely machinfo would fill the gap.

I have emailed someone in HP to see if we can get that documentation.  Pending 
that, the solution I have adopted, is

1) use machinfo.

1-a) if machinfo matches /processor model:\s+\d+\s+(.*)/ then return $1.
1-b) if machinfo matches /\d+\s+((?:PA-RISC|Intel).*processors.*)/ then return 
$1 and then delete the 's' from 'processors'.

2) try using model + sched.models, if both return usable output.  This will be 
useful at my site, at least.

3) otherwise, return raw CPU_VERSION + CPU_CHIP_TYPE like 'CPU V#768 
CHIP_V#536936708'

I am just about ready to submit this but happy to change it if there's feedback.
----------------------------------------
Bug #11612: add facter support for  ia 11.31 hpux processor discover and a bug 
fix for network interface
https://projects.puppetlabs.com/issues/11612#change-75235

Author: hongbo hu
Status: Accepted
Priority: Normal
Assignee: Alex Harvey
Category: library
Target version: 1.6.x
Keywords: facter hpux 
Branch: https://github.com/puppetlabs/facter/pull/232
Affected Facter version: 


1. add cpu information support to facter support HPUX 11.31 IA64

2. when server has  mc-sg  the network card has standby lan card marked
with '*' ,when run faster ,it'll show ifconfig no such interface error

pull requre at github
https://github.com/puppetlabs/facter/pull/127
I'll add more feature for hp and aix 


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to