Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_lsiutil

Rating
4 votes
Favoured:
1
Compatible With
  • Nagios 2.x
  • Nagios 3.x
Owner
License
GPL
Hits
97136
Files:
FileDescription
check_lsiutilcheck_lsiutil
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
Checks LSI controllers RAID status via lsiutil program
Reviews (2)
byOlegDanilov, May 27, 2013
I changed a code for receiving more information:
Current out: "Ctrl 1: Volume 0 State: degraded, enabled, resync in progress"
New version out: "Ctrl 1: Vol 0 (0:4), IM, 285558 MB, degraded, enabled, resync in progress; Ctrl 1: Vol 1 (0:0), IM, 953674 MB, optimal, enabled"

?hanged code of a plug-in:
# Nagios plugin that checks LSI controllers RAID status via lsiutil program
# lsiutil may be found at ftp://ftp.lsil.com/HostAdapterDrivers/linux/lsiutil/

# Copyright (C) 2011 Emmanuel Lacour
#
# This file 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 2, or (at your option) any
# later version.
#
# This file is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this file; see the file COPYING. If not, write to the Free
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301, USA.

use strict;
use lib qw(/usr/local/lib/nagios/plugins /usr/lib/nagios/plugins);
use utils qw(%ERRORS);

my $lsiutil = '/usr/sbin/lsiutil';
my $status = $ERRORS{'OK'};
my $output;
my @controllers;

my $vol_id;
my $vol_bus;
my $vol_target;
my $vol_type;
my $vol_state;
my $vol_size;
my @words;

unless ( -x $lsiutil ) {
print "$lsiutil not found or not executable\n";
exit ($ERRORS{'UNKNOWN'});
}

unless ( $> == 0 ) {
print "This program must be run as root. You may use wrappers like sudo to do this.\n";
exit ($ERRORS{'UNKNOWN'});
}

$output = `$lsiutil -p 0 -a 0`;
for (split /^/, $output) {
if ( m|^\s*(\d+)\..*/proc/mpt/ioc| ) {
push @controllers, $1;
}
}

unless ( scalar @controllers ) {
print "No controller found\n";
exit ($ERRORS{'UNKNOWN'});
}

foreach my $controller ( @controllers ) {
my @vol_stats;
$output = `$lsiutil -p $controller -a 21,1,0,0,0`;

for (split "\n\n", $output) {
if (index($_, 'Volume ') == 0) {

# print "-----------------------"."\n";
# print $_."\n";
# print "-----------------------"."\n";

my @lines = split /\n/, $_;
foreach my $line (@lines) {
if (index($line, 'Volume ') == 0) {
@words = split " ", $line;
$vol_id = $words[1];
$vol_bus = $words[4];
$vol_target = (split ",", $words[6])[0];
$vol_type = $words[8];
} else {
@words = split " ", $line;
if ($words[0] eq "Volume") {
if ($words[1] eq "State:") {
$vol_state = (split ": ", $line)[1];
}
if ($words[1] eq "Size") {
$vol_size = (split " ", $line)[2]." ".(split " ", $line)[3];
$vol_size = (split ",", $vol_size)[0];
}
}
}

}
if (@vol_stats > 0) {
print "; ";
}
print "Ctrl $controller: ";
print "Vol ".$vol_id." (".$vol_bus.":".$vol_target."), ".$vol_type.", ".$vol_size.", ".$vol_state;
push @vol_stats, $vol_state;

}
}

# 0 - OK
# 1 - Warning
# 2 - CRITICAL
my $tmp_stat = 0;
foreach $vol_state (@vol_stats) {
if ((index($vol_state, 'degraded') != -1) and ($tmp_stat
I tried this plugin with LSIUtil-1.63. That worked well after doing 2 small fixes:

@@ -40,7 +40,7 @@

$output = `$lsiutil -p 0 -a 0`;
for (split /^/, $output) {
- if ( m|^\s*(\d+)\..*/proc/mpt/ioc| ) {
+ if ( m|^\s*(\d+)\..*ioc| ) {
push @controllers, $1;
}
}
@@ -63,7 +63,7 @@
push @volumes, "No volume found";
} else {
foreach my $volume_status ( @volumes ) {
- $status = $ERRORS{'CRITICAL'} unless ( $volume_status =~ /^Volume \d+ State: optimal, enabled$/ );
+ $status = $ERRORS{'CRITICAL'} unless ( $volume_status =~ /Volume \d+ State: optimal, enabled/ );
}
}
print "Ctrl $controller: ".join (' / ', @volumes)."\n";


For info, the server I use is a Dell PowerEdge R310, with PERC H200 RAID controler