- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Search for software
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
08-31-2009 11:24 PM
08-31-2009 11:24 PM
I have a number of servers A,B,C etc which have number of depots.
I want to search these servers for a particular software (that I need to install on another test server)
# swlist -l depot -s abc.efg.xyz.com
---shows lists of depots---
/var/spool/sw/PHSS_30724.depot
/var/spool/sw/11i_PA.apps <<===
/var/spool/sw/es_maint
/var/spool/sw/cvsdm_11_11_v10800
---shows lists of depots---
But these depot/directories will in turn have a number of softwares.
# swlist -l product -s abc.efg.xyz.com:/var/spool/sw/11i_PA.apps
--------------
--------------
MeasureWare C.03.72.00 MeasureWare Software/UX
MeasurementInt C.03.72.00 HP-UX Measurement Interface for 11i
Mozilla 1.4.0.00.00 Mozilla 1.4
MozillaSrc 1.4.0.00.00 Mozilla 1.4 Source Distribution
NetscapeDirSvr6 B.06.11 The Netscape Directory Server v6
NisLdapServer B.03.10 The NIS/LDAP Gateway (ypldapd)
--------------
--------------
So, how can I search for a particular software using least number of commands, if possible.
I will be doing all these activities from my test server.
Thanks in advance..
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2009 11:43 PM
08-31-2009 11:43 PM
Re: Search for software
If you know the name of the software, you don't have to list all products.
So of you have S servers and each has D' depots and each has P' products, you need two nested for/while loops.
for S in $(< list-of-servers); do
swlist -l depot -s $S | while read D; do
swlist -l product -s $S:$D
# if you find what you want, you can use "break 2"
done
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2009 12:50 AM
09-01-2009 12:50 AM
Re: Search for software
The script is pulling things good..
Script is:
----------------
for S in xxxx.xxx.xx.com yyyy.yyy.yy.com ; do
swlist -l depot -s $S | while read D; do
swlist -l product -s $S:$D
done
done
----------------
# ./script1 | grep -i cifs
----Output truncated----
ERROR: There is currently no depot software on host
"yyyy.yyy.yy.com" at location "/abcd/depot". Make sure that
an absolute pathname is specified for location (beginning with
"/").
ERROR: More information may be found in the daemon logfile on this
target (default location is
xxxx.xxx.xx.com:/var/adm/sw/swagentd.log).
CIFS-Development A.01.09.04 CIFS/9000 server source code files
CIFS-Server A.01.09.04 CIFS/9000 (Samba) File and Print Services
CIFS-Client A.01.08 HP CIFS/9000 Client
ERROR: There is currently no depot software on host
"xxxx.xx.xx.com" at location "/tmp/iether.depot". Make sure
that an absolute pathname is specified for location (beginning
with "/").
Points of concern:
1. This script is pulling out results but with hhuuggee number of ERROR lines.
2. Another thing is that I am unable to get the path of the software pulled by the script.
Any solution for this?
Thanks..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2009 03:36 AM
09-01-2009 03:36 AM
Re: Search for software
> 1. This script is pulling out results but with hhuuggee number of ERROR lines.
Like all well-behaved software allows, redirect STDERR to /dev/null :
...
swlist -l depot -s $S 2>/ dev/null | while read D; do
swlist -l product -s $S:$D 2> /dev/null
...
> 2. Another thing is that I am unable to get the path of the software pulled by the script.
If you want this than you will have to descend to the file level:
# swlist -l file
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2009 06:08 PM
09-01-2009 06:08 PM
Re: Search for software
>I am unable to get the path of the software pulled by the script.
By this I mean that I cannot get the path where the software depot is placed on the server.
In other words..I have mentioned three servers to search for a particular software. Script pulls out the software but how do I know where this software is placed and on which server??
BTW, redirection works nice.
Thanks..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2009 08:27 PM
09-01-2009 08:27 PM
SolutionOops, I did some hand waving and didn't test it. There were comment lines.
This should work better, unless you have depots you registered but used rm to remove:
for S in xxxx.xxx.xx.com yyyy.yyy.yy.com ; do
swlist -l depot -s $S | grep -v "^#" |
while read D; do
swlist -l product -s $S:$D
done
done
>but how do I know where this software is placed and on which server?
You need to grep for two patterns:
# ./script1 | grep -i -e Internet -e Target:
# Target: XXX:/tmp/depot
# Target: XXX:/var/tmp/InternetSrvcs.11_23
InternetSrvcs B.11.23 General network applications and daemons
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2009 10:14 PM
09-01-2009 10:14 PM
Re: Search for software
If have edited the script to:
-----------------------------
echo "Enter the name of the software to search for: "
read P
for S in casea.cup.hp.com hpindml.cup.hp.com vick2.atl.hp.com; do
swlist -l depot -s $S 2> /dev/null | while read D; do
swlist -l product -s $S:$D 2> /dev/null | grep -v "# Contacting" | grep -i -e $P -e target
done
done
-----------------------------
And it is working perfect as I wished.
Thanks again Dennis for your help..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2009 12:38 AM
09-02-2009 12:38 AM
Re: Search for software
You really should keep my grep between the first swlist and the "while". No need to make swlist sweat by looking up "#" names.