summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>2006-01-13 18:07:52 +0000
committerwollman <wollman@FreeBSD.org>2006-01-13 18:07:52 +0000
commitc637bc1255a79866855fc57d4eec8772f76760da (patch)
tree24216b2b8c966ac4ca96a3b38c330ead1dce0cd0 /etc
parentb465ab1edcac859c8858399b4b0f87404d5f82c8 (diff)
downloadFreeBSD-src-c637bc1255a79866855fc57d4eec8772f76760da.zip
FreeBSD-src-c637bc1255a79866855fc57d4eec8772f76760da.tar.gz
Add a daily script to show the status of gmirror(8) devices.
Diffstat (limited to 'etc')
-rw-r--r--etc/defaults/periodic.conf3
-rw-r--r--etc/periodic/daily/406.status-gmirror34
2 files changed, 37 insertions, 0 deletions
diff --git a/etc/defaults/periodic.conf b/etc/defaults/periodic.conf
index fd0cd1a..c839864 100644
--- a/etc/defaults/periodic.conf
+++ b/etc/defaults/periodic.conf
@@ -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
diff --git a/etc/periodic/daily/406.status-gmirror b/etc/periodic/daily/406.status-gmirror
new file mode 100644
index 0000000..8fc698c
--- /dev/null
+++ b/etc/periodic/daily/406.status-gmirror
@@ -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
OpenPOWER on IntegriCloud