- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- awk question
Operating System - Linux
1748169
Members
3677
Online
108758
Solutions
Forums
Categories
Company
Local Language
юдл
back
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
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
тАО07-23-2007 11:53 PM
тАО07-23-2007 11:53 PM
Hello,
I am attempting to write a report on SAN disk that is attached and how much space is available to the system in aix:
--> lsvg
rootvg
tsmlogvg
tsmdbvg
tsmdatavg
nimvg01
orabinvg1
oradatvg1
oraarcvg1
--> lsvg nimvg01
VOLUME GROUP: nimvg01 VG IDENTIFIER: 00c4816d00004c000000010d1114abf1
VG STATE: active PP SIZE: 32 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 1725 (55200 megabytes)
MAX LVs: 256 FREE PPs: 348 (11136 megabytes)
LVs: 5 USED PPs: 1377 (44064 megabytes)
OPEN LVs: 5 QUORUM: 2
TOTAL PVs: 3 VG DESCRIPTORS: 3
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 3 AUTO ON: yes
MAX PPs per VG: 32512
MAX PPs per PV: 1016 MAX PVs: 32
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
--> lsvg -p nimvg01
nimvg01:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
vpath0 active 575 0 00..00..00..00..00
vpath1 active 575 189 66..00..00..57..66
vpath24 active 575 159 00..00..00..44..115
so from the commands above and the output I require I have created the following syntax:
--> for VOLUME in `lsvg`
> do
> PP=$(lsvg $VOLUME |awk '/PP SIZE:/ {print $6}')
> lsvg -p $VOLUME |awk -v VOL=$VOLUME -v PP=$PP 'NR>2 {OFS=",";print VOL,$1,$3*PP,$4*PP}'
> done
this output works well and I get the following:
rootvg,hdisk0,69888,46208
rootvg,hdisk1,69888,45312
nimvg01,vpath0,18400,0
nimvg01,vpath1,18400,6048
nimvg01,vpath24,18400,5088
what I would like to see is:
rootvg,hdisk0,69888,46208,hdisk1,69888,45312
nimvg01,vpath0,18400,0,vpath1,18400,6048,vpath24,18400,5088
any idea's how I can do this?
Thanks guys.
Chris.
I am attempting to write a report on SAN disk that is attached and how much space is available to the system in aix:
--> lsvg
rootvg
tsmlogvg
tsmdbvg
tsmdatavg
nimvg01
orabinvg1
oradatvg1
oraarcvg1
--> lsvg nimvg01
VOLUME GROUP: nimvg01 VG IDENTIFIER: 00c4816d00004c000000010d1114abf1
VG STATE: active PP SIZE: 32 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 1725 (55200 megabytes)
MAX LVs: 256 FREE PPs: 348 (11136 megabytes)
LVs: 5 USED PPs: 1377 (44064 megabytes)
OPEN LVs: 5 QUORUM: 2
TOTAL PVs: 3 VG DESCRIPTORS: 3
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 3 AUTO ON: yes
MAX PPs per VG: 32512
MAX PPs per PV: 1016 MAX PVs: 32
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
--> lsvg -p nimvg01
nimvg01:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
vpath0 active 575 0 00..00..00..00..00
vpath1 active 575 189 66..00..00..57..66
vpath24 active 575 159 00..00..00..44..115
so from the commands above and the output I require I have created the following syntax:
--> for VOLUME in `lsvg`
> do
> PP=$(lsvg $VOLUME |awk '/PP SIZE:/ {print $6}')
> lsvg -p $VOLUME |awk -v VOL=$VOLUME -v PP=$PP 'NR>2 {OFS=",";print VOL,$1,$3*PP,$4*PP}'
> done
this output works well and I get the following:
rootvg,hdisk0,69888,46208
rootvg,hdisk1,69888,45312
nimvg01,vpath0,18400,0
nimvg01,vpath1,18400,6048
nimvg01,vpath24,18400,5088
what I would like to see is:
rootvg,hdisk0,69888,46208,hdisk1,69888,45312
nimvg01,vpath0,18400,0,vpath1,18400,6048,vpath24,18400,5088
any idea's how I can do this?
Thanks guys.
Chris.
hello
Solved! Go to Solution.
- Tags:
- awk
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-24-2007 01:01 AM
тАО07-24-2007 01:01 AM
Solution
Hi Chris:
Given the final ouput as shown:
# awk -F"," '{if ($1==save) {line=line","$2","$3","$4;save=$1} else {if (ok++) {print line};save=$1;line=$0}};END{print line}'
Note (of course) that you can either pipe your previous stream into this or use the above and read a temporary file.
... | awk -F"." ...
(or):
awk -F"." ... file
Regards!
...JRF...
Given the final ouput as shown:
# awk -F"," '{if ($1==save) {line=line","$2","$3","$4;save=$1} else {if (ok++) {print line};save=$1;line=$0}};END{print line}'
Note (of course) that you can either pipe your previous stream into this or use the above and read a temporary file.
... | awk -F"." ...
(or):
awk -F"." ... file
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-24-2007 01:32 AM
тАО07-24-2007 01:32 AM
Re: awk question
Thanks James that works a treat.
Will add this to my ever building arsenal of awk commands.
much appreciated.
Chris.
Will add this to my ever building arsenal of awk commands.
much appreciated.
Chris.
hello
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP