1833784 Members
2315 Online
110063 Solutions
New Discussion

Mirrordisk check

 

Mirrordisk check

Hi guys,

Is there a script that checks the proper installation and configuration of mirrordisk and if a disk is failing for 11.2 and 11.3 ?
I'd like to add it to my monitoring.

Or is there a script repository/website that holds HP-UX specific stuff ? That could help me with ideas to automate stuff.

Cheers.
4 REPLIES 4
Shrikant Lavhate
Esteemed Contributor

Re: Mirrordisk check

Hi,

>Proper installation of mirrordisk

It can be checked in lvdisplay output and grepping number of mirrors.

Under mirror more you will concern about is disk failure i guess. So, to chk for stale PE's you can use:

#lvdisplay -v /dev/vg00/lvol* | grep -i stale



>is there a script repository/website that holds HP-UX specific stuff ?

Check this sites:

http://hpux.cs.utah.edu/
http://www.hpux.ws/

And also check this thread.... Full of many scripts .. very useful.

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=51050

-=ShRi=-


Will it remain a personal, if I broadcast it here!
Avinash Agarkar
Valued Contributor

Re: Mirrordisk check

Hi,

I have a good script for checking for the stale in mirror or disk too.

for i in `vgdisplay -v vg00 | grep available | awk '{print $3}' | cut -c 1-9`
do
if [ $i = stale ]
then
echo " disk fail "
else
echo " disk ok "
fi
done

copy in a file and change the file permission and run.

Thanks,
Avinash
Great Power Comes With Great Responsibility
VK2COT
Honored Contributor

Re: Mirrordisk check

Hello,

Others already gave you some good advice.
LVM is quite easy through vgdisplay and
lvdisplay.

During this week I worked on adding
similar support for VxVM on HP-UX too:

http://www.circlingcycle.com.au/Unix-sources/HP-UX-check-OAT.pl.txt

I also added some support for
checking Network Node Manager 8.x.

Cheers,

VK2COT
VK2COT - Dusan Baljevic
Geoff Wild
Honored Contributor

Re: Mirrordisk check

Here's a script we use to check if the root disk is mirrored:

Rgds...Geoff

#!/bin/ksh
# script to check mirror(s) on vg00
# Geoff Wild 3/19/2003
#set -x

admin1=you@yourdomain.com
host_name=`hostname`

do_mirrordisk() {
echo "------------------------------------------------"
echo " checking the root disk vg00 on $host_name "
echo "------------------------------------------------"

for lvol in `/usr/sbin/vgdisplay -v vg00 |grep "LV Name" |awk '{print $3}'`
do
mirror=`/usr/sbin/lvdisplay -v ${lvol} |grep Mirror |awk '{print $3}'`
if [ $mirror -lt 1 ]
then
echo "Root Mirror disk for ${lvol} has no mirror..."
/usr/sbin/lvdisplay -v ${lvol} |grep Mirror > /tmp/MIRRPT
mailx -s "ALERT: $host_name Root Mirror for ${lvol} has no mirror..." $admin1 fi
stale=`/usr/sbin/lvdisplay -v ${lvol} | grep stale | wc -l`
if [ $stale -ge 1 ]
then
echo "Root Mirror disk for lvol${lvol} is down, please check ..."
/usr/sbin/lvdisplay -v ${lvol} | grep stale | head > /tmp/MIRRPT
mailx -s "ALERT: $host_name Root Mirror Disk for ${lvol} is down !" $admin1 < /tmp/MIRRPT
else
echo "Root Mirror Disk for ${lvol} is Okay !"
fi
done

}

do_mirrordisk
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.