This file is indexed.

/usr/share/fusioninventory/lib/FusionInventory/Agent/Task/Inventory/BSD/Archs/MIPS.pm is in fusioninventory-agent 1:2.3.10.1-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package FusionInventory::Agent::Task::Inventory::BSD::Archs::MIPS;

use strict;
use warnings;

use Config;

use FusionInventory::Agent::Tools;

sub isEnabled {
    return $Config{archname} =~ /^IP\d+/;
}

sub doInventory {
    my (%params) = @_;

    my $inventory = $params{inventory};

    my $bios = {
        SMANUFACTURER => 'SGI',
    };

    # sysctl infos

    # example on NetBSD: SGI-IP22
    # example on OpenBSD: SGI-O2 (IP32)
    $bios->{SMODEL} = getFirstLine(command => 'sysctl -n hw.model');

    my $count = getFirstLine(command => 'sysctl -n hw.ncpu');

    # dmesg infos

    # I) Indy
    # NetBSD:
    # mainbus0 (root): SGI-IP22 [SGI, 6906e152], 1 processor
    # cpu0 at mainbus0: MIPS R4400 CPU (0x450) Rev. 5.0 with MIPS R4010 FPC Rev. 0.0
    # int0 at mainbus0 addr 0x1fbd9880: bus 75MHz, CPU 150MHz
    #
    # II) O2
    # NetBSD:
    # mainbus0 (root): SGI-IP32 [SGI, 8], 1 processor
    # cpu0 at mainbus0: MIPS R5000 CPU (0x2321) Rev. 2.1 with built-in FPU Rev. 1.0
    # OpenBSD:
    # mainbus0 (root)
    # cpu0 at mainbus0: MIPS R5000 CPU rev 2.1 180 MHz with R5000 based FPC rev 1.0
    # cpu0: cache L1-I 32KB D 32KB 2 way, L2 512KB direct

    my $cpu;
    foreach my $line (getAllLines(command => 'dmesg')) {
        if ($line =~ /$bios->{SMODEL}\s*\[\S*\s*(\S*)\]/) { $bios->{SSN} = $1; }
        if ($line =~ /cpu0 at mainbus0:\s*(.*)$/)         { $cpu->{NAME} = $1; }
        if ($line =~ /CPU\s*.*\D(\d+)\s*MHz/)             { $cpu->{SPEED} = $1;  }
    }

    $inventory->setBios($bios);

    while ($count--) {
        $inventory->addEntry(
            section => 'CPUS',
            entry   => $cpu
        );
    }
}

1;