- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- VG Info script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-24-2006 07:48 PM
тАО10-24-2006 07:48 PM
Could you please help? I want to create a script to collect all VGs information from the system. The output of the script should
What command should I use in thes script?
Please help.
Thanks and Best Regards,
Dewa
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-24-2006 07:58 PM
тАО10-24-2006 07:58 PM
Re: VG Info script
vgdisplay | grep -E "VG Name|PE Size|Total PE|Alloc PE|Free PE"
after that you can calculate the size in MB for Total/Alloc/Free based on PE size.
regards,
ivan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-24-2006 08:34 PM
тАО10-24-2006 08:34 PM
SolutionTOTAL=0
echo
for VG in $(ls -d /dev/vg*)
do
vgdisplay -v $VG > /dev/null 2>&1
if [ $? -eq 0 ]
then
PESIZE=$(vgdisplay $VG|grep "PE Size"|awk '{print $4}')
FREEPE=$(vgdisplay $VG|grep "Free PE"|awk '{print $3}')
let ESPACIO=$PESIZE*$FREEPE
typeset -12R ESPACIO
typeset -30L VG
echo "---$VG:$ESPACIO"
let TOTAL=$TOTAL+ESPACIO
fi
done
typeset -14R TOTAL
echo "==============================================="
echo "+++TOTAL:\t\t\t$TOTAL"
echo "==============================================="
echoTOTAL=0
echo
for VG in $(ls -d /dev/vg*)
do
vgdisplay -v $VG > /dev/null 2>&1
if [ $? -eq 0 ]
then
PESIZE=$(vgdisplay $VG|grep "PE Size"|awk '{print $4}')
FREEPE=$(vgdisplay $VG|grep "Free PE"|awk '{print $3}')
let ESPACIO=$PESIZE*$FREEPE
typeset -12R ESPACIO
typeset -30L VG
echo "---$VG:$ESPACIO"
let TOTAL=$TOTAL+ESPACIO
fi
done
typeset -14R TOTAL
echo "==============================================="
echo "+++TOTAL:\t\t\t$TOTAL"
echo "==============================================="
echo
Output:
fonseca:/Administracion/Discos/script#./espacio_vgs.sh
---/dev/vg00 : 29616
---/dev/vg01 : 25396
---/dev/vgbatch.desa : 1356
---/dev/vgoracle.desa : 2512
===============================================
+++TOTAL: 58880
===============================================
rgs,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-24-2006 11:15 PM
тАО10-24-2006 11:15 PM
Re: VG Info script
Thanks again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2006 01:56 AM
тАО10-25-2006 01:56 AM
Re: VG Info script
Save this as /usr/local/bin/vginfo and change to executable (edit location of perl). I got this script from ITRC and made some minor mods to it:
#!/usr/contrib/bin/perl
#
# vginfo - display comprehensive information on LVM COnfiguration
# incluiding VG's, LV's and PVs
#
#
my $host =`hostname`.`date`;
print "VGINFO v 1.0\n";
print "LVM Managed Storage Information for $host \n";
print "\n";
print "LVM LVM Mirr Allocated Total Free\n";
print "Type Object Name Count (Mbytes) (Mbytes) (Mbytes)\n";
print "---- --------------------------- ----- -------- -------- --------\n";
foreach $_ (`/usr/sbin/vgdisplay -v`) {
if (/^(\s*\w\w) Name\s+(\S+)/) {
$type = $1;
$name = $2;
$name =~ s/\/dev//;
}
$pe = $1 if (/^PE Size \(Mbytes\)\s+(\w+)/);
$alloc = $1 if (/Allo.* PE\s+(\w+)/);
$total = $1 if (/Total PE\s+(\w+)/);
$free = $1 if (/Free PE\s+(\w+)/);
$s = $1 if (/Used PV\s+(\w+)/);
if (/^$/) {
if ($alloc + $total + $free) {
printf ("%-6s%-30s%3s%12d%9d%9d\n",
$type, $name, ($s)?$s :" ", $pe * $alloc, $pe * $total, $pe * $free);
} else { print "\n" } ;
$name = $type = " ";
$alloc = $total = $free = $s = 0;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2006 05:21 AM
тАО10-25-2006 05:21 AM
Re: VG Info script
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=640683
hth,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2006 05:48 AM
тАО10-25-2006 05:48 AM
Re: VG Info script
You must be the original author of this script... Danke very much sire... we are using this scripten extensively...
Nelsonen