Add a daily script to show the status of gmirror(8) devices.
This commit is contained in:
parent
28cda5420f
commit
9960bd718b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=154304
@ -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
|
||||
|
34
etc/periodic/daily/406.status-gmirror
Normal file
34
etc/periodic/daily/406.status-gmirror
Normal 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
|
Loading…
Reference in New Issue
Block a user