From 3a03488f870f915b5d51d37d403de77c8b3edd09 Mon Sep 17 00:00:00 2001 From: Joe Hofeditz Date: Thu, 16 Oct 2014 06:30:02 -0700 Subject: [PATCH 1/2] verify that array exists on controller --- wrapper-scripts/sas2ircu-status | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/wrapper-scripts/sas2ircu-status b/wrapper-scripts/sas2ircu-status index 9aeba06..a4ca3dd 100755 --- a/wrapper-scripts/sas2ircu-status +++ b/wrapper-scripts/sas2ircu-status @@ -4,7 +4,7 @@ import os import re import sys -binarypath = "/usr/sbin/sas2ircu" +binarypath = "/sbin/sas2ircu" if len(sys.argv) > 2: print 'Usage: sas2ircu-status [--nagios]' @@ -42,12 +42,18 @@ def getCtrlList(): for line in res: if re.match('^[0-9]+.*$',line): ctrlnmbr,ctrlname=int(line.split()[0]),line.split()[1] - # Check if it's a RAID controller + # Check if it's a RAID controller and a volume exists cmd=binarypath+' '+str(ctrlnmbr)+' DISPLAY' res=getOutput(cmd) + raid=False + validarray=False for line in res: if re.match('^RAID Support\s+:\s+Yes$',line): - list.append([ctrlnmbr,ctrlname]) + raid=True + if re.match('^IR volume [0-9]+.*$',line): + validarray=True + if raid and validarray: + list.append([ctrlnmbr,ctrlname]) # ie: [['0', 'SAS2008']] return list From 5297b3ef5e27f3f9f73991374c98f6bf8bb11020 Mon Sep 17 00:00:00 2001 From: Joe Hofeditz Date: Thu, 16 Oct 2014 06:35:04 -0700 Subject: [PATCH 2/2] restore original sas2ircu path --- wrapper-scripts/sas2ircu-status | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrapper-scripts/sas2ircu-status b/wrapper-scripts/sas2ircu-status index a4ca3dd..03108bc 100755 --- a/wrapper-scripts/sas2ircu-status +++ b/wrapper-scripts/sas2ircu-status @@ -4,7 +4,7 @@ import os import re import sys -binarypath = "/sbin/sas2ircu" +binarypath = "/usr/sbin/sas2ircu" if len(sys.argv) > 2: print 'Usage: sas2ircu-status [--nagios]'