thomas-krenn / check_lsi_raid

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

storcli no longer supports adpallinfo (deprecated) #24

Closed TobbeJ closed 4 years ago

TobbeJ commented 6 years ago

i updated storcli and it no longer supports adpallinfo resulting in check_lsi_raid erroring with:

Invalid StorCLI command! (/opt/MegaRAID/storcli/storcli64 adpallinfo a0 -NoLog)

running the storcli command manually gives:

# storcli64 adpallinfo a0 -NoLog CLI Version = 007.0709.0000.0000 Aug 14, 2018 Operating system = Linux 4.18.16-200.fc28.x86_64 Status = Failure Description = Deprecated command. Please use the new syntax.

so i think the script needs to be updated a bit.

TobbeJ commented 6 years ago

this at least gets rid of the error:

diff --git a/check_lsi_raid b/check_lsi_raid
index 447bd57..22d0eda 100755
--- a/check_lsi_raid
+++ b/check_lsi_raid
@@ -232,12 +232,7 @@ sub getControllerInfo{
        my $command = '';

        $storcli =~ /^(.*)\/c[0-9]+/;
-       if(!defined($writelogs)){
-               $command = $1.'adpallinfo a'.$CONTROLLER.' -NoLog';
-       }
-       else{
-               $command = $1.'adpallinfo a'.$CONTROLLER;
-       }
+       $command = $1.'/c'.$CONTROLLER.' show all';

        push @{$commands_a}, $command;
        my @output = `$command`;
gschoenberger commented 6 years ago

Can you post the output of "show all" ?

TobbeJ commented 6 years ago

well... output is pretty much the same as before as far as i can tell. i compared mine against the one one in https://github.com/thomas-krenn/check_lsi_raid/issues/13#issuecomment-366997538

only significant difference i can find (but it is probably not really a difference) is that under HwCfg i have:

ROC temperature(Degree Celsius) = 58

and i also have a cache vault section since my controller have a cache module. oh and under Basic section i have a revision number.

that's it

edingc commented 5 years ago

this at least gets rid of the error:

diff --git a/check_lsi_raid b/check_lsi_raid
index 447bd57..22d0eda 100755
--- a/check_lsi_raid
+++ b/check_lsi_raid
@@ -232,12 +232,7 @@ sub getControllerInfo{
        my $command = '';

        $storcli =~ /^(.*)\/c[0-9]+/;
-       if(!defined($writelogs)){
-               $command = $1.'adpallinfo a'.$CONTROLLER.' -NoLog';
-       }
-       else{
-               $command = $1.'adpallinfo a'.$CONTROLLER;
-       }
+       $command = $1.'/c'.$CONTROLLER.' show all';

        push @{$commands_a}, $command;
        my @output = `$command`;

This seems to work just fine for me on Windows Server 2016. Thanks.

gschoenberger commented 5 years ago

I can remember with previous version of storcli we had the problem that the controller blocks requests when calling "show all". Did anyone run excessive tests with the plugin and "show all" as command?

keith4 commented 5 years ago

It also seems to work with just: $command = $1.'/c'.$CONTROLLER.' show';

gschoenberger commented 5 years ago

OK THX, is the '-NoLog' opotion still supported?

keith4 commented 5 years ago

It is not. But it also doesn't appear to produce a log file, so it's no longer necessary.

jolentes commented 5 years ago

@keith4 can you create a pull request out of your commit? Would be good to clean up code that is commented out before.

keith4 commented 5 years ago

Probably the "correct" thing to do would be to add some storcli version checking, and then adjust the command assembly appropriately, instead of merging my hack job?

But if you're happy to abandon the old syntax, that's fine with me. I'll remove the commented-out lines and submit a PR shortly.

tervor commented 5 years ago

Hi, I think the pull request #27 should be accepted in order to close the issue. I ran into the same issues as described here. The version of storcli I use is Storage Command Line Tool Ver 007.1015.0000.0000 April 04, 2019. I also tested this with an older version Storage Command Line Tool Ver 1.23.02 Mar 28, 2017. Both work as expected using the same fix.

ghost commented 5 years ago

@gschoenberger are there any blockers to the PR mentioned above? The fix also works on the latest version I found Storage Command Line Tool Ver 007.1108.0000.0000 July 17, 2019. It would be great to get this fixed upstream.

richardweinberger commented 4 years ago

@gschoenberger ping?

gschoenberger commented 4 years ago

I just merge the pull request #27 @richardweinberger Can you test the latest upstream version?

richardweinberger commented 4 years ago

I just merge the pull request #27 @richardweinberger Can you test the latest upstream version?

Works fine! Thanks a lot for merging, much appreciated!

gschoenberger commented 4 years ago

Sorry for the delay. I am trying to catch up with all the open issues across all plugins. But time is limited, as usual :smiley: