Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 350029 - sys-apps/cciss_vol_status daily cron job to check status of the arrays
Summary: sys-apps/cciss_vol_status daily cron job to check status of the arrays
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Tony Vroon (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-29 09:47 UTC by Oleg Gawriloff
Modified: 2012-01-27 13:12 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oleg Gawriloff 2010-12-29 09:47:59 UTC
It would be nice if cciss_vol_status ebuild includes daily cronjob to check status of the arrays as proposed http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg826645.html
here.

Reproducible: Always
Comment 1 Tony Vroon (RETIRED) gentoo-dev 2011-03-18 15:41:34 UTC
I would suggest a cronjob like this:

#!/bin/bash
cciss_vol_status /dev/cciss/c*d0 &> /dev/null
if [ "$?" -eq 0 ]; then
        exit 0
fi
cciss_vol_status /dev/cciss/c*d0

Please confirm that you agree with the basic premise of not e-mailing until something goes awry. Could you also test that the script behaves as expected on your system.
I have tested on SmartArray P400i systems (DL365 G1 & DL385 G2).
Comment 2 Oleg Gawriloff 2011-03-18 15:55:41 UTC
I've already using this more then 3 month now without any problems:

#!/bin/sh

test -x /usr/bin/cciss_vol_status || exit 0

STATUS=0

if [ -d /proc/driver/cciss ]; then
   DEVS=`grep -h 'cciss/c.*d0:' /proc/driver/cciss/cciss* |awk -F: '{print "/dev/" $1}'`
   OUTPUT=`/usr/bin/cciss_vol_status $DEVS`
   if [ $? -ne 0 ];  then
        printf "%s\n" "$OUTPUT"
        exit 1
   fi
fi
# FIXME: This cronjob should also look at the scsi generic nodes
# (/dev/sg*?) to cover the hpsa driver, fibre-attached MSA1000 family
# devices, orthehpahcisr software RAID driver (see cciss_vol_status(8)
# about how to choose the correct nodes -- i don't use these other
# devices, so i cannot verify how to check them cleanly)
#
exit 0

It basically the same as your suggestion (with some improvements such are checking for ciss drivers and calling cciss_vol_status only once), therefore any of them will do.
Comment 3 Tony Vroon (RETIRED) gentoo-dev 2012-01-27 13:12:33 UTC
My apologies for the excessive delay Oleg, I lost track of this. It is in CVS now.

+*cciss_vol_status-1.09-r1 (27 Jan 2012)
+
+  27 Jan 2012; Tony Vroon <chainsaw@gentoo.org> -cciss_vol_status-1.02.ebuild,
+  -cciss_vol_status-1.06.ebuild, +cciss_vol_status-1.09-r1.ebuild,
+  +files/cciss_vol_status.cron:
+  Added cron job to check volume status on a daily basis and e-mail for errors.
+  Suggestion & implementation by Oleg Gawriloff, closes bug #350029. Removed
+  old ebuilds.