Vous êtes sur la page 1sur 10

Skip to content

Waldemar Mark Duszyk


AIX poznajmy go razem
nie AIX
Lekcje AIXu
Lekcje HACMP
Sutry
Umys
mirroring progress in aix
If you wonder why AIX does not really have any tools to report on the progress of mirroring you
are mistaken. Every time you execute the lsvg command against a volume group is returns
(among others) the number of the Stale partitions. You could also execute the lsvg -M and count
the number of the stale partitions. Both of these options, executed at an interval will deliver the
decreasing numbers of stale partitions which could be used to generate the progress.
What you have here, are a few lines of code that provide the answer nothing fancy.
#!/usr/bin/ksh93
### W.M. Duszyk, 3/2/12
### show percentage of mirrored PPs in a volume group

[[ $# < 1 ]] && { print "Usage: $0 vg_name"; exit 1; }

vg=$1

Stale=`lsvg $vg | grep 'STALE PPs:' | awk '{print $6}'`

[[ $Stale = 0 ]] && { print "$vg is fully mirrored."; exit 2; }

Total=`lsvg $vg | grep 'TOTAL PPs:' | awk '{print $6}'`

PercDone=$(( 100 - $(( $(( Stale * 50.0 )) / $Total )) ))

echo "Volume group $vg is mirrored $PercDone%."
If you decide to use this code (copy/paste), remember that each line above is really a single line of
characters!!! Your browser may distort this fact.
Have a good weekend!
UPDATE:
This script will work if the mirrorvg -S but not the syncvg command was used to create the
mirrors the second command locks the volume groups being synced while the first one does
not.
Posted in Real life AIX, scripts.
Page 1 of 10 mirroring progress in aix Waldemar Mark Duszyk
22/03/2012 http://www.wmduszyk.com/?p=8133&langswitch_lang=pl
Tagged with mirroring, mirrorvg, progress, syncvg.
3 comments
By MarkD:-) 2 March 2012
3 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.
Sebastian says
@Ramon: good idea using lscg -L to go get the data even when the vg is locked
5 March 2012, 2:35
1.
Mark says
I got to remember to use awk and its print function instead of using grep and awk
By the way, I think this will not work. I see you are trying to see if there are STALE
partitions, but you need to get their number too.
Thx
2 March 2012, 14:12
2.
Ramon says
A different version:
#!/usr/bin/ksh93
### W.M. Duszyk, 3/2/12
### show percentage of mirrored PPs in volume group
[[ $# < 1 ]] &vg=$1
# Changed to evade LVM locks
# Stale=`lsvg $vg | grep 'STALE PPs:' | awk '{print $6}'`
Stale=$(lsvg -L $vg | awk '/STALE PPs:/ {print $6}')
[[ $Stale = 0 ]] &# Changed to evade LVM locks
# Total=`lsvg $vg | grep 'TOTAL PPs:' | awk '{print $6}'`
Total=$(lsvg -L $vg | awk '/TOTAL PPs:/ {print $6}')
PercDone=$(( 100 $(( $(( Stale * 100.0 )) / $(( Total / 2.0 )) )) ))
echo "Volume group $vg is mirrored $PercDone%."
2 March 2012, 13:42
3.
Page 2 of 10 mirroring progress in aix Waldemar Mark Duszyk
22/03/2012 http://www.wmduszyk.com/?p=8133&langswitch_lang=pl
Share |
Leave a Reply

Some HTML is OK
Name (required)
Email (required, but never shared)
Web
Post comment or, reply to this post via trackback.
mkuser does not work.. recovering lost mpio disks
Subscribe

About Waldemar Mark Duszyk
A quote from a reader: Everything can be explain in a simple way, even rocket science. And you
proved it.
Search for: Search
Popular Tags
Najnowsze Posty
fixing offline paths in dlnkmgr environment.
matching Hitach and AIX FC adapters
san design quide for aix with mpio, sdddrv, pcmdrv
Page 3 of 10 mirroring progress in aix Waldemar Mark Duszyk
22/03/2012 http://www.wmduszyk.com/?p=8133&langswitch_lang=pl
identifying HDS ShadowImage disks in mpio environment
recovering lost mpio disks
mirroring progress in aix
mkuser does not work..
HDS (USP_V) hdisk/controller relationship
local print queue removal in AIX
installing Shadow Image on AIX host
removing orphaned home directories
using NIM to install mksysb image building spot from mksysb
mounting ISO images in AIX6.1
in-place editing of files
FC Adapters and the associated with them devices (disks and tapes)
Comments
MarkD:-) on mount WINdows shares on AIX host without SAMBA
John S on mount WINdows shares on AIX host without SAMBA
MarkD:-) on Wprowadzenie do HACMP
Brian weber on Wprowadzenie do HACMP
Mike Forster on vi fails to open large files
MarkD:-) on Rygorystyczna kontra Super Rygorystryczna polisa topograficzna
lukas on Rygorystyczna kontra Super Rygorystryczna polisa topograficzna
slashbone on mj lpar zawsze koczy boot w SMS
morroccan on Lekcja 4: Pracujc z dyskami
Sebastian on mirroring progress in aix
Mark on mirroring progress in aix
Ramon on mirroring progress in aix
MarkD:-) on local print queue removal in AIX
Ramon on local print queue removal in AIX
Marco on Lekcja 4: Pracujc z dyskami
AIX Links
A nice AIX site from Toronto, Canada Check its Samba pages.
Aix 6.1 + PowerVM + HDLM 3.01 + GPFS + Oracle Clusterware + Oracle RAC 11GR2
Good AIX info with links

AIX Installation Methods


