- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Command to get the package name related with t...
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
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
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
11-09-2011 10:54 AM
11-09-2011 10:54 AM
Command to get the package name related with the vg
Hi,
Can anyone please let me know any command which will give the name of the package related with the vg name?
Like suppose i know one vg(vg_db01) and i just wanted to know which package is associated with this vg. Lets suppose there are more then 100 packages running on the server so it would be diffficult to check it manually.
Thanks for your response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2011 02:02 PM
11-09-2011 02:02 PM
Re: Command to get the package name related with the vg
There's now one command that will do it, but the following script should do the trick:
#!/usr/bin/sh VG=$1 PKGS="$(cmviewcl -l package | grep -v PACKAGE | grep -v "^$" | awk '{print $1}')" for PKG in ${PKGS} do cmgetpkgenv ${PKG} | grep ${VG} > /dev/null 2>&1 RC=$? if [ ${RC} -eq 0 ] then echo "Volume group ${VG} is used by the ${PKG} package." exit 0 fi done
Jeff Traigle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2011 04:25 AM
11-10-2011 04:25 AM
Re: Command to get the package name related with the vg
cmgetpkgenv is not working..
Can u give some other command for the same?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2011 05:45 AM
11-10-2011 05:45 AM
Re: Command to get the package name related with the vg
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2011 08:35 AM
11-10-2011 08:35 AM
Re: Command to get the package name related with the vg
I guess you are running Serviceguard prior to A11.18 then. The following command should work to check the control script in older versions of Serviceguard:
grep "^VG\[[0-1]*\]=/dev/${VG}" /etc/cmcluster/${PKG}/control.sh > /dev/null 2>&1
You may need to adjust the path for the control script if your layout is different.
Jeff Traigle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2011 10:55 AM
11-15-2011 10:55 AM
Re: Command to get the package name related with the vg
If it is not already obvious, LVM volume groups are associated with packages. As of A.11.18, Serviceguard supports 2 styles of packages - legacy, which involve a package configuration file and a package control script, and modular, which uses a package configuration file that is loaded with all parameters previously defined in the 2 legacy files. Modular package parameters are compiled into the cluster binary file, which make it possible to identify all volume groups related to packages by using this command:
$ cmviewcl -v -f line | grep vg=
The legacy package control script contains the VG[x]= parameters, so you have to use the grep command Jeff gave to relate the VGs to the packages.