Megaraids supported by storcli

Megaraids compatible with storcli


Make sure you have the most recent version of cagent installed. The monitoring of hardware raids with storcli requires cagent version 1.2.6 or later. Cagent checks the health of your raid arrays on the startup of the agent and then every 30 minutes. The check interval of the agent does not apply to the frequency of raid status checks. The 30 minutes interval is hardcoded and cannot be changed. Checking large raid arrays too frequently stresses a system unnecessarily.

If you have the storcli command line tool already installed, make sure it's recent enough. Json formatted output must be supported. Try storcli64.exe /call show J If you don't get a json formatted output, please update storcli.

On Linux: Download and install the storcli command-line tool

The storecli executable is needed to fetch the health state of your raid. Due to license reasons, we cannot include the binary into our packages. You must download it manually.

cd /tmp
# On Debian/Ubuntu
unzip storcli_All_OS/Ubuntu/storcli_1.23.02_all.deb
sudo dpkg -i storcli_All_OS/Ubuntu/storcli_1.23.02_all.deb
# On CentOS/RedHat
unzip storcli_All_OS/Linux/storcli-1.23.02-1.noarch.rpm
sudo rpm -i storcli_All_OS/Linux/storcli-1.23.02-1.noarch.rpm
# Clean up, downloads are nolonger needed
rm -rf 1.23.02_StorCLI.* storcli_All_OS*

Now you have storcli installed in /opt/MegaRAID/storcli/storcli64

Check if your controller is supported by executing sudo /opt/MegaRAID/storcli/storcli64 /call show allYou should get a lot of information.

Create a sudo rule

Only the root-user can connect the storcli to the controller. Therefore cagent needs sudo-permission because the agent is not running with root-rights. Create a file /etc/sudoers.d/cagent-storcli

cagent ALL= NOPASSWD: /opt/MegaRAID/storcli/storcli64 /call show all J

The usage of visudo -f /etc/sudoers.d/cagent-storcli is the recommended way to edit sudo rules.

Test the sudo-rule

[email protected]:~# su - cagent -s /bin/bash
[email protected]:/$ sudo /opt/MegaRAID/storcli/storcli64 /call show all J

Now tell cagent it should use storcli. Open the file /etc/cagent/cagent.conf with an editor and insert the following two lines

... snip
binary = '/opt/MegaRAID/storcli/storcli64'

Do not enter sudo /opt/MegaRAID/storcli/storcli64. Cagent always uses sudo. Using it without sudo is not possible.

Optionally you can test if everything works well together by executing sudo cagent -r -o - |jq .measurements.modules

Cagent has been connected to storcli

Restart the agent after changing the configuration file. Use systemctl restart cagent.

Disable harmless warnings on Debian and Ubuntu

After having installed the storcli.deb you might get warnings every time you execute apt, apt-get, aptitude or another command for the package management.

dpkg: warning: parsing file '/var/lib/dpkg/status' near line 8525 package 'storcli': missing maintainer

To get rid of these warnings open the file /var/lib/dpkg/status with an editor. Search for the block containing the storcli and append the missing line Maintainer: None

Package: storcli
Status: install ok installed
Priority: optional
Section: storcli
Installed-Size: 7000000
Architecture: all
Version: 1.23.02
Depends: bash
Description: Storage Command Line Tool, manages storage controllers.
Maintainer: None

On Windows: Download and unpack storcli64.exe

Point your browser to the URL and save the downloaded file somewhere. There is another ZIP Inside the ZIP. Extract both and search for the Windows folder and copy the file storcli64.exe to a new folder, for example, C:\Program Files\storcli

Copy storcli64.exe

Open a cmd.exe terminal with administrative rights. Type in "C:\Program Files\storcli\storcli64.exe" /call show all If you get a lot of output and information about your controller, you have successfully installed all prerequisites.

Verify your controller is supported

Make sure you have at least version 1.2.6 of cagent installed. Use cagent -version to test. You can always use cagent -p to see all supported options and examples for the configuration file.

Open the file C:\Program Files\cagent\cagent.conf with an editor and insert the following two lines

C:\Program Files\cagent\cagent.conf
C:\Program Files\cagent\cagent.conf
binary = "/opt/MegaRAID/storcli/storcli64"
Activate storcli in cagent.conf

Restart the agent after changing the configuration file.