LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-16-2007, 12:18 PM   #1
wendtbd
LQ Newbie
 
Registered: Aug 2006
Posts: 14

Rep: Reputation: 0
Smile Correlate output from multiple commands


I am looking for a way to correlate data from three commands to make file system management a little easier. Below are the commands and some output from each...

vgdisplay -v (Looking for the Volume Group name and the dm device information)

--- Volume group ---
VG Name vg05
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 36
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 39.97 GB
PE Size 32.00 MB
Total PE 1279
Alloc PE / Size 1279 / 39.97 GB
Free PE / Size 0 / 0
VG UUID JoU3EO-lILs-czl3-LlOj-db8h-w6Xs-iYqsCx

--- Logical volume ---
LV Name /dev/vg05/nfshome
VG Name vg05
LV UUID 1QbfHK-f6AD-9frI-C7AW-68Rv-CtaD-aTtevX
LV Write Access read/write
LV Status NOT available
LV Size 39.97 GB
Current LE 1279
Segments 1
Allocation inherit
Read ahead sectors 0

--- Physical volumes ---
PV Name /dev/dm-31
PV UUID DIMnL4-PTzH-gfiP-veTM-lyna-BPAJ-9wJLTi
PV Status allocatable
Total PE / Free PE 1279 / 0

ls -l /dev/mpath (Correlate the dm device found above to the mpath #)
lrwxrwxrwx 1 root root 8 Jul 16 10:44 mpath11 -> ../dm-31

Multipath -ll (List the sdxx devices associated with the mpath device)
mpath11 (3600508b4001058b60000700003ac0000)
[size=40 GB][features="1 queue_if_no_path"][hwhandler="0"]
\_ round-robin 0 [prio=100][active]
\_ 2:0:0:201 sdcx 70:80 [active][ready]
\_ 3:0:0:201 sdeu 129:96 [active][ready]
\_ round-robin 0 [prio=20][enabled]
\_ 1:0:0:201 sdba 67:64 [active][ready]
\_ 0:0:0:201 sdd 8:48 [active][ready]

I am sure this is all possible with grep, sed and awk but I am not a programmer and don't know these tools well enough. If anyone has any suggestions I would appreciate it.

Thanks
Barrett Wendt
 
Old 07-16-2007, 11:55 PM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
It all depends on what you mean by "correlate". Do you mean tabulate correlated information by device name? Do you mean research a single device and extract everything related to it?
ta0kira
 
Old 07-17-2007, 07:18 AM   #3
wendtbd
LQ Newbie
 
Registered: Aug 2006
Posts: 14

Original Poster
Rep: Reputation: 0
Maybe correlate isn't the correct word here.

Ideally the script would output the data for all the dm devices available on the server but if it is easier to just get the information for one device that would be fine.
 
Old 07-17-2007, 06:04 PM   #4
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
From the command output in your first post, what would be the ideal processed output?
ta0kira
 
Old 07-18-2007, 07:16 AM   #5
wendtbd
LQ Newbie
 
Registered: Aug 2006
Posts: 14

Original Poster
Rep: Reputation: 0
Actually I found another command that gives me more of what I am looking for but not everything...

lvs -o +devices

LV VG Attr LSize Origin Snap% Move Log Copy% Devices
LogVol00 VolGroup00 -wi-ao 20.53G /dev/cciss/c0d0p4(0)
LogVol01 VolGroup00 -wi-ao 39.81G /dev/cciss/c0d0p4(657)
u01 vg01 -wi-ao 725.53G /dev/dm-26(0)
u01 vg01 -wi-ao 725.53G /dev/dm-59(0)
u01 vg01 -wi-ao 725.53G /dev/dm-60(0)
u01 vg01 -wi-ao 725.53G /dev/dm-5(0)
u01 vg01 -wi-ao 725.53G /dev/dm-6(0)
u01 vg01 -wi-ao 725.53G /dev/dm-13(0)
u01 vg01 -wi-ao 725.53G /dev/dm-38(0)
u01 vg01 -wi-ao 725.53G /dev/dm-45(15)
u01 vg01 -wi-ao 725.53G /dev/dm-40(16)
u02 vg01 -wi-ao 1.00G /dev/dm-26(11328)
u02 vg01 -wi-ao 1.00G /dev/dm-40(0)
u03 vg01 -wi-ao 960.00M /dev/dm-26(11344)
u03 vg01 -wi-ao 960.00M /dev/dm-45(0)
u01 vg02 -wi-ao 9.31G /dev/dm-9(0)
export vg03 -wi--- 39.97G /dev/dm-28(0)
u99 vg04 -wi-ao 59.97G /dev/dm-29(0)
nfshome vg05 -wi--- 39.97G /dev/dm-30(0)
arch vg06 -wi--- 3.00G /dev/dm-16(384)
u01 vg06 -wi--- 5.00G /dev/dm-16(0)
u02 vg06 -wi--- 7.00G /dev/dm-18(0)
u03 vg06 -wi--- 7.00G /dev/dm-16(160)
u04 vg06 -wi--- 9.00G /dev/dm-18(224)
arch vg07 -wi--- 3.00G /dev/dm-32(256)
u01 vg07 -wi--- 3.00G /dev/dm-32(0)
u02 vg07 -wi--- 5.00G /dev/dm-33(0)
u03 vg07 -wi--- 5.00G /dev/dm-32(96)
u04 vg07 -wi--- 4.00G /dev/dm-33(160)
arch vg08 -wi--- 9.00G /dev/dm-54(0)
u01 vg08 -wi--- 5.00G /dev/dm-48(0)
u01 vg08 -wi--- 5.00G /dev/dm-48(1152)
u02 vg08 -wi--- 4.00G /dev/dm-48(96)
u03 vg08 -wi--- 3.00G /dev/dm-48(224)
u04 vg08 -wi--- 13.00G /dev/dm-48(320)
u05 vg08 -wi--- 13.00G /dev/dm-48(736)

If I could add the mpath information and the sdxx information to this listing it would be ideal. To answer your question though, this is the output format I am looking for. Of course this only shows what dm devices are in use but thats ok for now.

Last edited by wendtbd; 07-18-2007 at 07:19 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Log user commands and output roulette Linux - Security 5 08-17-2009 11:30 PM
Output commands when programs run? TKS Slackware 2 12-12-2005 11:07 PM
How to correlate web site URL with IP addr. in weblizer? htm Linux - Software 3 05-02-2004 08:02 PM
Bash: How to concatenate the output of different commands? J_Szucs Programming 1 11-13-2003 07:43 AM
Using commands to output to files, how is this done? nro Linux - Newbie 3 11-11-2003 08:38 PM


All times are GMT -5. The time now is 08:51 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration