Beta Shell
v2.0 ยท web2.us.cloudlogin.co
[FM]
[CMD]
[PHP]
[DB]
[INFO]
[SEC]
File Manager
~
/
usr
/
share
/
fusioninventory
/
lib
/
FusionInventory
/
Agent
/
Task
/
Inventory
/
Linux
/
PowerPC
Upload
4 items
Name
Size
Perms
Modified
Actions
[ .. / .. ]
Bios.pm
1.19 KB
-rw-r--r--
2020-08-04 07:36:42
Edit
Del
CPU.pm
1.22 KB
-rw-r--r--
2020-08-04 07:36:42
Edit
Del
Editing: CPU.pm
(1.22 KB)
Path: /usr/share/fusioninventory/lib/FusionInventory/Agent/Task/Inventory/Linux/PowerPC/CPU.pm
Back
package FusionInventory::Agent::Task::Inventory::Linux::PowerPC::CPU; use strict; use warnings; use parent 'FusionInventory::Agent::Task::Inventory::Module'; use FusionInventory::Agent::Tools::Linux; sub isEnabled { my (%params) = @_; return 0 if $params{no_category}->{cpu}; return -r '/proc/cpuinfo'; } sub doInventory { my (%params) = @_; my $inventory = $params{inventory}; my $logger = $params{logger}; foreach my $cpu (_getCPUsFromProc( logger => $logger, file => '/proc/cpuinfo' )) { $inventory->addEntry( section => 'CPUS', entry => $cpu ); } } sub _getCPUsFromProc { my @cpus; foreach my $cpu (getCPUsFromProc(@_)) { my $speed; if ( $cpu->{clock} && $cpu->{clock} =~ /(\d+)/ ) { $speed = $1; } my $manufacturer; if ($cpu->{machine} && $cpu->{machine} =~ /IBM/ ) { $manufacturer = 'IBM'; } push @cpus, { ARCH => 'PowerPC', NAME => $cpu->{cpu}, MANUFACTURER => $manufacturer, SPEED => $speed }; } return @cpus; } 1;