Beta Shell
v2.0 ยท web2.us.cloudlogin.co
[FM]
[CMD]
[PHP]
[DB]
[INFO]
[SEC]
File Manager
~
/
usr
/
share
/
perl5
/
vendor_perl
/
Ocsinventory
/
Agent
/
Backend
/
OS
/
Linux
/
Archs
/
Alpha
Upload
3 items
Name
Size
Perms
Modified
Actions
[ .. / .. ]
CPU.pm
884 B
-rw-r--r--
2024-10-28 14:52:47
Edit
Del
Editing: CPU.pm
(884 B)
Path: /usr/share/perl5/vendor_perl/Ocsinventory/Agent/Backend/OS/Linux/Archs/Alpha/CPU.pm
Back
package Ocsinventory::Agent::Backend::OS::Linux::Archs::Alpha::CPU; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_read("/proc/cpuinfo") } sub run { my $params = shift; my $common = $params->{common}; my @cpu; my $current; open CPUINFO, "</proc/cpuinfo" or warn; foreach(<CPUINFO>) { print; if (/^cpu\s*:/) { if ($current) { $common->addCPU($current); } $current = { CPUARCH => 'Alpha', }; } else { $current->{SERIAL} = $1 if /^cpu serial number\s+:\s+(\S.*)/; $current->{SPEED} = $1 if /cycle frequency \[Hz\]\s+:\s+(\d+)000000/; $current->{TYPE} = $1 if /platform string\s+:\s+(\S.*)/; } } # The last one $common->addCPU($current); } 1;