/usr/share/fusioninventory/lib/FusionInventory/Agent/Task/Inventory/Linux/Storages/ServeRaid.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 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | package FusionInventory::Agent::Task::Inventory::Linux::Storages::ServeRaid;
use strict;
use warnings;
use FusionInventory::Agent::Tools;
use FusionInventory::Agent::Task::Inventory::Linux::Storages;
# Tested on 2.6.* kernels
#
# Cards tested :
#
# IBM ServeRAID-6M
# IBM ServeRAID-6i
sub isEnabled {
return canRun('ipssend');
}
sub doInventory {
my (%params) = @_;
my $inventory = $params{inventory};
my $logger = $params{logger};
my $handle1 = getFileHandle(
logger => $logger,
command => 'ipssend GETVERSION'
);
return unless $handle1;
while (my $line1 = <$handle1>) {
# Example Output :
# Found 1 IBM ServeRAID controller(s).
#----------------------------------------------------------------------
#ServeRAID Controller(s) Version Information
#----------------------------------------------------------------------
# Controlling BIOS version : 7.00.14
#
#ServeRAID Controller Number 1
# Controller type : ServeRAID-6M
# Controller slot information : 2
# Actual BIOS version : 7.00.14
# Firmware version : 7.00.14
# Device driver version : 7.10.18
next unless /ServeRAID Controller Number\s(\d*)/;
my $slot = $1;
my $storage;
my $handle2 = getFileHandle(
logger => $logger,
command => "ipssend GETCONFIG $slot PD"
);
next unless $handle2;
while (my $line2 =~ <$handle2>) {
# Example Output :
# Channel #1:
# Target on SCSI ID 0
# Device is a Hard disk
# SCSI ID : 0
# PFA (Yes/No) : No
# State : Online (ONL)
# Size (in MB)/(in sectors): 34715/71096368
# Device ID : IBM-ESXSCBR036C3DFQDB2Q6CDKM
# FRU part number : 32P0729
if ($line2 =~ /Size.*:\s(\d*)\/(\d*)/) {
$storage->{DISKSIZE} = $1;
} elsif ($line2 =~ /Device ID.*:\s(.*)/) {
$storage->{SERIALNUMBER} = $1;
} elsif ($line2 =~ /FRU part number.*:\s(.*)/) {
$storage->{MODEL} = $1;
$storage->{MANUFACTURER} = getCanonicalManufacturer(
$storage->{SERIALNUMBER}
);
$storage->{NAME} = $storage->{MANUFACTURER} . ' ' . $storage->{MODEL};
$storage->{DESCRIPTION} = 'SCSI';
$storage->{TYPE} = 'disk';
$inventory->addEntry(section => 'STORAGES', entry => $storage);
undef $storage;
}
}
close $handle2;
}
close $handle1;
}
1;
|