ports/123697: [PATCH] sysutils/linux-megacli: Fix periodic script after update
Ulrich Spoerlein
uspoerlein at gmail.com
Fri May 30 16:00:21 UTC 2008
The following reply was made to PR ports/123697; it has been noted by GNATS.
From: Ulrich Spoerlein <uspoerlein at gmail.com>
To: bug-followup at FreeBSD.org
Cc:
Subject: Re: ports/123697: [PATCH] sysutils/linux-megacli: Fix periodic script after update
Date: Fri, 30 May 2008 09:42:24 +0200
--AqsLC8rIMeq19msA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Thu, 22.05.2008 at 21:02:11 +0200, Ruben van Staveren wrote:
> > - Take some other random field for the battery ok status
> You have a 'iBBU', I have a 'BBU'
Another one of our systems prints iTBBU (older version of megacli,
though). Therefore I widened the field to 5 chars.
> isok is better initialised as "N/A" instead of -1
I opted for "-" as that is visually less "fat" than N/A
> > - Print units with battery output (makes it more clear what the columns
> > mean, IMHO)
> Ok, but CC stands for Cycle Count so that cannot be in mAh
Thanks, fixed!
> Can you do a second version of your patch ?
attached.
Cheers,
Ulrich Spoerlein
--AqsLC8rIMeq19msA
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="megacli.diff"
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/sysutils/linux-megacli/Makefile,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile
--- Makefile 19 Mar 2008 03:23:36 -0000 1.6
+++ Makefile 30 May 2008 07:34:16 -0000
@@ -7,6 +7,7 @@
PORTNAME= megacli
PORTVERSION= 1.01.40
+PORTREVISION= 1
CATEGORIES= sysutils linux
MASTER_SITES= http://www.lsi.com/support/downloads/megaraid/miscellaneous/linux/
PKGNAMEPREFIX= linux-
Index: files/407.status-mfi-raid.in
===================================================================
RCS file: /home/ncvs/ports/sysutils/linux-megacli/files/407.status-mfi-raid.in,v
retrieving revision 1.3
diff -u -p -r1.3 407.status-mfi-raid.in
--- files/407.status-mfi-raid.in 17 Apr 2008 20:07:53 -0000 1.3
+++ files/407.status-mfi-raid.in 30 May 2008 07:42:07 -0000
@@ -67,7 +67,7 @@ for ctrl in `jot ${ADPCOUNT} ${ADPMINIDX
E=-1; S=-1; D=-1; s=-1; mec=-1; oec=-1; pfc=-1; lpfeqn=-1;
state="";
}
- /^Enclosure Number:/ { E=$3; }
+ /^Enclosure (Number|Device ID):/ { E=$3; }
/^Slot Number:/ { S=$3; }
/^Device Id:/ { D=$3; }
/^Sequence Number:/ { s=$3; }
@@ -127,12 +127,11 @@ for ctrl in `jot ${ADPCOUNT} ${ADPMINIDX
}
}
'
- echo
- echo "BBU Information:"
+ # Print BBU Information, if we found something
${megacli} -AdpBbuCmd -a${ctrl} | \
awk '
BEGIN {
- type=""; temp=-1; isok=-1; rsoc=-1; asoc=-1;
+ type=""; temp=-1; isok="-"; rsoc=-1; asoc=-1;
rc=-1; cc=-1; me=-1;
}
/^BatteryType:/ { type=$2; }
@@ -144,13 +143,15 @@ for ctrl in `jot ${ADPCOUNT} ${ADPMINIDX
/^Cycle Count:/ { cc=$3; }
/^Max Error:/ { me=$3; }
END {
- printf "TYPE TEMP OK RSOC ASOC RC CC ME\n";
- printf "%-4s %-2d C %-4s %-5d %-5d %-5d %-5d %-2d\n",
+ if (type == "") { exit 0 };
+ printf "\nBBU Information:\n"
+ printf "TYPE TEMP OK RSOC ASOC RC CC ME\n";
+ printf "%-5s %2dC %-3s %4d%% %4d%% %4dmAh %4d %2d%%\n",
type, temp, isok, rsoc, asoc, rc, cc, me;
}
'
- echo
+ echo
# Give very long outputs.
case "$daily_status_mfi_raid_verbose" in
--AqsLC8rIMeq19msA--
More information about the freebsd-ports-bugs
mailing list