- Community Home
 - >
 - Servers and Operating Systems
 - >
 - Operating Systems
 - >
 - Operating System - HP-UX
 - >
 - Need to get customized o/p
 
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
Forums
Discussions
Discussions
Discussions
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
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
 
04-20-2012 04:06 AM
04-20-2012 04:06 AM
			
				
					
						
							Need to get customized o/p
						
					
					
				
			
		
	
			
	
	
	
	
	
Hello Gurus,
Iam trying to generate a customized o/p from my server. say example I need to print the o/p as below from vgdisplay command.
VG Status    Max LV  Total PE
available      255        8680
[In vertical ways as column wise] Ineed it urgently since i need to collect it from nearly 100+ servers,,,,,,
--- Volume groups ---
VG Name                     /dev/vg00
VG Write Access             read/write
VG Status                   available
Max LV                      255
Cur LV                      9
Open LV                     9
Max PV                      16
Cur PV                      2
Act PV                      2
Max PE per PV               4350
VGDA                        4
PE Size (Mbytes)            8
Total PE                    8680
Alloc PE                    8672
Free PE                     8
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0
VG Status  Max LV  Total PE
available  255      8680
Could you please help me?
Rgds
Sree
- Tags:
 - vgdisplay
 
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
04-20-2012 08:20 AM
04-20-2012 08:20 AM
			
				
					
						
							Re: Need to get customized o/p
						
					
					
				
			
		
	
			
	
	
	
	
	
Try this short script. Substitute the appropriate VG name in place of VG00 below.
# cat testfile
#!/usr/bin/sh
echo " VG Status       Max LV  Total PE"
vgdisplay vg00 |grep -e "Status" -e "Max LV" -e "Total PE" | awk '{ printf ("%10s", $3) }'
echo ""
echo ""
# sh ./testfile
 VG Status       Max LV  Total PE
 available       255     69996
- Tags:
 - awk
 
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
04-20-2012 08:27 AM
04-20-2012 08:27 AM
			
				
					
						
							Re: Need to get customized o/p
						
					
					
				
			
		
	
			
	
	
	
	
	
Here's a modification that will pick up all VGs on a system.
# cat testfile
#!/usr/bin/sh
VGNAME=$(vgdisplay | grep "VG Name" | awk '{print $3}')
for VG in $VGNAME
do
  echo "VG Name: ${VG}"
  echo " VG Status       Max LV  Total PE"
  vgdisplay ${VG} |grep -e "Status" -e "Max LV" -e "Total PE" | awk '{ printf ("%10s", $3) }'
  echo ""
  echo ""
done
# ./testfile
VG Name: /dev/vg00
 VG Status       Max LV  Total PE
 available       255     69996
VG Name: /dev/vgbig
 VG Status       Max LV  Total PE
 available       255     61236
VG Name: /dev/vgpcbackup
 VG Status       Max LV  Total PE
 available       255     30618