Date: Sun, 11 Jun 2006 10:34:46 +0000 (UTC) From: "Bjoern A. Zeeb" <bzeeb+freebsdports@zabbadoz.net> To: FreeBSD-gnats-submit@FreeBSD.org Cc: "Bjoern A. Zeeb" <bzeeb+freebsdports@zabbadoz.net> Subject: ports/98803: [new port] sysutils/amrstat Message-ID: <20060611103446.E6C36489B53@storage.int.zabbadoz.net> Resent-Message-ID: <200606111150.k5BBoAJp006405@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 98803 >Category: ports >Synopsis: [new port] sysutils/amrstat >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Jun 11 11:50:09 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Bjoern A. Zeeb >Release: FreeBSD 7.0-CURRENT amd64 >Organization: Zabbadoz.NeT >Environment: System: FreeBSD foo 7.0-CURRENT FreeBSD 7.0-CURRENT #4: Tue Jun 6 19:19:12 UTC 2006 bz@foo:/path/to/HEAD/sys/KERNEL amd64 >Description: new port sysutils/amrstat: This port provides an utility for getting information from LSI Logic's MegaRAID RAID controllers. It also includes a daily periodic script that (optionally) also makes use of sysutils/megarc. >How-To-Repeat: >Fix: The port source is also available as tarball from http://sources.zabbadoz.net/freebsd/ports/experimental/ \ sysutils-amrstat-20060611-01.tar # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # sysutils/amrstat/ # sysutils/amrstat/Makefile # sysutils/amrstat/pkg-descr # sysutils/amrstat/distinfo # sysutils/amrstat/pkg-plist # sysutils/amrstat/files # sysutils/amrstat/files/407.status-amr-raid.in # echo c - sysutils/amrstat/ mkdir -p sysutils/amrstat/ > /dev/null 2>&1 echo x - sysutils/amrstat/Makefile sed 's/^X//' >sysutils/amrstat/Makefile << 'END-of-sysutils/amrstat/Makefile' X# Ports collection makefile for: amrstat X# Date created: 2006-04-11 X# Whom: "Bjoern A. Zeeb" <bzeeb+freebsd+ports@zabbadoz.net> X# X# $FreeBSD$ X# X XPORTNAME= amrstat XPORTVERSION= 20060414 XCATEGORIES= sysutils XMASTER_SITES= http://people.freebsd.org/~jkim/ XDISTNAME= ${PORTNAME}-${PORTVERSION} X XMAINTAINER= bzeeb+freebsd+ports@zabbadoz.net XCOMMENT= Utility for LSI Logic's MegaRAID RAID controllers X XOPTIONS= MEGARC "Also install LSI megarc binary port.." off X X.include <bsd.port.pre.mk> X X# We may want this for periodic script and to actually be able X# to fix something in case amrstat reports degraded RAID. X.if defined(WITH_MEGARC) XRUN_DEPENDS= ${LOCALBASE}/sbin/megarc:${PORTSDIR}/sysutils/megarc X.endif X XUSRSRC?= /usr/src XSYSDIR= ${USRSRC}/sys XAMRSRC= ${SYSDIR}/dev/amr X XMAKE_ENV= SYSDIR=${SYSDIR} XALL_TARGET= ${PORTNAME} X XLOCALSRCDIR= ${.CURDIR}/files XPERIODICSCRIPT= 407.status-amr-raid X XNO_WRKSUBDIR= yes X XSUB_FILES+= ${PERIODICSCRIPT} X Xpost-extract: X @if [ ! -d ${AMRSRC} ]; then \ X ${ECHO} "=================================================="; \ X ${ECHO} "You need amr(4) sources in"; \ X ${ECHO} " ${AMRSRC}"; \ X ${ECHO} "to build this port."; \ X ${ECHO} "If your sources are not in ${USRSRC} set USRSRC."; \ X ${ECHO} "=================================================="; \ X exit 1; \ X fi X ${RM} -f ${WRKSRC}/amrstat X Xdo-install: X ${INSTALL_PROGRAM} ${WRKSRC}/amrstat ${PREFIX}/sbin X ${INSTALL_SCRIPT} -d ${PREFIX}/etc/periodic/daily X ${INSTALL_SCRIPT} ${WRKDIR}/${PERIODICSCRIPT} ${PREFIX}/etc/periodic/daily X X.include <bsd.port.post.mk> END-of-sysutils/amrstat/Makefile echo x - sysutils/amrstat/pkg-descr sed 's/^X//' >sysutils/amrstat/pkg-descr << 'END-of-sysutils/amrstat/pkg-descr' XThis port provides an utility for getting information from XLSI Logic's MegaRAID RAID controllers. X XWWW: http://lists.freebsd.org/pipermail/freebsd-scsi/2006-February/002294.html END-of-sysutils/amrstat/pkg-descr echo x - sysutils/amrstat/distinfo sed 's/^X//' >sysutils/amrstat/distinfo << 'END-of-sysutils/amrstat/distinfo' XMD5 (amrstat-20060414.tar.gz) = 851dc6d87ec2dc9c58c2c209df021a5e XSHA256 (amrstat-20060414.tar.gz) = 2d512aa700c1d965f70826a0acf41fbd2fe40f94bf110c5c4d2aad0887e27556 XSIZE (amrstat-20060414.tar.gz) = 30477 END-of-sysutils/amrstat/distinfo echo x - sysutils/amrstat/pkg-plist sed 's/^X//' >sysutils/amrstat/pkg-plist << 'END-of-sysutils/amrstat/pkg-plist' Xsbin/amrstat Xetc/periodic/daily/407.status-amr-raid X@dirrmtry etc/periodic/daily X@dirrmtry etc/periodic END-of-sysutils/amrstat/pkg-plist echo c - sysutils/amrstat/files mkdir -p sysutils/amrstat/files > /dev/null 2>&1 echo x - sysutils/amrstat/files/407.status-amr-raid.in sed 's/^X//' >sysutils/amrstat/files/407.status-amr-raid.in << 'END-of-sysutils/amrstat/files/407.status-amr-raid.in' X#!/bin/sh X# X# Show status of LSI Logic's MegaRAID RAID controllers. X# X# $FreeBSD$ X# X X# If there is a global system configuration file, suck it in. X# Xif [ -r /etc/defaults/periodic.conf ] Xthen X . /etc/defaults/periodic.conf X source_periodic_confs Xfi X X# Defaults. X: ${daily_status_amr_raid_enable:=NO} X: ${daily_status_amr_raid_megarc_enable:=NO} X Xamrstat=${amrstat:-%%PREFIX%%/sbin/amrstat} Xmegarc=${megarc:-%%PREFIX%%/sbin/megarc} Xlogdir=${logdir:-/var/log} X Xcase "$daily_status_amr_raid_enable" in X [Yy][Ee][Ss]) X echo X echo 'Checking status of amr(4) raid controllers:' X X rc=0 X X # Checking each controller. X for ctrl in `ls -1 /dev/amr[0-9]* | sed -e 's,/dev/amr,,g'` X do X echo "" X echo "Controller ${ctrl}:" X ctrl_log=${logdir}/amr_raid_${ctrl} X if test ! -f ${ctrl_log}.today; then X touch ${ctrl_log}.today X fi X mv -f ${ctrl_log}.today ${ctrl_log}.yesterday X ${amrstat} -c ${ctrl} -g > ${ctrl_log}.today X if test -x ${megarc}; then X case "$daily_status_amr_raid_megarc_enable" in X [Yy][Ee][Ss]) X ${megarc} -dispCfg -a0 | col -b | grep -v Scanning | \ X sed -e '/^A/s/.*/ .../g' >> ${ctrl_log}.today X ;; X *) ;; X esac X fi X lines=`wc -l ${ctrl_log}.today | awk '{ print $1 }'` X diff -u -${lines} ${ctrl_log}.yesterday ${ctrl_log}.today X raid_rc=$? X if test $raid_rc -eq 0; then X cat ${ctrl_log}.today X fi X [ $rc -eq 0 ] && [ $raid_rc -ne 0 ] && rc=3 X X # Checking alarms. X #if test -x ${megarc}; then X #case "$daily_status_amr_raid_megarc_enable" in X # [Yy][Ee][Ss]) X # echo "Alarms:" X # alarms_log=${logdir}/amr_raid_alarms X # ---------------------------------------- X # There seems to be following option but does not seem to X # show anything sor me so I cannot verify that it is what X # I expect: X # ${megarc} -getNVRAMLog -a${ctrl} X # For me IPMI has some logs though: X # DATE sel[1]: X # A Drive - Slot/Connector - Fault - Drive Array - Slot 2 X # ---------------------------------------- X # Keep following commented out until someone confirms that it X # does something useful for him. X # ---------------------------------------- X # if test ! -f ${alarms_log}.today; then X # touch ${alarms_log}.today X # fi X # mv -f ${alarms_log}.today ${alarms_log}.yesterday X # raid_rc=0 X # ${megarc} -getNVRAMLog -a${ctrl} > ${alarms_log}.today X # cmp -zs ${alarms_log}.yesterday ${alarms_log}.today X # raid_rc=$? X # if test $raid_rc -ne 0; then X # diff -u ${alarms_log}.yesterday ${alarms_log}.today X # else X # echo " No new alarms." X # fi X # [ $rc -eq 0 ] && [ $raid_rc -ne 0 ] && rc=3 X # ;; X #*) ;; X #esac X #fi X X done X ;; X X *) rc=0;; Xesac X Xexit $rc X X# end END-of-sysutils/amrstat/files/407.status-amr-raid.in exit >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060611103446.E6C36489B53>