=head1 NAME B - Nagios/Icinga Plugin to check LSI raid-controllers. =head1 SYNOPSIS Example: ./check_lsi_raid -Tw 40 -Tc 50 -LD 0,1 -PD 1 -b 0 LSIRAID OK (Ctrl #0) =head1 VERSION This document describes check_lsi_raid version B<0.3>. =head1 DESCRIPTION check_lsi_raid is a Nagios/Icinga Plugin to check LSI raid-controllers for errors/warnings. This plugin makes heavy use of B which can be obtained from the LSI homepage. It checks the controller, the physical devices and the logical devices seperately for errors or warnings (for more detailed information about what is beeing monitored see METHODS). =head1 DEPENDENCIES - This plugin requires a running Nagios or Icinga (either local or NRPE). - sudo - storcli/storcli64 (Can be obtained from the LSI homepage) - The following Perl Modules: use strict; use warnings; use Getopt::Long qw(:config no_ignore_case); =head1 METHODS =head2 getExitState Returns the correct exit code after each test. Can only increment the exit-code (if necessary) since the exit-code may not change from Warning to OK. =head2 displayUsage Explains the usage of the plugin and which parameters are available. =head2 displayHelp Prints a short help text and quick information where to find additional help. =head2 displayVersion Prints the plugin version and the StorCLI version. =head2 getControllerStatus Checks the LSI raid-controller for controller errors (uses B). - Overall status - Reboot necessary? - Booted in safe mode? - Memory errors - Failed to get lock key? - Rollback operation in progress? - Temperature of controller and/or ROC (if present) The controller/ROC temperature can be set to a warning (parameter: B<-Tw>|B<--temperature-warn>) and a critical level (parameter: B<-Tc>|B<--temperature-critical>). See getThresholds for more information. =head2 getLogicalDeviceStatus Returns information about logical devices: - General logical devices status - Initialization in progress? =head2 getPhysDeviceStatus Returns information about physical devices attached to the LSI raid-controller: - Disk status - Several error counts - Device temperature - Predictive fail count - S.M.A.R.T. status The device temperature can be set to a warning (parameter: B<-PDTw>|B<--physicaldevicetemperature-warn>) and a critical level (parameter: B<-PDTc>|B<--physicaldevicetemperature-critical>). See getThresholds for more information. =head2 getBBUStatus Returns information about the battery backup unit (BBU) status. - Overall status - Temperature status - Bad voltage - Learn cycle status - I2C errors - Capacity =head2 getThresholds Uses the B<-Tw>|B<--temperature-warn> and B<-Tc>|B<--temperature-critical> parameters and parses them. Uses correct Nagios threshold implementation: L Returns a temperature range (array) in or out which a temperature should be. Array content: ("in" or "out", range from, range to). =head3 Examples Generate an alert if x... -Tw 10 < 0 or > 10, (outside the range of {0 .. 10}) -Tw 10: < 10, (outside {10 .. inf}) -Tw ~:10 > 10, (outside the range of {-inf .. 10}) -Tw 10:20 < 10 or > 20, (outside the range of {10 .. 20}) -Tw @10:20 >= 10 and <= 20, (inside the range of {10 .. 20}) =head1 LICENSE AND COPYRIGHT Copyright (c) 2013, Martin Grubhofer C<< >>, C<< >>, Scheipner Alexander C<< >>, Werner Sebastian C<< >>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. =head1 DISCLAIMER OF WARRANTY BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.