thomas-krenn / check_lsi_raid

Monitoring plugin to check MegaRAID controllers
GNU General Public License v3.0
59 stars 26 forks source link

Can't use an undefined value as an ARRAY reference at ./check_lsi_raid #36

Closed dmitrykrivitsky closed 2 years ago

dmitrykrivitsky commented 2 years ago

I am getting the following:

./check_lsi_raid -p /opt/MegaRAID/storcli/storcli64 -C 0 --nocleanlogs Can't use an undefined value as an ARRAY reference at ./check_lsi_raid line 408.

Line 408 is: for(my $i = 0; $i < @{$LDMAP}; $i++){

dmitrykrivitsky commented 2 years ago

I found what the problem was. The header line may have more than one white space. Line if($line =~ /^DG\/VD TYPE./){ needs to be replaced with if($line =~ /^DG\/VD[[:blank:]]+TYPE./){

gschoenberger commented 2 years ago

Can you try lastet commit a983b1fb10a6cdf1390413daabb93ebd0823d12a ?

dmitrykrivitsky commented 2 years ago

Can you try lastet commit a983b1f ?

Yes, it is working now. Thanks.

dmitrykrivitsky commented 2 years ago

I found what the problem was. The header line may have more than one white space. Line if($line =~ /^DG/VD TYPE./){ needs to be replaced with if($line =~ /^DG/VD[[:blank:]]+TYPE./){

Just for the record: special characters got corrupted when I was pasting this code into my comment... I guess the comment section doesn't like special characters.