From 4900b29f97a7553bbad9c5252c404977b1948699 Mon Sep 17 00:00:00 2001 From: "Vincent S. Cojot" Date: Fri, 10 Feb 2012 15:52:33 -0500 Subject: [PATCH] Added Drive Temperature.. (Rev 1.5) --- wrapper-scripts/megaclisas-status | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wrapper-scripts/megaclisas-status b/wrapper-scripts/megaclisas-status index 3125eac..9df59a5 100755 --- a/wrapper-scripts/megaclisas-status +++ b/wrapper-scripts/megaclisas-status @@ -1,5 +1,5 @@ #!/usr/bin/python -# $Id: megaclisas-status,v 1.4 2012/01/27 12:13:18 root Exp $ +# $Id: megaclisas-status,v 1.5 2012/02/10 15:52:33 root Exp $ import os import re @@ -88,6 +88,7 @@ def returnDiskInfo(output,controllerid): state = 'Offline' model = 'Unknown' speed = 'Unknown' + temp = 'Unk0C' for line in output: if re.match(r'^Virtual Drive: [0-9]+.*$',line.strip()): arrayid = line.split('(')[0].split(':')[1].strip() @@ -104,9 +105,11 @@ def returnDiskInfo(output,controllerid): model = re.sub(' +', ' ', model) if re.match(r'Device Speed: .*$',line.strip()): speed = line.split(':')[1].strip() + if re.match(r'Drive Temperature :.*$',line.strip()): + temp = line.split(':')[1].strip() if model != 'Unknown': #### print str(arrayid)+' '+str(diskid)+' '+str(olddiskid) - table.append([str(arrayid), str(diskid), state, model, speed]) + table.append([str(arrayid), str(diskid), state, model, speed, temp]) return table cmd = 'megacli -adpCount -NoLog' @@ -163,7 +166,7 @@ while controllerid < controllernumber: output = getOutput(cmd) arraydisk = returnDiskInfo(output,controllerid) for array in arraydisk: - print 'c'+str(controllerid)+'u'+array[0]+'p'+array[1]+' | '+array[3]+' | '+array[2]+' ('+array[4]+')' + print 'c'+str(controllerid)+'u'+array[0]+'p'+array[1]+' | '+array[3]+' | '+array[2]+' | '+array[4]+' | '+array[5] controllerid += 1 if bad: