[nycbug-talk] fave BSD tips/tricks?
Charles Sprickman
spork at bway.net
Mon Aug 24 18:24:01 EDT 2009
On Mon, 24 Aug 2009, George Rosamond wrote:
> RAID STATUSES DAILY
>
> I get lots of dailies. . . and always add the following to cron on its own:
> status of RAIDs on the local box. Every blob or BSD software raid solution
> has its 'status' check, and seeing an email specific on that makes me sleep
> better.
That's a good one.
For gmirror, at some point this file showed up in /etc/periodic/daily:
/etc/periodic/daily/406.status-gmirror
Which is activated by setting daily_status_gmirror_enable="YES" in
/etc/periodic.conf.
Actually, just looking through /etc/defaults/periodic.conf is handy as
well. You can combine your daily and security emails into one, turn off
checks that you don't need (ie: the r* checks), and basically trim your
daily reports down to something more manageable.
Back to RAID, some cards, like the LSI stuff in Dells that use the mpt
driver have no utility to manage or check the status. But there is some
info on "non-optimal volumes" available in the sysctl output. Some other
drivers with no management software may do the same.
Regardless, here's a silly shell script I dumped in
/usr/local/etc/periodic/daily to put RAID status in my daily emails:
----
#!/bin/sh
# show number of non-optimal drives attached to mpt raid card
NONOPT=`/sbin/sysctl -n dev.mpt.0.nonoptimal_volumes`
echo
echo "Checking MPT RAID array"
echo
if [ $NONOPT -eq 0 ]; then
echo "No non-optimal volumes: ($NONOPT)"
elif [ $NONOPT -ne 0 ]; then
echo "WARNING, $NONOPT non-optimal volumes!"
fi
----
Charles
>
> g
>
More information about the talk
mailing list