Operating System - HP-UX
1834456 Members
2620 Online
110067 Solutions
New Discussion

Re: How can I compare the patches list on two systems ?

 
Dhote Anthony
New Member

How can I compare the patches list on two systems ?

Hello

I need to get the exact difference between two HP-UX B.11.11 systems, and I am stuck in the comparison between products and patches.

How can I get the exact lists of differences ? Is there a command or a script that is capable of it ?
11 REPLIES 11
Robert-Jan Goossens
Honored Contributor

Re: How can I compare the patches list on two systems ?

Hi,

Run a swlist on both systems and diff the files.

# swlist -l product >> /tmp/patch_list_system1

Regards,
Robert-Jan
Matti_Kurkela
Honored Contributor

Re: How can I compare the patches list on two systems ?

Not directly, but my usual approach to compare two catalog-like files (one item per line) should work:

- run swlist with suitable arguments to get a listing of software items.

- pipe the output to "sort" to alphabetize it and direct the sorted output to a file. Do this on both hosts.

- move both files to the same host and run "diff file1 file2". As both files are sorted alphabetically, any differences will reveal things that are different or missing from one server or the other.
MK
Peter Godron
Honored Contributor

Re: How can I compare the patches list on two systems ?

Hi,
and welcome to the forums !

You can run the swlist command for different levels (product or patch).
That should give you the info you want.

See "man swlist". To compare see "man diff", "man comm"


Please read:
http://66.34.90.71/ITRCForumsEtiquette/after.html


Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions.
Court Campbell
Honored Contributor

Re: How can I compare the patches list on two systems ?

this may not be the best approach but it is usable. you could run "swlist -l" product and "swlist -l patch" on both machines and redirect the output to different files. then you could do something like this:

cat server1_patch.out server2_patch.out | sort | uniq -c

you should see numbers before each patch. If you see the number 2 then it is on both machines, if you see the number 1 then it is only installed on one of the machines. finding out which machine it is on is rather trivial. But there is always more than one way to do it.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Sp4admin
Trusted Contributor

Re: How can I compare the patches list on two systems ?

HI Dhote,

You can use the "show_patches -s" for patches that have been superseeded. or use show_patches -a for active patches. But just like they stated above swlist will also work.
Dennis Handly
Acclaimed Contributor

Re: How can I compare the patches list on two systems ?

>Court: cat server1_patch.out server2_patch.out | sort | uniq -c

(No need to use cat here. sort takes multiple files.)

Instead of using uniq -c, you can sort both lists and use comm(1):
$ comm -23 s1 s2 # would give items unique to 1
$ comm -13 s1 s2 # would give items unique to 2
$ comm -12 s1 s2 # would give common items
Ashish Parashar
Frequent Advisor

Re: How can I compare the patches list on two systems ?

Hello Anthony

You can use below commands

swlist -l products > /tmp/patch_list_sernam

on both the servers where sernam is server name for reference.

after this just copy one of the above file from either server to other one
through rcp,ftp or sftp

ex rcp server1# severname2:/tmp/patch_list_sernam /tmp/

then use diff command

diff /tmp/patch_list_sernam1 :/tmp/patch_list_sernam2

It will give disired result.

Regards

Ashish
Court Campbell
Honored Contributor

Re: How can I compare the patches list on two systems ?

Dennis,
Thanks once again for adding your two cents to my solution. In the end if your solution works, that's great. I don't need your comments directed towards me. Dhote is the one with the issue. I don't have a problem comparing patches. And as I stated above, there is more than one way to do it.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
John Payne_2
Honored Contributor

Re: How can I compare the patches list on two systems ?

Dhote,

There is a patch for HPUX 11.23 that delivers a tool called sysdiff that's exactly what you need. (delivered as /usr/contrib/sysdiff) It's PHCO_32220, HP-UX Patch Tools.

sysdiff takes as input the 2 machine names you want to compares, then goes out and compares the packages and patches between the 2, in this manner: (The names have been changed to protect the innocent.)

Acquiring data from col
applied patches.................DONE
superseded patches..............DONE
installed products..............DONE
Acquiring data from elm
applied patches.................DONE
superseded patches..............DONE
installed products..............DONE


Contrib-Tools
col elm description
------------- ------------- ------------------------------------------------
B.11.11.12.09 B.11.11.15.13 Contributed Tools
------------- ------------- ------------------------------------------------


EMS-Config
col elm description
------------- ------------- ------------------------------------------------
A.03.20.01 A.04.00.02 EMS Config
------------- ------------- ------------------------------------------------
PHSS_28844 EMS & HA Monitors (A.03.20.01) patch
PHSS_30754 EMS & HA Monitors (A.04.00.02) patch


EMS-Core
col elm description
------------- ------------- ------------------------------------------------
A.03.20.01 A.04.00.02 EMS Core Product
------------- ------------- ------------------------------------------------
PHSS_30754 EMS & HA Monitors (A.04.00.02) patch


EMS-Core
col elm description
------------- ------------- ------------------------------------------------
A.04.00.01 N/A EMS Core Product
------------- ------------- ------------------------------------------------


EMS-KRMonitor
col elm description
------------- ------------- ------------------------------------------------
A.11.11.04 A.11.11.05 EMS Kernel Resource Monitor
------------- ------------- ------------------------------------------------

Sup-Tool-Mgr
col elm description
------------- ------------- ------------------------------------------------
B.11.11.09.11 B.11.11.15.13 Support Tools Manager for HPUX systems
------------- ------------- ------------------------------------------------


Sup-Tool-Mgr
col elm description
------------- ------------- ------------------------------------------------
B.11.11.12.09 N/A Support Tools Manager for HPUX systems
------------- ------------- ------------------------------------------------


The tool just needs to have remote swlist access to your machines. (Can be any box, really.) The detail for PHCO_32220 list an HPUX 11.11 equivilant, PHCO_32219, but that doesn't appear to be available right now. (I run sysdiff from a single HPUX 11.23 box only for all my other machines.)

As far as a version for HPUX 11.11 goes, we would have to see if Bob Campbell shows up in the morning and sees this post, he could speak to it for us. (I will see if he's around and point it out to him.)

Do you have an HPUX 11.23 machine you can install this on and try?

Hope it helps
John
Spoon!!!!
Bob E Campbell
Honored Contributor

Re: How can I compare the patches list on two systems ?

John, you've outted me ;-)

Sysdiff is a little shell script that flew out under the radar and that has not had a lot of effort since then. I know of at least one defect that needs tending, I could probably make an 11.11 version available for "beta users"...

Let me at least return to Colorado first!

Bob
Peter Godron
Honored Contributor

Re: How can I compare the patches list on two systems ?

Dhote,
how are you getting on with this ?

Please read:
http://66.34.90.71/ITRCForumsEtiquette/after.html

Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions.