thomas-krenn / check_lsi_raid

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

Windows: Error: invalid controller number #35

Closed tiagomreis closed 2 years ago

tiagomreis commented 2 years ago

Running the storcli64 with /c0 returns the controller and all disks, however, using the check_lsi_raid returns error

C:\LSI>"C:\Program Files (x86)\perl\bin\perl.exe" check_lsi_raid -p "C:\LSI\storcli64.exe" Error: invalid controller number, controller not found!

When using the storcli64.exe `C:\LSI>storcli64.exe /c0 show Generating detailed summary of the adapter, it may take a while to complete.

CLI Version = 007.1017.0000.0000 May 10, 2019 Operating system = Windows Server 2019 Controller = 0 Status = Success Description = None

Product Name = LSI MegaRAID 9361-8i`

Doing C:\LSI>"C:\Program Files (x86)\perl\bin\perl.exe" check_lsi_raid --help returns the correct output of check_lsi_raid plugin

Any idea / suggestion?

tiagomreis commented 2 years ago

Regarding this issue and because is discuss in some other issues, there is no problem in time:

Controller time: Ctrl_Prop Value Time 2022/01/20 16:18:40

System time: The current time is: 16:18:45.60

gschoenberger commented 2 years ago

Do you pass "-C 0" as controller number?

tiagomreis commented 2 years ago

Yes

C:\LSI>"C:\Program Files (x86)\perl\bin\perl.exe" check_lsi_raid -p "C:\LSI\storcli64.exe" -C 0 Error: invalid controller number, controller not found!

I've also done the direct usage of files on the same folder to avoid any problem in paths.

C:\LSI>perl check_lsi_raid -p storcli64.exe -C 0 Error: invalid controller number, controller not found!

gschoenberger commented 2 years ago

Can you post the command output of: C:\LSI\storcli64.exe show time

The code used to check if the controller number is:

sub getControllerTime{
    my $storcli = shift;
    my @output = `$storcli show time`;
    return (checkCommandStatus(\@output));
}
tiagomreis commented 2 years ago

@gschoenberger that command returns the list of commands without the /c0


syntax error, unexpected $end

Storage Command Line Tool  Ver 007.1017.0000.0000 May 10, 2019

(c)Copyright 2019, AVAGO Technologies, All Rights Reserved.

help - lists all the commands with their usage. E.g. storcli help
<command> help - gives details about a particular command. E.g. storcli add help

List of commands:

With /c0 before show time

CLI Version = 007.1017.0000.0000 May 10, 2019
Operating system = Windows Server 2019
Controller = 0
Status = Success
Description = None
Controller Properties :
Ctrl_Prop Value
Time      2022/01/24 09:19:53
gschoenberger commented 2 years ago

OK, I forgot that storcli is always prepended with the controller number by default: $storcli .= " /c$CONTROLLER"; The command executed is, as you said: C:\LSI\storcli64.exe /c0 show time

Then theres a function to parse the output of this command:

sub checkCommandStatus{
    my @output = @{(shift)};
    foreach my $line (@output){
        if($line =~ /^Status/){
            if($line eq "Status = Success\n"){
                return 1;
            }

Mh, your output includes "Status = Success":

C:\LSI>C:\LSI\storcli64.exe /c0 show time
CLI Version = 007.1017.0000.0000 May 10, 2019
Operating system = Windows Server 2019
Controller = 0
Status = Success
Description = None
Controller Properties : Ctrl_Prop Value Time 2022/01/24 09:19:53

Maybe there is a problem with "\n" under windows. Can you check which line endings you have at the output?

tiagomreis commented 2 years ago

@gschoenberger I've attached the output Screenshot 2022-01-24 at 09 20 05

Plus, to make "this work" i've removed the following code:

if(!getControllerTime($storcli, $noCleanlogs)){
    print "Error: invalid controller number, controller not found!\n";
    exit(STATE_UNKNOWN);
}

And after that, the error pass to:

C:\LSI>"C:\Program Files (x86)\Plesk\perl\bin\perl.exe" check_lsi_raid_orig -p storcli64.exe -C 0
Invalid StorCLI command! (storcli64.exe /c0/vall show all nolog)
gschoenberger commented 2 years ago

Can you post the output of storcli64.exe /c0/vall show all nolog + Return Code?

tiagomreis commented 2 years ago

@gschoenberger sure Screenshot 2022-01-24 at 09 53 13

gschoenberger commented 2 years ago

Does storcli64.exe /c0 /vall show all work? Maybe the spaces are a problem under windows. I did a quick test under Linux:

# /opt/MegaRAID/storcli/storcli64 /c0/vall show all nolog
CLI Version = 007.1508.0000.0000 Oct 14, 2020
Operating system = Linux 5.4.0-72-generic
Controller = 0
Status = Success
Description = No VD's have been configured.
gschoenberger commented 2 years ago

I am also using a newer storcli version:

/opt/MegaRAID/storcli/storcli64 -h

      StorCli SAS Customization Utility Ver 007.1508.0000.0000 Oct 14, 2020
tiagomreis commented 2 years ago

@gschoenberger on a Lenovo StorCli util i've found this on their changelog:

-MR 7.13: Storcli(Regression): Syntax error seen while using "nolog" and "page" together as parameters.(DCSG00071417)
....
-StorCLI - '/c0 show nolog' reported as Un-supported Command.(DCSG00071410)

I think this is a bug on the version that I've. I downloaded other version and the command works.

New version: 007.1705.0000.0000 Mar 31, 2021

Old version: 007.1508.0000.0000 Oct 14, 2020

gschoenberger commented 2 years ago

How about the plugin with the new version?

tiagomreis commented 2 years ago

@gschoenberger it's working now with no changes on the code.

C:\LSI>perl check_lsi_raid -p storcli64.exe -C 0
Critical (CTR Crit) [ROC_Temperature = Critical]|CV_Temperature=26;70;85 ROC_Temperature=101;85;95 c0/e252/s0_Drive_Temperature=33;40;45 c0/e252/s1_Drive_Temperature=31;40;45 c0/e252/s2_Drive_Temperature=30;40;45 c0/e252/s3_Drive_Temperature=30;40;45

I now have this "Critical", I will investigate..it was ok until I change the storcli64.exe

gschoenberger commented 2 years ago

Your ROC temp is above the limits: ROC_Temperature=101;85;95

tiagomreis commented 2 years ago

@gschoenberger yes, it's another issue that I will investigate

Thank you for your feedback, the tool is working fine if we use the latest version of StorCLI.