line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::Linux::Storages::ServeRaid; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
140234378
|
use strict; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
98
|
|
4
|
1
|
|
|
1
|
|
10
|
use warnings; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
109
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
1168
|
use FusionInventory::Agent::Tools; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
208
|
|
7
|
1
|
|
|
1
|
|
687
|
use FusionInventory::Agent::Task::Inventory::Linux::Storages; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
20
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# Tested on 2.6.* kernels |
10
|
|
|
|
|
|
|
# |
11
|
|
|
|
|
|
|
# Cards tested : |
12
|
|
|
|
|
|
|
# |
13
|
|
|
|
|
|
|
# IBM ServeRAID-6M |
14
|
|
|
|
|
|
|
# IBM ServeRAID-6i |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub isEnabled { |
17
|
0
|
|
|
0
|
0
|
|
return canRun('ipssend'); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub doInventory { |
21
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
my $inventory = $params{inventory}; |
24
|
0
|
|
|
|
|
|
my $logger = $params{logger}; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
my $handle1 = getFileHandle( |
27
|
|
|
|
|
|
|
logger => $logger, |
28
|
|
|
|
|
|
|
command => 'ipssend GETVERSION' |
29
|
|
|
|
|
|
|
); |
30
|
0
|
0
|
|
|
|
|
return unless $handle1; |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
while (my $line1 = <$handle1>) { |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# Example Output : |
35
|
|
|
|
|
|
|
# Found 1 IBM ServeRAID controller(s). |
36
|
|
|
|
|
|
|
#---------------------------------------------------------------------- |
37
|
|
|
|
|
|
|
#ServeRAID Controller(s) Version Information |
38
|
|
|
|
|
|
|
#---------------------------------------------------------------------- |
39
|
|
|
|
|
|
|
# Controlling BIOS version : 7.00.14 |
40
|
|
|
|
|
|
|
# |
41
|
|
|
|
|
|
|
#ServeRAID Controller Number 1 |
42
|
|
|
|
|
|
|
# Controller type : ServeRAID-6M |
43
|
|
|
|
|
|
|
# Controller slot information : 2 |
44
|
|
|
|
|
|
|
# Actual BIOS version : 7.00.14 |
45
|
|
|
|
|
|
|
# Firmware version : 7.00.14 |
46
|
|
|
|
|
|
|
# Device driver version : 7.10.18 |
47
|
0
|
0
|
|
|
|
|
next unless /ServeRAID Controller Number\s(\d*)/; |
48
|
0
|
|
|
|
|
|
my $slot = $1; |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
my $storage; |
51
|
0
|
|
|
|
|
|
my $handle2 = getFileHandle( |
52
|
|
|
|
|
|
|
logger => $logger, |
53
|
|
|
|
|
|
|
command => "ipssend GETCONFIG $slot PD" |
54
|
|
|
|
|
|
|
); |
55
|
0
|
0
|
|
|
|
|
next unless $handle2; |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
while (my $line2 =~ <$handle2>) { |
58
|
|
|
|
|
|
|
# Example Output : |
59
|
|
|
|
|
|
|
# Channel #1: |
60
|
|
|
|
|
|
|
# Target on SCSI ID 0 |
61
|
|
|
|
|
|
|
# Device is a Hard disk |
62
|
|
|
|
|
|
|
# SCSI ID : 0 |
63
|
|
|
|
|
|
|
# PFA (Yes/No) : No |
64
|
|
|
|
|
|
|
# State : Online (ONL) |
65
|
|
|
|
|
|
|
# Size (in MB)/(in sectors): 34715/71096368 |
66
|
|
|
|
|
|
|
# Device ID : IBM-ESXSCBR036C3DFQDB2Q6CDKM |
67
|
|
|
|
|
|
|
# FRU part number : 32P0729 |
68
|
|
|
|
|
|
|
|
69
|
0
|
0
|
|
|
|
|
if ($line2 =~ /Size.*:\s(\d*)\/(\d*)/) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
70
|
0
|
|
|
|
|
|
$storage->{DISKSIZE} = $1; |
71
|
|
|
|
|
|
|
} elsif ($line2 =~ /Device ID.*:\s(.*)/) { |
72
|
0
|
|
|
|
|
|
$storage->{SERIALNUMBER} = $1; |
73
|
|
|
|
|
|
|
} elsif ($line2 =~ /FRU part number.*:\s(.*)/) { |
74
|
0
|
|
|
|
|
|
$storage->{MODEL} = $1; |
75
|
|
|
|
|
|
|
$storage->{MANUFACTURER} = getCanonicalManufacturer( |
76
|
|
|
|
|
|
|
$storage->{SERIALNUMBER} |
77
|
0
|
|
|
|
|
|
); |
78
|
0
|
|
|
|
|
|
$storage->{NAME} = $storage->{MANUFACTURER} . ' ' . $storage->{MODEL}; |
79
|
0
|
|
|
|
|
|
$storage->{DESCRIPTION} = 'SCSI'; |
80
|
0
|
|
|
|
|
|
$storage->{TYPE} = 'disk'; |
81
|
|
|
|
|
|
|
|
82
|
0
|
|
|
|
|
|
$inventory->addEntry(section => 'STORAGES', entry => $storage); |
83
|
0
|
|
|
|
|
|
undef $storage; |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
} |
86
|
0
|
|
|
|
|
|
close $handle2; |
87
|
|
|
|
|
|
|
} |
88
|
0
|
|
|
|
|
|
close $handle1; |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
1; |