forked from Matty9191/misc-shell-scripts
-
Notifications
You must be signed in to change notification settings - Fork 1
/
vxvmstatus
51 lines (42 loc) · 1.09 KB
/
vxvmstatus
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
#
# Program: VxVM Status <vxvmstatus.sh>
#
# Author: Matty < matty91 at gmail dot com >
#
# Current Version: 1.0
#
# Revision History:
#
# Version 1.0
# Original release
#
# Last Updated: 04-13-2001
EMAIL="[email protected]"
STATUS=0
VXPRINT="/usr/sbin/vxprint"
VXDISK="/usr/sbin/vxdisk"
EGREP="/usr/bin/egrep -i"
MAIL="/usr/bin/mailx"
# Check if various utilities are installed
if [ ! -f ${VXPRINT} ] || [ ! -f ${VXDISK} ] || [ ! -f ${EGREP ]; then
echo "Cannot find one or more required utilities"
exit 0
fi
# Check for Disabled or detached plexes/volumes/subdisks
if ${VXPRINT} -ht | ${EGREP} '([D]ISABLED|[D]ETACHED)' > /dev/null; then
echo "Veritas Volumes are either disabled or detached"
if [ -f ${MAIL} ]; then
${VXPRINT} -ht | ${MAIL} -s "Plex/Volume Failure Detected" ${EMAIL}
fi
STATUS=1
fi
# Check for Failing disks
if ${VXDISK} list | ${EGREP} [F]AIL > /dev/null; then
echo "Veritas Disk Failing\n"
if [ -f ${MAIL} ]; then
${VXPRINT} -ht | ${MAIL} -s "Device Failure detected" ${EMAIL}
fi
STATUS=1
fi
exit ${STATUS}