source: ocsinventory-agent/trunk/fuentes/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/MIPS/CPU.pm @ 468

Last change on this file since 468 was 468, checked in by mabarracus, 4 years ago

Copyt trusty code

File size: 637 bytes
Line 
1package Ocsinventory::Agent::Backend::OS::Linux::Archs::MIPS::CPU;
2use strict;
3
4sub check { can_read("/proc/cpuinfo") }
5
6sub run {
7    my $params = shift;
8    my $common = $params->{common};
9
10    my @cpu;
11    my $current;
12    open CPUINFO, "</proc/cpuinfo" or warn;
13    foreach(<CPUINFO>) {
14        print;
15        if (/^system type\s+:\s*:/) {
16
17            if ($current) {
18                $common->addCPU($current);
19            }
20
21            $current = {
22                ARCH => 'MIPS',
23            };
24
25        }
26
27        $current->{TYPE} = $1 if /cpu model\s+:\s+(\S.*)/;
28
29    }
30
31    # The last one
32    $common->addCPU($current);
33}
34
351
Note: See TracBrowser for help on using the repository browser.