Last active
May 25, 2016 16:23
-
-
Save jazzl0ver/28fdcd63ecbb5c2807463b7ac3482951 to your computer and use it in GitHub Desktop.
Check array I/O performance on Dell MD3000i/MD3200i/etc iSCSI-SAN
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
# | |
# Check array performance on Dells MD3000i iSCSI-SAN | |
# You need SMcli installed to use this check. It's part of | |
# Dells MDSM package. | |
# Also Sys::Alone Perl library is required | |
# | |
# Performance counters description: http://en.community.dell.com/techcenter/storage/w/wiki/md3000i-performance-monitoring | |
# | |
# Version 1.0 | |
# | |
# Based on check_md3000i.pl script (https://exchange.nagios.org/directory/Plugins/Hardware/Storage-Systems/SAN-and-NAS/check_md3000i/details) | |
# | |
# Copyright (C) 2016 jazzl0ver | |
# | |
# 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 2 of the License, or | |
# (at your option) any later version. | |
# | |
# This program 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 program; if not, write to the Free Software | |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
use lib '/usr/lib/perl5/vendor_perl/5.8.8/'; | |
use strict; | |
use Getopt::Std; | |
use Sys::RunAlone; | |
#Change this to fit your installation | |
my $SMcli="/opt/dell/mdstoragemanager/client/SMcli"; | |
my $tmp_perf="/tmp/.md3200i_perfdata"; | |
my %options=(); | |
getopts("H:",\%options); | |
if(!defined $options{H}) | |
{ | |
die("Usage: check_md3000i_perf.pl -H host"); | |
} | |
my $host = $options{H}; | |
#Execute SMcli command | |
my $cmd = "$SMcli $host -S -c \"set session performanceMonitorInterval=3; save storageArray performanceStats file=\\\"$tmp_perf\\\";\";"; | |
system($cmd) == 0 || die("Could not execute $cmd"); | |
if(!open(PIPE, "/bin/cat $tmp_perf | /bin/grep 'Storage Array' | /bin/grep -v 'Performance' |")) | |
{ | |
die("$tmp_perf not found or read error"); | |
} | |
my $csv_data = <PIPE>; | |
close(PIPE); | |
my @tmp_data = split("\",\"", $csv_data); | |
my $object = $tmp_data[0]; $object =~ s/\"//g; | |
my $total_io = $tmp_data[1]; | |
my $read_prcnt = $tmp_data[2]; | |
my $read_cache_hit = $tmp_data[3]; | |
my $write_cache_hit = $tmp_data[4]; | |
my $ssd_read_cache_hit = $tmp_data[5]; | |
my $cur_rate = int($tmp_data[6]*1024*1024); | |
my $max_rate = int($tmp_data[7]*1024*1024); | |
my $cur_io_rate = $tmp_data[8]; | |
my $max_io_rate = $tmp_data[9]; | |
my $min_io_rate = $tmp_data[10]; | |
my $avg_io_rate = $tmp_data[11]; | |
my $min_rate = int($tmp_data[12]*1024*1024); | |
my $avg_rate = int($tmp_data[13]*1024*1024); | |
my $retcode = $?; | |
my $info = ""; | |
my $ret = 0; | |
$info = "OK - $object |cur_rate=$cur_rate cur_io_rate=$cur_io_rate read_prcnt=$read_prcnt\n"; | |
print $info; | |
exit $ret; | |
__END__ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment