Issue #11612 has been updated by Luke M.

The machinfo man page lists getconf and pstat as the supported ways of 
retrieving this information. 

perl code to get CPU type:

    my $type = {
       0x07 => [ 0x00 => '', ],
       0x1f => [
          '(up to 3 MB L3 cache)',
          '(up to 6 MB L3 cache)',
          '(up to 9 MB L3 cache)',
       ],
       0x20 => [
          '9000 Series',
          '9100 Series',
          '9300 Series',
       ],
       0x07 => [ '9500 Series', ],
    };
    my $cpuid = qx/getconf CPU_CHIP_TYPE/;
    my $family   = (($cpuid >> 24) & 0xFF);
    my $model    = (($cpuid >> 16) & 0xFF);
    my $revision = (($cpuid >> 8) & 0xFF);
    print "Intel Itanium Processor " . $type->{$family}->[$model] ."\n";

CPUID numbers are from [here].

CPU count & freq:
    
    ...
    struct pst_dynamic pstat_dyn;
    struct pst_processor pstat_cpu;
    ...
    rc=pstat_getdynamic(&pstat_dyn, sizeof(struct pst_dynamic),1,0);
    if ( rc == -1 )
       perror("pstat_getdynamic"), exit(EXIT_FAILURE);
    printf("cores: %ld\n",pstat_dyn.psd_active_cores);
    printf("threads: %ld\n",pstat_dyn.psd_proc_cnt);
    printf("freq:%1.2f GHz\n", (double)pstat_cpu.psp_cpu_frequency/(BILLION));
    

Memory:
    $ getconf _SC_MEM_MBYTES
    20474

Not sure how you translate that into ruby code. 

[here]: 
http://www.intel.com/content/www/us/en/processors/itanium/itanium-9500-reference-manual.html
----------------------------------------
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-76639

Author: hongbo hu
Status: Merged - Pending Release
Priority: Normal
Assignee: 
Category: library
Target version: 1.6.15
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