Skip to content

Commit 2c10a31

Browse files
author
Gerard Hickey
committed
Added mk_hw_core_count
1 parent 684406f commit 2c10a31

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

hanlon_microkernel/facter/hnl_mk_cpu.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
# process the results from lscpu
4545
facts_to_report = %w{Architecture BogoMIPS Byte_Order CPU_MHz CPU_family CPU_op-modes
4646
L1d_cache L1i_cache L2_cache L3_cache Model Stepping Vendor_ID
47-
Virtualization}
47+
Virtualization Virtualization_type Hypervisor_vendor
48+
Threads_per_core Cores_per_socket Sockets
49+
NUMA_nodes}
4850
%x[lscpu].split(/\n/).each do |line|
4951
line =~ /^([^:]+):\s*(.*)\s*$/
5052
if $1
@@ -59,3 +61,8 @@
5961
end
6062
end
6163

64+
# report on the number of cores available
65+
Facter.add("mk_hw_core_count") do
66+
setcode { Facter.value('mk_hw_lscpu_cores_per_socket').to_i *
67+
Facter.value('mk_hw_lscpu_sockets').to_i }
68+
end

0 commit comments

Comments
 (0)