Dell PERC 6/i nagios monitoring under ubuntu
| March 20th, 20091. First get the latest version of MegaCLI from LSI website (choose MegaCLI – Linux from the list). Unzip the downloaded file. The package inside the .zip file is an .rpm so it needs to be converted into something more useful.
2. install alien, convert the .rpm into a .tgz and ‘untargzip’ it :
$ sudo apt-get install alien
$ sudo alien –to-tgz MegaCli-1.01.39-0.i386.rpm
$ tar xvfz MegaCli-1.01.39.tgz
3. now in ./opt/MegaRAID/MegaCli you should have MegaCli and MegaCli64, depending on your ubuntu installation type (i368 or amd64) copy one of them as MegaCli to /usr/sbin (so for 64bit: cp MegaCli64 /usr/sbin/MegaCli)
4. Download nagios check script from Nagios Exchange and place it in /usr/lib/nagios/plugins
5. The MegaCli script has to be run as root, usually nagios nrpe runs as user nagios, and it’s better to keep it this way. The nagios check script is fully aware of that and uses sudo to call the raid check script. So nagios needs to be allowed to call this script as root. Use visudo and add this line:
nagios ALL=(ALL) NOPASSWD: /usr/sbin/MegaCli
6. Add a new command definition to nrpe config (/etc/nagios/nrpe_local.cfg):
command[check_raid]=/usr/lib/nagios/plugins/check_megaraid_sas