Hi Antonio and Eric,
    Thanks for the fixes provided. You are after two different files, I 
feel both will work. So I picked up the change from Eric at random. I also 
added a check in pre.sles to make sure it works with different versions of 
SLES. Here is the latest code I have checked in xCAT 2.7. You can get it 
from the svn.  xCAT will do verification of the code on both SLES 10 and 
11.
                    if( system( "[ -f /mnt/var/log/YaST2/y2logRPM ]" )  == 
0 ) {
                        old way;
                    }
                    else {
                        # The format of /var/log/zypp/history is 
documented at
                        #     
http://en.opensuse.org/Libzypp/Package_History

                        lastrpm = "prep"

                        oldFS = FS
                        FS="|"

                        while((getline < "/mnt/var/log/zypp/history") > 0) 
{
                                if (\$0 !~ /#/ && \$2 == "install") {
                                        lastrpm = (\$3 "-" \$4)
                                }
                        }
                        close("/mnt/var/log/zypp/history")

                        FS = oldFS

                        print ("installing " lastrpm) |& ns
                   }


Thanks again,

Ling

Ling Gao
Poughkeepsie Unix Development Lab
IBM Systems and Technology Group
Internal: T/L 293-5692 
External: [email protected], 845-433-5692

"I never worry about the future. It comes soon enough." --- Albert 
Einstein 



From:   "Eric M. Agar" <[email protected]>
To:     xCAT Users Mailing list <[email protected]>
Date:   11/18/2011 09:40 PM
Subject:        Re: [xcat-user] nodestat does not inform which rpm is 
being   installed



For you awareness, earlier in the year in defect 3368796 I reported this 
problem along with a possible fix that worked for me on SLES11 SP1.  My 
proposed fix used yet a different file --- I don't remember why.  I have 
vague memories of considering two different possibilities.  It looks like 
someone was recently testing the fix for SLES10 and 11.

Regards,
Eric Agar

On 11/18/2011 12:38 PM, Egan Ford wrote: 
Can you send the diff as an attachment or just attach new_pre.sles?  
Thanks.

On Fri, Nov 18, 2011 at 10:31 AM, Antoine Tabary <
[email protected]> wrote:
Hello, 

I eventually found out a way to have nodestat give information about which 
rpm is being installed during rinstall of a node. All modifications are in 
pre.sles. 

1/ There was a typo xcatdport instead of xcatiport 
2/ The y2logRPM file does not seem to exist anymore, so I used y2log and 
looked into it for the last entry about an rpm installation, and syntax is 
different therefore the way to extract rpm name also differs.

In case someone is interested, here is a summary of the modifications I 
made : 

chou:/opt/xcat/share/xcat/install/scripts # diff -Naur old_pre.sles 
new_pre.sles 
--- old_pre.sles        2011-08-07 14:42:01.000000000 +0200 
+++ new_pre.sles        2011-11-18 18:19:56.000000000 +0100 
@@ -14,7 +14,7 @@ 
 #!$AWK -f 
  
 BEGIN { 
-       xcatdport = "#TABLE:site:key=xcatiport:value#" 
+       xcatiport = "#TABLE:site:key=xcatiport:value#" 
        xcatdhost = "#XCATVAR:XCATMASTER#" 
  
        ns = "/inet/tcp/0/" xcatdhost "/" xcatiport 
@@ -65,14 +65,19 @@ 
                } 
  
                if(\$1 == "stat") { 
-                       while((getline < "/mnt/var/log/YaST2/y2logRPM") > 
0) { 
+                        linerpm = "prep" 
+                       while((getline < "/var/log/YaST2/y2log") > 0) { 
                                line = \$0 
+                               if(line ~ /\.rpm'/) { 
+                                   linerpm = line 
+                                } 
                        } 
-                       close("/mnt/var/log/YaST2/y2logRPM") 
+                       close("/var/log/YaST2/y2log") 
+                        line = linerpm 
  
-                       if(line ~ /\.rpm /) { 
-                               sub(/\.[^\.]+\.rpm .*$/,"",line) 
-                               sub(/^.* /,"",line) 
+                       if(line ~ /\.rpm'/) { 
+                               sub(/\.[^\.]+\.rpm'.*$/,"",line) 
+                               sub(/^.*\//,"",line) 
                        } 
                        else { 
                                line = "prep" 
chou:/opt/xcat/share/xcat/install/scripts # 

Best regards, 


Antoine Tabary 
 17 Avenue De L'europe 

Certified HPC I/T Specialist 
 Bois Colombes Cedex, 92275 
0233AA 
 France 
ITS 
  



  



  

e-mail: 
[email protected] 
  


  
 



Sauf indication contraire ci-dessus:/ Unless stated otherwise above:
Compagnie IBM France
Siège Social : 17 avenue de l'Europe, 92275 Bois-Colombes Cedex
RCS Nanterre 552 118 465
Forme Sociale : S.A.S.
Capital Social : 639.291.962.10 €
SIREN/SIRET : 552 118 465 03644 - Code NAF 6202A 
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
xCAT-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xcat-user




------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d


_______________________________________________
xCAT-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xcat-user

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
xCAT-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xcat-user


<<image/gif>>

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
xCAT-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xcat-user

Reply via email to