Read more
- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - HP-UX
- >
- System Administration
- >
- mirror details
-
-
Categories
- Topics
- Hybrid IT with Cloud
- Mobile & IoT
- IT for Data & Analytics
- Transformation
- Strategy and Technology
- Products
- Cloud
- Integrated Systems
- Networking
- Servers and Operating Systems
- Services
- Storage
- Company
- Events
- Partner Solutions and Certifications
- Welcome
- Welcome
- Announcements
- Tips and Tricks
- Feedback
-
Blogs
- Alliances
- Around the Storage Block
- Behind the scenes @ Labs
- Converged Data Center Infrastructure
- Digital Transformation
- Grounded in the Cloud
- HPE Careers
- HPE Storage Tech Insiders
- Infrastructure Insights
- Inspiring Progress
- Internet of Things (IoT)
- My Learning Certification
- Networking
- OEM Solutions
- Servers: The Right Compute
- Telecom IQ
- Transforming IT
-
Quick Links
- Community
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Contact
- Email us
- Tell us what you think
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Enterprise.nxt
- Marketplace
- Aruba Airheads Community
-
Categories
-
Forums
-
Blogs
-
InformationEnglish
mirror details
SOLVED- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-26-2011 12:56 AM
04-26-2011 12:56 AM
I want to get the mirror status of vg00 on more than 50 servers.So used below script
>>
for i in `bdf|sed 1d|awk '{print $1}'|grep -i '/dev'|grep vg00`
do
B=`lvdisplay $i|grep Mirror|awk '{print $3}'`
if [ $B -ne 0 ]
then
echo " All LVs are mirrored"
else
echo " LV $i is unmirrored"
fi
done
>>
Script providing mirror status fine.But as not am expected.If mirror is 1 then output should be "All LVs are mirrored" else LV $i is unmirrored" . But my scripts provides All LVs are mirrored" n no. of times , where n is total no. of LVs present in vg00.
Please suggest .
Regards/himacs
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-26-2011 01:11 AM
04-26-2011 01:11 AM
SolutionI don't undestand very well what you want, but try this and tell me:
for i in `vgdisplay -v vg00 |grep "LV Na" |awk '{print $NF}'`
do
MIRROR=$(lvdisplay $i |awk '/Mirror/ {print $NF}')
if [[ ${MIRROR} -eq 0 ]]
then
echo "$i no esta en Mirror en `hostname`"
fi
done
Regards
Noé.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-26-2011 01:34 AM
04-26-2011 01:34 AM
Re: mirror details
Re: mirror details
Sorry, the echo must be:
echo "$i is not in Mirror in `hostname`"
:)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-26-2011 01:41 AM
04-26-2011 01:41 AM
Re: mirror details
Re: mirror details
typeset -i total=0 mirrored=0
for i in $(bdf | sed 1d | awk '{print $1}' | grep "/dev.*vg00"); do
B=$(lvdisplay $i | grep Mirror | awk '{print $3}')
if [ $B -ne 0 ]; then
(( mirrored += 1 ))
else
echo " LV $i is not mirrored"
fi
(( total += 1 ))
done
if [ $total -eq $mirrored ]; then
echo " All LVs are mirrored"
fi
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2018 Hewlett Packard Enterprise Development LP