Anthony English, AIX blog An excelent source of AIX info from Australia
Aussie Storage Blog with Anthony Vanderwerdt An excellent source of XIV info
Chris Gibson, AIX Blog An excelent source of AIX info from Australia
Everything AIX in one PLACE
Everything XIV
HMC Documentation
IBM Power Systems Hardware Information Center
IBM White Papers
Oracle Tunning Kevin Closson Blog
PERL little gems
Sed An Introduction and Tutorial by Bruce Barnett
SED little gems
Stefan Radtke XIV Storage Blog
StorageBuddhist SAN advice from New Zealand
Storm M Harris The starter Guide to NIM
Unix Shell Scripts Tips
Page 4 of 10 mirroring progress in aix Waldemar Mark Duszyk
22/03/2012 http://www.wmduszyk.com/?p=8133&langswitch_lang=pl
William Favorite All Things New
Page 5 of 10 mirroring progress in aix Waldemar Mark Duszyk
22/03/2012 http://www.wmduszyk.com/?p=8133&langswitch_lang=pl
Live Traffic Feed
See your visitors
in RealTime! Get the
Free Live Traffic Feed
Get Feedjit Now!
A visitor from
Nottingham viewed "fsck
all file systems of a
volume group
Waldemar Mark
Duszyk" 2 mins ago
A visitor from Oradea,
Bihor viewed "su does
not work Waldemar
Mark Duszyk" 3 mins
ago
A visitor from Denver,
Colorado viewed "Pass
Through Authentication
between TDS Ldap
servers and
ActiveDirectory over
SSL Waldemar Mark
Duszyk" 7 mins ago
A visitor from Madras,
Tamil Nadu viewed
"Waldemar Mark
Duszyk - [lang_en]AIX -
learn it and share it
[/lang_en][lang_pl]AIX -
poznajmy go razem
[/lang_pl]" 8 mins ago
A visitor from Gosport,
Hampshire viewed
"changing passwords
remotely via ssh script
Waldemar Mark
Duszyk" 8 mins ago
A visitor from Paris, Ile-
de-France viewed "0516-
1339 mkvg: Physical
volume contains some
3rd party volume group
Waldemar Mark
Duszyk" 13 mins ago
A visitor from
Yekaterinburg,
Sverdlovsk viewed
"Working with HMC
command line
Page 6 of 10 mirroring progress in aix Waldemar Mark Duszyk
22/03/2012 http://www.wmduszyk.com/?p=8133&langswitch_lang=pl
free hit counter
Language

Kalendarz Postw
M T W T F S S
Feb
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
March 2012
Page 7 of 10 mirroring progress in aix Waldemar Mark Duszyk
22/03/2012 http://www.wmduszyk.com/?p=8133&langswitch_lang=pl
Password Manager
Securely store admin
passwords Ensure
internal control,
compliance
ManageEngine.com/Passwor
IBM Launch
See How IBM Will
Revolutionise IT
Operations. Free
Virtual Broadcast!
ibm.com/ExpertIntegratedS
Intel Cloud
Computing
Making the Cloud work
for you with open,
multi-vendor Cloud
solutions!
www.Intel.co.uk/CloudCom
iSCSI SAN & NAS
Cost effective iSCSI
SAN solutions for
VMware, Linux &
Windows.
www.dnuk.com
SQL Server
Remote DBA
Access to industry
leading experts for a
fraction of the cost
www.coeo.com
Page 8 of 10 mirroring progress in aix Waldemar Mark Duszyk
22/03/2012 http://www.wmduszyk.com/?p=8133&langswitch_lang=pl
Archives
March 2012 (8)
February 2012 (8)
January 2012 (10)
December 2011 (5)
November 2011 (10)
October 2011 (7)
September 2011 (4)
August 2011 (10)
July 2011 (6)
June 2011 (2)
May 2011 (3)
April 2011 (7)
March 2011 (11)
February 2011 (12)
January 2011 (7)
December 2010 (10)
November 2010 (3)
Next Gen SAN
Technology
150K IOPS, 100Tb
SAN for 35K from
The UK's leading
GreenBytes Partner
www.enablesit.co.uk
Record Admin
Session
on Windows, UNIX,
Linux, Citrix Download
Free Trial
www.centrify.com/windows
Drowning In
Resumes?
Automatically Identify
Top Talent With Free
Software, Instant
Access.
www.unrabble.com
StayAhead Unix
Training
Scheduled & Onsite
Unix Courses by
leading UK provider.
020 7600 6116
www.stayahead.com
Migrate to
Windows 7
Get the free Microsoft
Deployment Toolkit to
help you easily
migrate
microsoft.com/XPUpgrade
Page 9 of 10 mirroring progress in aix Waldemar Mark Duszyk
22/03/2012 http://www.wmduszyk.com/?p=8133&langswitch_lang=pl
October 2010 (9)
September 2010 (12)
August 2010 (9)
July 2010 (4)
June 2010 (7)
May 2010 (8)
April 2010 (4)
March 2010 (6)
February 2010 (1)
January 2010 (11)
December 2009 (6)
November 2009 (7)
October 2009 (6)
September 2009 (4)
August 2009 (6)
July 2009 (6)
June 2009 (9)
May 2009 (13)
April 2009 (7)
March 2009 (8)
February 2009 (7)
December 2008 (1)
November 2008 (1)
Proudly powered by WordPress and Carrington.
2008-2012 www.wmduszyk.com - best viewed with your eyes.
Page 10 of 10 mirroring progress in aix Waldemar Mark Duszyk
22/03/2012 http://www.wmduszyk.com/?p=8133&langswitch_lang=pl

Vous aimerez peut-être aussi