Add a daily script to show the status of gmirror(8) devices.

This commit is contained in:
Garrett Wollman 2006-01-13 18:07:52 +00:00
parent 28cda5420f
commit 9960bd718b
2 changed files with 37 additions and 0 deletions

View File

@ -91,6 +91,9 @@ daily_status_disks_df_flags="-k -t nonfs" # df(1) flags for check
# 405.status-ata_raid
daily_status_ata_raid_enable="NO" # Check ATA raid status
# 406.status-gmirror
daily_status_gmirror_enable="NO" # Check gmirror(8)
# 420.status-network
daily_status_network_enable="YES" # Check network status
daily_status_network_usedns="YES" # DNS lookups are ok

View File

@ -0,0 +1,34 @@
#!/bin/sh
#
# $FreeBSD$
#
# 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
case "$daily_status_gmirror_enable" in
[Yy][Ee][Ss])
echo
echo 'Checking status of gmirror(8) devices:'
if gmirror status; then
components="$(gmirror status -s | fgrep -v COMPLETE)"
if [ "${components}" ]; then
rc=3
else
rc=0
fi
else
rc=2
fi
;;
*) rc=0;;
esac
exit $rc