IBM Support

Tivoli Network Manager ncp_dla. Don't judge this book by the cover.

Technical Blog Post


Abstract

Tivoli Network Manager ncp_dla. Don't judge this book by the cover.

Body

Take a look at this simple lab demonstration using IBM Tivoli Network Manager version 4.1.1 and an export using ncp_dla.

./ncp_dla.sh ncp_dla.properties.NCOMS411
ncp_DLA ( IBM Tivoli Network Manager IP Edition - Discovery Library Adapter )
Copyright (C) 1997 - 2008 By IBM Corporation.  All Rights Reserved.  See product license for details.

[IDML Generation Mode]

The resulting xml could sent for processing, or just reviewed.

But just taking a snip from the middle of the xml

              <cdm:Label>nc9053113</cdm:Label>
                <cdm:Description>SunOS nc9053113 5.10 Generic_127128-11 i86pc
</cdm:Description>
                <cdm:Fqdn>nc9053113 </cdm:Fqdn>
                <cdm:Manufacturer>net-snmp</cdm:Manufacturer>
                <cdm:Model>SunOS nc9053113 5.10 Generic_127128-11 i86pc</cdm:Model>
 

What is cdm:Model?  Or any of those fields? What if I don't like it or don't think it's correct?  Is there a schema that can help one better understand how this is created?  In this case it looks strangely similar to cdm:Description!

Let's focus on cdm:Model

The schema is located here, based on my DB2 ncim

/opt/IBM/tivoli/netcool/precision/scripts/sql/db2/createCDMSchema.sql

I search this file for 'Model' and find this line

 COALESCE(x.model, c.model, s.sysDescr)                  AS Model,

This answers a couple of questions.   What is set for 'Model' and why it's sysDescr.  This appears to be the default schema setting for Model.

How can this table be changed?  

First decision, make sure you are ready for a global change.   Changing this schema for Model will change how all xml files are created with ncp_dla for this topology, not just this one entity.

This is a view in ncim so it can simply be dropped and created.

In this file I copied the entire table into NOTEPAD or WORDPAD.   Not the entire file or .sql, just the table which includes my reference to Model.  Which are the lines between these

CREATE VIEW CDMCOMPUTERSYSTEM
AS SELECT
....
LEFT OUTER JOIN deviceFunction df ON df.sysObjectId = s.sysObjectId
WHERE m.entityType = 1;

I'll save this file for future use in case I want to restore back to default.   Now I make a copy of it, and edit one line.

 COALESCE(x.model, c.model, df.deviceModel)                  AS Model,

I would like cdm:Model to be deviceModel as saved in the deviceFunction table in ncim.

(read my previous blog about deviceFunction     https://ibm.biz/BdEfi9 )

I save this file to NOTEPAD/WORDPAD

Next I drop this table as it exists today in ncim

[netcool@nc9053113:/opt/IBM/tivoli/netcool/precision/bin] $
./ncp_oql -username ncim -password ncim -service ncim -domain NCOMS411
ncp_oql ( IBM Tivoli Network Manager OQL Interface )
Copyright (C) 1997 - 2010 By IBM Corporation.  All Rights Reserved.  See product license for details.

IBM Tivoli Network Manager Version 4.1.1 (Build 11) 64 bit created by ncpbuild at 13:14:25 Wed May 21 BST 2014

Connected to DB2 DB schema NCIM
|nc9053113:1.> drop view CDMCOMPUTERSYSTEM;
|nc9053113:2.> go
 0 rows(s)
|nc9053113:1.>

paste in the entire new table beginning with 'CREATE' all the way to the semi-colon, and enter 'go'.

Your new table is now in ncim containing your one line change to use df.deviceModel

now run the ncp_dla again, and inspect your xml file.


                <cdm:Label>nc9053113</cdm:Label>
                <cdm:Description>SunOS nc9053113 5.10 Generic_127128-11 i86pc
</cdm:Description>
                <cdm:Fqdn>nc9053113</cdm:Fqdn>
                <cdm:Manufacturer>net-snmp</cdm:Manufacturer>
                <cdm:Model>Solaris running netSnmp</cdm:Model>

 

 

 

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"","label":""},"Component":"","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}}]

UID

ibm11082439