Operating System - HP-UX
1752751 Members
5238 Online
108789 Solutions
New Discussion юеВ

vgdisplay output and MCSG

 
SOLVED
Go to solution
Rick Garland
Honored Contributor

vgdisplay output and MCSG

Hi all:

Working with HPUX 11.23, MCSG 11.16, ia64 systems.

Trying to write a script that uses the vgdisplay command. Trouble is I do not want the VGs that are not activated.

Tried using grep -v, parsing through the /etc/lvmtab file, etc.

Any hints?

Thanks

4 REPLIES 4
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: vgdisplay output and MCSG

Well, if you don't want the scripts that are not activated then this is rather simple.

After getting your VG name from /etc/lvmtab then:

vgdisplay -v ${VGNAME} > /dev/null 2>&1
STAT=${?}
if [[ ${STAT} -eq 0 ]]
then # ok
vgdisplay -v ${VGNAME}
fi

If it ain't broke, I can fix that.
Mel Burslan
Honored Contributor

Re: vgdisplay output and MCSG

the only solution I could find to this

vgdisplay | grep -v "not activated" | grep -v "Cannot display" > /tmp/file

and the output is the details from active groups only. error messages dump to screen. for some bizzare reason I could not get itto work with 2>/dev/null directive.

HTH
________________________________
UNIX because I majored in cryptology...
Mel Burslan
Honored Contributor

Re: vgdisplay output and MCSG

shorter form

vgdisplay 2>/dev/null
________________________________
UNIX because I majored in cryptology...
Rick Garland
Honored Contributor

Re: vgdisplay output and MCSG

Thanks Clay.

Mel - I was having similar issues as well.

Thanks to both of you!