WebSphere discovery - Need to get the Installation Type - ND or BASE?

Hi!

We run uCMDB 9.05, CUP14 with CP11

 

I need to get a value (attribute) from ouer WebSphere discovery
The value i need is if the installation is "Network Deployed" or "Base"

The value exsist in the communication log when i run the "J2EE WebSphere by Shell or JMX" job
When the job is finished, the information is also included in the CIT "Configuration Document" as "report.txt" but the file must be opened manually in uCMDB (right click on "report.txt" and then "open")

How do i do to make this value to an attribute?

 

I also attached an example of the file "report.txt"

 

Regards

Laos

  • Hello Laos,

     

    I will try to reproduce your scenario in our labs, and get back to you with the results.

     

    Regards,

    Ana Acosta-Diaz

  • Hi Laos,

     

    To populate an attribute, you can use jython function

    osh.setAttribute(attributeName, attributeValue)

    Can you further elaborate on the following tasks you would like to accomplish, do you want to populate the attribute with string “Network Deployed”, or “Base”, also with respect to the info being included in a file “report.txt”?

     

    Regards,

    Ana Acosta-Diaz

  • Hello Ana-Acosta and thanks for your help!

     

    What I want to achieve is the following
    In the file report.txt (I´ve marked the line in BOLD, se below) there is an "ID" attribute the ID value could be either "ND" or "BASE" that is the value i want to achieve

     

    --------------------------------------------------------------------------------
    IBM WebSphere Application Server Product Installation Status Report
    --------------------------------------------------------------------------------

    Report at date and time February 24, 2014 2:15:23 PM CET

    Installation
    --------------------------------------------------------------------------------
    Product Directory /opt/WebSphere/v6.1/AppServer
    Version Directory /opt/WebSphere/v6.1/AppServer/properties/version
    DTD Directory /opt/WebSphere/v6.1/AppServer/properties/version/dtd
    Log Directory /opt/WebSphere/v6.1/AppServer/logs
    Backup Directory /opt/WebSphere/v6.1/AppServer/properties/version/nif/backup
    TMP Directory /var/tmp

    Product List
    --------------------------------------------------------------------------------
    ND installed
    WEBSERVICES installed

    Installed Product
    --------------------------------------------------------------------------------
    Name IBM WebSphere Application Server - ND
    Version 6.1.0.21
    ID ND
    Build Level cf210844.13
    Build Date 11/6/08

    Installed Product
    --------------------------------------------------------------------------------
    Name WebServices Feature Pack
    Version 6.1.0.21
    ID WEBSERVICES
    Build Level cf210844.03
    Build Date 11/6/08

    --------------------------------------------------------------------------------
    End Installation Status Report
    --------------------------------------------------------------------------------

  • Hi Laos,

     

    Thanks for your response.

    In that case, you can use a variable to hold the content of the file then use a regular expression to find those string. 

    For example, say the content of the file can be obtain using type command.  Below is an example (please note you will need to refine to make it work):

     

    fileContent = type(filename)

    ID = None

    ID = re.match('(ID ND)', fileContent)

     

    If (ID == None):

                    ID = re.match('(ID BASE)', fileContent)

     

     

    If ID is not None:

                    Osh.setattributeValue(‘myAttrib’, ID)

     

     

     

    Hope this helps,

    Ana Acosta-Diaz

  • Verified Answer

    Thanks for your help Ana-Costa!


    However, i must ask a colleague and find out if he can help me to get the script to work because i have no idea what script i should modify and how i then get uCMDB to find the value!


    Would be grateful if you (or anyone else) have more knowledge about that and can share

     

     

    /Laos

  • solved the problem!


    perhaps not the finest solution but i replaced

    "reportFile.description = 'Websphere server version report" "at line 199 in the script file "JMX_J2EE_WebSphere.py" to 

     

                                  if re.search ('ID \ s ND', role.serverVersionInfo):
                                     reportFile.description = 'Network Deployed'
                                 else:
                                     reportFile.description = 'BASE'


    Thanks for all help Ana Acosta!

     

    Best regards
    Laos