From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Oct 8 13:40:07 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5183E106566B for ; Mon, 8 Oct 2012 13:40:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 22E248FC0A for ; Mon, 8 Oct 2012 13:40:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q98De6DK053716 for ; Mon, 8 Oct 2012 13:40:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q98De6Q2053715; Mon, 8 Oct 2012 13:40:06 GMT (envelope-from gnats) Resent-Date: Mon, 8 Oct 2012 13:40:06 GMT Resent-Message-Id: <201210081340.q98De6Q2053715@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Leonid Nevecherya Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EF0BE1065670 for ; Mon, 8 Oct 2012 13:35:56 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id D98B88FC1C for ; Mon, 8 Oct 2012 13:35:56 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id q98DZuiZ051923 for ; Mon, 8 Oct 2012 13:35:56 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id q98DZuuq051922; Mon, 8 Oct 2012 13:35:56 GMT (envelope-from nobody) Message-Id: <201210081335.q98DZuuq051922@red.freebsd.org> Date: Mon, 8 Oct 2012 13:35:56 GMT From: Leonid Nevecherya To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/172486: [patch] sysutils/cciss_vol_status: Add daily periodic script X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Oct 2012 13:40:07 -0000 >Number: 172486 >Category: ports >Synopsis: [patch] sysutils/cciss_vol_status: Add daily periodic script >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Mon Oct 08 13:40:06 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Leonid Nevecherya >Release: >Organization: >Environment: FreeBSD XXXX 8.3-RELEASE-p3 FreeBSD 8.3-RELEASE-p3 >Description: Add daily periodic script cciss_vol_status. Script have parameters daily_cciss_vol_status_flags="-s" Default check SMART status of array disks, daily_cciss_vol_status_extra_status_flags="-V" Default full programm output on problem array, daily_cciss_vol_status_devices This is list of ciss devices to monitor or AUTO to monitor all devices. >How-To-Repeat: >Fix: Patch attached with submission follows: diff -ruN /usr/ports/sysutils/cciss_vol_status/Makefile sysutils/cciss_vol_status/Makefile --- /usr/ports/sysutils/cciss_vol_status/Makefile 2012-08-20 20:03:59.000000000 +0400 +++ sysutils/cciss_vol_status/Makefile 2012-10-08 17:21:38.000000000 +0400 @@ -7,6 +7,7 @@ PORTNAME= cciss_vol_status PORTVERSION= 1.10 +PORTREVISION= 1 CATEGORIES= sysutils MASTER_SITES= SF/cciss/${PORTNAME} @@ -27,4 +28,8 @@ IGNORE= cciss_vol_status requires kernel sources of the ciss driver .endif +post-install: + ${MKDIR} ${PREFIX}/etc/periodic/daily + ${INSTALL_SCRIPT} ${WRKDIR}/cciss_vol_status ${PREFIX}/etc/periodic/daily/cciss_vol_status + .include diff -ruN /usr/ports/sysutils/cciss_vol_status/files/cciss_vol_status.in sysutils/cciss_vol_status/files/cciss_vol_status.in --- /usr/ports/sysutils/cciss_vol_status/files/cciss_vol_status.in 1970-01-01 03:00:00.000000000 +0300 +++ sysutils/cciss_vol_status/files/cciss_vol_status.in 2012-10-08 17:13:55.000000000 +0400 @@ -0,0 +1,60 @@ +#!/bin/sh +# This is script to test CISS volumes +# Author: Leonid Nevecherya +# Maked from smart check script by original author: Garrett Wollman. $FreeBSD: ports/sysutils/smartmontools/files/smart.in,v 1.12 2011/12/01 20:53:31 dinoex Exp $ +# + + +if [ -r /etc/defaults/periodic.conf ]; then + . /etc/defaults/periodic.conf + source_periodic_confs +fi + +cciss_vol_status=%%PREFIX%%/bin/cciss_vol_status +: ${daily_cciss_vol_status_flags="-s"} +: ${daily_cciss_vol_status_extra_status_flags="-V"} + +case "${daily_cciss_vol_status_devices}" in + # XXX AUTO mode selects only regular ad/da disks + [Aa][Uu][Tt][Oo]) + daily_cciss_vol_status_devices="$(ls /dev/ciss*)" + ;; + *) ;; +esac + + +if [ -z "${daily_cciss_vol_status_devices}" ]; then + : ${daily_cciss_vol_status_enable="NO"} +else + : ${daily_cciss_vol_status_enable="YES"} +fi + +tmpfile="$(mktemp -t daily)" +trap "rm -f ${tmpfile}" 0 1 3 15 + +rc=0 +case "${daily_cciss_vol_status_enable}" in + [Yy][Ee][Ss]) + echo + echo 'CISS volumes status:' + cd /dev + for device in ${daily_cciss_vol_status_devices}; do + if [ -e ${device} ]; then + echo -n "Checking health of ${device}: " + ${cciss_vol_status} ${daily_cciss_vol_status_flags} \ + ${device} > "${tmpfile}" + status=$? + if [ ${status} -eq 0 ]; then + echo "OK" + else + rc=1 + ${cciss_vol_status} \ + ${daily_cciss_vol_status_extra_status_flags} \ + ${device} + fi + fi + done + ;; +esac + +exit "${rc}" diff -ruN /usr/ports/sysutils/cciss_vol_status/pkg-plist sysutils/cciss_vol_status/pkg-plist --- /usr/ports/sysutils/cciss_vol_status/pkg-plist 1970-01-01 03:00:00.000000000 +0300 +++ sysutils/cciss_vol_status/pkg-plist 2012-10-08 17:25:36.000000000 +0400 @@ -0,0 +1,4 @@ +etc/periodic/daily/cciss_vol_status +bin/cciss_vol_status +@dirrmtry etc/periodic/daily +@dirrmtry etc/periodic >Release-Note: >Audit-Trail: >Unformatted: