Date: Mon, 26 Jun 2006 11:49:57 +0100 From: Scott Mitchell <scott+lists.freebsd@fishballoon.org> To: Alex Zbyslaw <xfb52@dial.pipex.com> Cc: Joao Barros <joao.barros@gmail.com>, freebsd-questions <freebsd-questions@freebsd.org> Subject: Re: Hot-Swapping hard drives on Dell PowerEdge 2850 running FBSD 5.5-PRE Message-ID: <20060626104957.GB67667@llama.fishballoon.org> In-Reply-To: <449FB7B2.7030808@dial.pipex.com> References: <2f488c030606221106q4183de17gbff80d696f704505@mail.gmail.com> <449BAE45.7030705@dial.pipex.com> <2f488c030606231113i2b9b4bdcsa1b4192be54b9011@mail.gmail.com> <70e8236f0606231240t77e1b510xd5ecd98c093af559@mail.gmail.com> <2f488c030606231623x662d93afl8ff4875989d143c8@mail.gmail.com> <70e8236f0606240917m2d872902sce15c7cbacbdbc36@mail.gmail.com> <449FB7B2.7030808@dial.pipex.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--LZvS9be/3tNcYl/X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jun 26, 2006 at 11:32:18AM +0100, Alex Zbyslaw wrote: > Joao Barros wrote: > > > > >Contrary to what megarc says, it's -h not -? for help. > >Hope this helps. > > > ? is special to the shell so you need to escape it with a \. > > h does not produce the same output for me - it's just treated as an > unknown command. It also doesn't work as a param to commands, but help > seems to. Yeah, megarc does have possibly the worst interface I've seen in quite a long time. Allegedly the Linux monitoring tools for these adapters will work with 6.1, although I haven't tried this myself yet. I've attached a couple of scripts I use for monitoring amr(4) adapters. One (amr-check-status) is run hourly from crontab to alert of any change in drive or array status. The other (700.amr-status) is a daily periodic script. They could be extended to grovel through the megarc output to figure out what adapters you have rather than just hardcoding the unit numbers, but that seemed like more pain that it was worth (and I don't have any machines with more than one adapter!) BTW, the '^M' in the amr-check-status script is a real Control-M character, and there are embedded tabs in a couple of the egrep patterns, in case those get lost in transit. Cheers, Scott -- =========================================================================== Scott Mitchell | PGP Key ID | "Eagles may soar, but weasels Cambridge, England | 0x54B171B9 | don't get sucked into jet engines" scott at fishballoon.org | 0xAA775B8B | -- Anon --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=amr-check-status #!/bin/sh -f # # Check status of RAID volumes on amr(4) controllers using the LSI MegaRC # utility. If any logical drive has a status other than OPTIMAL, or any # physical disks has a status other that ONLINE, display the full status # for the adapter. If more than one adapter exists, add additional unit # numbers to $adapters. # # $Id$ # adapters="0" for adapter in $adapters; do status=`/usr/local/sbin/megarc -ldinfo -a${adapter} -Lall -nolog |\ /usr/bin/sed '1,$s/ //' |\ /usr/bin/sed '1,/Information Of Logical Drive/d'` ||\ echo "Failed to get RAID status for AMR adapter ${adapter}" echo "${status}" |\ /usr/bin/egrep '^ Logical Drive : .*: Status: .*$' |\ /usr/bin/egrep -qv 'OPTIMAL$' drives=$? echo "${status}" |\ /usr/bin/egrep '^ [0-9]+' |\ /usr/bin/egrep -qv 'ONLINE$' disks=$? if [ ${drives} -ne 1 -o ${disks} -ne 1 ]; then echo "" echo "AMR RAID status (adapter ${adapter}):" echo "${status}" fi done --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="700.amr-status" #!/bin/sh -f # # Display status of RAID volumes on amr(4) controllers using the LSI MegaRC # utility. If more than one adapter exists, add additional unit numbers to # $adapters. # # $Id$ # # If there is a global system configuration file, suck it in. # if [ -r /etc/defaults/periodic.conf ]; then . /etc/defaults/periodic.conf source_periodic_confs fi adapters="0" rc=0 case "${daily_amr_status_enable:-YES}" in [Nn][Oo]) ;; *) for adapter in $adapters; do echo "" echo "AMR RAID status (adapter ${adapter}):" /usr/local/sbin/megarc -ldinfo -a${adapter} -Lall -nolog |\ sed '1,/Information Of Logical Drive/d' || rc=$? done ;; esac exit "$rc" --LZvS9be/3tNcYl/X--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060626104957.GB67667>