A Simple Methodology for Integrating Service Information into TBSM 4.2.1 TBSM Discovery Library Books and Custom Alternate Namespace Support Authors: Blaine Meyer Carol Davis Technical Owner: Jeff Ferla Document Date: July 2011 Page 1 of 61 Note: Before using this information and the product it supports, read the information in Notices. July 2011 © Copyright International Business Machines Corporation 2011. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Page 2 of 61 1 Contents Contents ................................................................................................................................................................ 3 1Introduction......................................................................................................................................................... 5 1.1TBSM Discovery Library Toolkit overview ............................................................................................................. 5 1.1.1Namespace overview .................................................................................................................................... 5 1.1.2Terms and definitions ................................................................................................................................... 6 1.1.3Benefits of using an alternate namespace .................................................................................................... 7 1.1.4Limitation of using an alternate namespace................................................................................................. 8 1.1.5Defining an alternate namespace ................................................................................................................. 9 2Correctly building the IdML book ......................................................................................................................... 9 2.1IdML book format overview ............................................................................................................................... 10 2.2IdML header overview ........................................................................................................................................ 11 2.2.1Defining the XML namespace prefix within the XML document ................................................................ 11 2.2.2Defining the source of the payload ............................................................................................................. 12 2.2.3Example header section .............................................................................................................................. 13 2.3XMLtoolkit and IdML book operations ............................................................................................................... 14 2.3.1Example IdML operations ........................................................................................................................... 14 2.4Payload operations............................................................................................................................................. 15 2.4.1Defining resources in XML format .............................................................................................................. 15 2.4.2Defining relationships in the XML format ................................................................................................... 17 ............................................................................................................................................................................ 18 2.4.3TBSM Generic Namespace resource definitions ......................................................................................... 18 2.4.4Custom alternate namespace definition .................................................................................................... 19 2.4.5Example payload ......................................................................................................................................... 20 2.4.6Creating a business service object .............................................................................................................. 21 2.4.7Creating the tail and footer ........................................................................................................................ 22 2.5Summary ............................................................................................................................................................ 22 3Next steps .......................................................................................................................................................... 25 3.1Naming the book ................................................................................................................................................ 25 3.2Loading the book into TBSM 4.2.1 ..................................................................................................................... 27 3.3Mapping class instances to templates ............................................................................................................... 27 3.3.1Mapping to TBSM templates ...................................................................................................................... 27 3.4Pushing resource attributes into the TBSM service model ................................................................................. 29 4Example MyUniverse IdML book ....................................................................................................................... 34 4.1Book contents ..................................................................................................................................................... 34 Page 3 of 61 4.2Templates used for the Hello World example .................................................................................................... 36 4.2.1Processing the Hello World book ................................................................................................................ 36 4.2.2Viewing the business service in TBSM ........................................................................................................ 37 5Adding the new services to the Service Component Repository ........................................................................ 38 5.1The RAD shell script ............................................................................................................................................ 38 5.2Running the RAD Shell Script .............................................................................................................................. 44 6Prerequisite and installation requirements ........................................................................................................ 46 7Other references ................................................................................................................................................ 47 ............................................................................................................................................................................ 47 8Appendix A. Sample code .................................................................................................................................. 47 8.1Hello World Sample book ................................................................................................................................... 47 8.2Hello World Sample SCR Rad shell script ............................................................................................................ 50 9Appendix B. Troubleshooting ............................................................................................................................. 51 9.1.1The book was processed but nothing appears in the SCR .......................................................................... 51 ............................................................................................................................................................................ 52 9.1.2Errors in the log show the book was not processed successfully and were preceded with prefix not bound errors ....................................................................................................................................................... 52 9.1.3Adding a Description field to the services created by IdML books ............................................................. 52 9.1.4Can I change the service name that appears in TBSM? .............................................................................. 53 9.1.5Top-level services are not showing up under the ‘Imported Business Services’ object ............................. 53 9.1.6Rather than using the Imported Business Services object as an anchor point in the TBSM services tree, I would like to have a different anchor point for my alternate namespace objects. ........................................... 54 9.1.7How can I query the database to verify my services have been imported into the SCR? .......................... 56 9.1.8How can I clean out the SCR and start with an empty database? .............................................................. 57 10Appendix C. Tools and utilities ......................................................................................................................... 58 10.1.1The Component Registry Viewer .............................................................................................................. 58 10.1.2Starting the CRViewer ............................................................................................................................... 58 Page 4 of 61 2 Introduction This document contains information, instructions, and examples of how to create an IBM® Tivoli® Business Service Manager (TBSM) Discovery Library Toolkit book based on an alternate namespace. These books can be used to simplify the input of resources and resource relationships into the TBSM service model. 2.1 TBSM Discovery Library Toolkit overview Since its introduction, the TBSM Discovery Library Toolkit (also known as XMLtoolkit) component has been the primary mechanism for importing resource and relationship information communicated in the IBM Common Data Model (CDM) terms into the TBSM service model. The TBSM service model is rich in its ability to provide a foundation for integrating with products such as IBM Tivoli Application Dependency Discovery Manager (TADDM), IBM Tivoli Monitoring , and other products capable of producing data in CDM semantics. However, limiting the model used to capture resource and relationship information to the CDM can be an inhibitor for integrating non-IBM data. To extend the ability of the TBSM XMLtoolkit to work with non-CDM compliant sources of resource and relationship service model information, the XMltoolkit has been enhanced to support custom models of an alternate, or non-CDM, namespace. When working with alternate namespaces, the XMLtoolkit plays a less significant role in the naming (identification) and reconciliation (resource correlation) process that it provides for CDM sources. Beyond these differences, resources and relationships imported through alternate namespace support are imported through the same process, as their CDM counterparts, including template mapping and event identification. In keeping with the ‘simple’ theme, alternative namespace resources are imported by the XMLtoolkit when correctly contained within an IdML XML document (referred to as an IdML book) nearly identical to the manner that IBM Discovery Library Adapters (DLAs) use to communicate their CDM information. 2.1.1 Namespace overview The primary reason to use a namespace designation is to have the ability to distinguish class categorizations of items that have the same name but are actually not the same entity. As an example, an item with the class designation of mynamespace:car is different from an item with a class designation of yournamespace:car. In this case, even though both items have the same root name “car,” the names Page 5 of 61 can be handled differently because they belong to different namespaces. The Discovery Library Toolkit takes advantage of namespaces so it can process discovery information from multiple sources without being concerned with accidentally overlapping the names of items contained within the information. Another reason to use a namespace designation is to separate the processing of resource creation from the more rigid CDM namespace processing. The CDM processing has strict rules about how to collect the data provided within the book and how the data is processed. A non-CDM compliant data source, such as a custom CCMDB (change and configuration management database, might not be able to conform to these strict rules. A namespace can be implemented by including a namespace prefix on all item names. The tbsm namespace is the default alternate namespace. In most cases, a namespace other than tbsm namespace is more appropriate for the target environment. For the TBSM namespace, the namespace prefix is tbsm:. An example item name is tbsm:WindowsServer. The tbsm namespace is an implementation of an alternate namespace that is recognized by the Discovery Library Toolkit without any customization. 2.1.2 Terms and definitions Before reading this guide, you may want to review these terms and their meaning. If you are familiar with TBSM and the Discovery Library Toolkit, you may choose to skip this section. Term Definition CDM The IBM Common Data Model is a standardized definition of how system solutions and technologies represent resources and their relationships. The Common Data Model is a logical data model that brings together various industry data models, acting as the dictionary and grammar for consistently describing the details and identity of resources. IdML The Identity Markup Language is an extension of the Common Data Model XML schema developed by IBM. The IdML is used by Tivoli Discovery Library Adapters to provide wrapper resource information including attributes and relationships captured in XML format into a structure identifying the source of the data and the operation the consumer should take when reading the information. DLA The Discovery Library Adapter (DLA) is a software application that extracts data about discovered resources and their relationship from a specific application and shares that data by using Common Data Model terminology. The extracted data is typically produced in the form of an IdML book. IBM Tivoli Application Dependency Discovery Manager(TADDM) stores and TADDM Page 6 of 61 CCMDB provides complete and detailed application maps of business applications and supporting infrastructure, including cross-tier dependencies, run-time configuration values, and complete change history. IBM Tivoli Change and Configuration Management Database is an integrated productivity tool and database that helps you manage, audit, and coordinate the change and configuration management processes through user interfaces and workflows that are designed to facilitate cross-silo operation. ESDA ESDAs (External Service Dependency Adapters) are rules defined within TBSM that you use to dynamically import service instances and build service hierarchies from configured data sources. See the IBM Tivoli Business Service Manager V4.2.1 Customization Guide (http://publib.boulder.ibm.com/infocenter/tivihelp/v3r1/index.jsp?topic=/co m.ibm.tivoli.itbsm.doc/welcome.htm) for more information on the use of ESDAs. The TBSM Discovery Library Toolkit is used to import resource definitions and their relationships from products such as TADDM and IBM Tivoli Monitoring. The data can be read by direct product API, as is the case with TADDM, or can be read from an IdML book. An IdML book is an XML file that the TBSM Discovery Library Toolkit knows how to read and process. IdML books contain resource instance information including attribute data and resource class (type) identification and relationship data. 2.1.3 Benefits of using an alternate namespace The major benefit of using alternate namespace support is for simplicity. Using this technique, you can import non-CDM compliant sources of resource and relationship data while at the same time taking advantage of the built-in efficiencies that the XMLtoolkit uses to interface to the TBSM memory-based service model. See the following list of the benefits of using alternate namespace support: Provides a solution for creating resources from data sources that do not comply with the IBM Common Data Model (CDM) standard and whose effort to convert into CDM is prohibitive. A more efficient solution to resource creation as compared to ESDA (External Service Dependency Adapters) resource creation. Book processing can be completely automated where ESDA processing can require manual intervention. The XMLtoolkit interacts with the TBSM memory-based model to make sure it stays current in the most efficient and robust manner. Page 7 of 61 Non-CDM resources are staged through the same process that CDM resources are staged when being processed by the XMLtoolkit. Therefore, techniques used for template mapping, composite definitions, and generating event identification strings can be applied to non-CDM information. The unique identity for a resource is provided by the book source. Unlike the more involved naming (identification) process for CDM resources, the XMltoolkit follows the unique identifier provided in one attribute of the resource. The source of the data has complete control of the naming process. 2.1.4 Limitation of using an alternate namespace Be aware of the following limitations before embarking on the use of an alternate namespace: IdML books with content that includes alternate namespace definitions cannot be consumed by other products such as TADDM. No provision is available for the reconciliation of resources between namespaces. Resources created through an alternate namespace book are not recognized as a duplicate of the same resource that was discovered through a product such as TADDM or Tivoli Monitoring. Page 8 of 61 2.1.5 Defining an alternate namespace An alternate namespace identifier consists of the namespace string and a resource class name string separated by a colon in the form of namespace:class. The best practice for defining alternate namespaces and their resource classes is to use the following guidelines: The alternative namespace name cannot be tbsm or cdm. Provide a string that has more meaning to the source of the data. Do not use special characters in the namespace name. Keep the namespace name short and use only the letters a-z and A-Z, and the numbers 0-9. The namespace string and the class name string must be separated by a colon. Use descriptive class names and use the same best practices as you do for namespaces. However, a period may be used in a class name required. The following examples represent valid alternate namespace class strings: priv:server priv:ibm.server pub:ibm.server.unix Alternative namespace classes are defined in an XMLtoolkit configuration file named described later in this document. The XMLtoolkit provides a default definition for a namespace class definition called tbsm:resource. Although available to help introduce the function, the tbsm:resource class should be not used in favor of defining a set of namespace:class definitions to meet your needs. 3 Correctly building the IdML book As described earlier, the mechanism used to import resource, attribute, and relationship information defined in a custom alternate namespace is to provide the information as content in a modified IdML book. This section describes how to correctly construct the physical structure and content of an IdML book. Page 9 of 61 3.1 IdML book format overview An IdML book captures its data in a valid XML format. An IdML book is made up of four distinct sections: a header, an operation, a payload, and a tail and footnote section. header operation payload tail/footnote Figure 1. When combined together, these sections form a correct IdML book. Page 10 of 61 3.2 IdML header overview The key elements of the IdML header section define the xml namespace prefix for the XML content and associate the resource and relationship information contained within the book with an originating source called the management software system (MSS). 3.2.1 Defining the XML namespace prefix within the XML document The namespace prefix must be defined before it can be used within the xml file. If all namespaces used within the IdML XML document are not correctly defined, the resulting XML is not valid. At the top of the IdML book is the XML header that defines the namespaces in the book. The idml:idml tag that defines the idml, cdm, tbsm, and xsi namespaces is shown in the following example: <idml:idml xmlns:idml="http://www.ibm.com/xmlns/swg/idml" xmlns:cdm="http://www.ibm.com/xmlns/swg/cdm" xmlns:tbsm="http://www.ibm.com/xmlns/swg/tbsm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com/xmlns/swg/idml idml.xsd"> To define an alternative namespace prefix, a similar xmlns attribute must be added to the idml:idml tag. The syntax of the xmlns is: xmlns:prefix="URI" You must provide values for both the prefix and the “URI” for your alternative namespace. The prefix value should be kept short. The “URI” portion of the attribute is a Universal Recourse Identifier that is a string used to identify an Internet resource. Typically this string is a company’s URL that identifies their Internet domain address such as http://www.ibm.com/xmlns/swg/tbsm. Hint: The xml book is not processed by the Discovery Library Toolkit if it is not a valid XML document. A simple test to determine if your book is a valid XML document is to attempt to open it up with a web browser or an xml editor. Page 11 of 61 3.2.2 Defining the source of the payload The management software system section of the header defines the source that should be associated with the payload contained within the book. All resource and relationship information imported through the XMLtoolkit are associated with a source, and import operations are performed within the context of that source. As resource information is imported by the XMLtoolkit, a reference counter is maintained for each resource that counts the number of different sources that have referred to that resource. If two sources convey that a particular resource exists but only one of them says it should be removed, the reference counter is decremented but the resource is not deleted until the reference counter goes to zero. The management software system is defined in the cdm:process.ManagementSoftwareSystem XML element and its unique identity is provided within the cdm:MSSName tag. The key components of the MSSName section that must be customized are included in the following table: Name ManufacturerName ProductName Hostname Description The name of the entity that produced the book, for example, ABC Corp. The name of the product for which this book was created, for example, CustomCCMDDatabase. Used to distinguish between two different instances of the same producer. By convention, the cdm:MSSName tag has the following format: <idml:source IdMLSchemaVersion="0.8"> <cdm:process.ManagementSoftwareSystem CDMSchemaVersion="2.7"> <cdm:MSSName>ibmcdm:///CDMMSS/ManufacturerName=CustomerNameHere+ProductName=Something toDenoteThisBookNameHere+ProductName=Hostname</cdm:MSSName> </cdm:process.ManagementSoftwareSystem> </idml:source> Use this same format within the alternate namespace IdML books but replace the bolded strings with the appropriate values to create a unique string for the payload contained within the book. The actual values of these strings are not as important as the purpose they play in the solution. Therefore, due to the XMLtoolkit resource reference counter, take care in managing the identities of the sources used within the IdML book to make sure the import behavior is as you expect for the operation requested within the book. Page 12 of 61 Notes: Do not use spaces or special characters in either the ManufacturerName value or the ProductName value. The cdm:MSSName tag format is a convention. If the combination of manufacturer, product, and host name do not provide a unique string as desired, concatenate more information onto the string. 3.2.3 Example header section The following example shows a valid header section: <?xml version="1.0" encoding="UTF-8" ?> <idml:idml xmlns:idml="http://www.ibm.com/xmlns/swg/idml" xmlns:cdm="http://www.ibm.com/xmlns/swg/cdm" xmlns:tbsm=http://www.ibm.com/xmlns/swg/tbsm xmlns:my="http://www.mycompany.com/mycompany" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com/xmlns/swg/idml idml.xsd"> <!-- NOTE THIS IDML BOOK DOES NOT FOLLOW STANDARD IDML CONVENTION ITS CONTENTS ARE SUPPORTED ONLY WITH TBSM 4.2 PLUS ENHANCEMENTS --> <!--Header... =================================================== --> <!-- Source and Software... --> <idml:source IdMLSchemaVersion="0.8"> <cdm:process.ManagementSoftwareSystem CDMSchemaVersion="2.7"> <cdm:MSSName>ibmcdm:///CDMMSS/ManufacturerName=mycompany+ProductName=mycompanysourcepro duct+hostname=host1</cdm:MSSName> </cdm:process.ManagementSoftwareSystem> </idml:source> <!-- book operation to follow --> Page 13 of 61 3.3 XMLtoolkit and IdML book operations The IdML book provides the XMLtoolkit with the operation to be applied to the contained resources. The IdML standard defines the following three operations that the book can describe: create: adds the following objects, relationships, and attributes delete: deletes the following objects and relationships refresh: indicates to the XMLtoolkit that the content of the book is the totality of what the source knows about all its resources, relationships, and attributes. The reader of the book should synchronize with this information (resources and relationships that are not in the book that were in previous books should be removed, and new resources and relationships that should be added) The appropriate operation element should be a parent element of the resource and relationships. 3.3.1 Example IdML operations Use the following operation tags to create a payload: <idml:operationSet opid="1"> <cdm:create> <!--Payload --> <cdm:create> </idml:operationSet> Use the following operation tags to delete a payload: <idml:operationSet opid="1"> <cdm:delete> <!--Payload --> <cdm:delete> </idml:operationSet> Use the following operation tags to synchronize the payload. Notice how the refresh and create tags are required. The delete tag has no meaning within a refresh operation. <idml:operationSet opid="1"> Page 14 of 61 <cdm:refresh> <cdm:create> <!--Payload --> <cdm:create> <cdm:refresh> </idml:operationSet> 3.4 Payload operations You must be sure to correctly define the resources, relationships, and attributes that you want to import into the TBSM service model. With alternative namespace support, you can use the TBSM Generic Namespace (tbsm), which is a default namespace, in addition to many custom alternate namespaces. This section first describes the syntax to be used for creating valid XML to communicate resource, attribute, and relationship information. It is followed by a brief description of each type of alternate namespace. Custom alternate namespaces are preferred. 3.4.1 Defining resources in XML format The following basic syntax is used to capture resource and attribute information: <namespace:classname id='bookreferenceid' sourceToken='source(book writer) local id for object' > <namespace:attributename>attribute_value</namespace:attributename> <namespace:attributename>attribute_value</namespace:attributename> <namespace:attributename>attribute_value</namespace:attributename> </ namespace:classname> The structure of this XML element is the same for CDM objects. The following example shows two CDM object instances and non-CDM object instances: <cdm:sys.ComputerSystem id="cvtwin05.ibm.com-ComputerSystem" > <cdm:Name>cvtwin05.ibm.com</cdm:Name> <cdm:Label>cvtwin05.ibm.com</cdm:Label> <cdm:Signature>192.167.0.1</cdm:Signature> <cdm:Type>ComputerSystem</cdm:Type> <cdm:Fqdn>cvtwin05.ibm.com</cdm:Fqdn> </cdm:sys.ComputerSystem> <cdm:sys.windows.WindowsOperatingSystem id="cvtwin05.ibm.com-WindowsOperatingSystem" sourceToken="Primary:CVTWIN05:NT"> <cdm:ManagedSystemName>Primary:CVTWIN05:NT</cdm:ManagedSystemName> Page 15 of 61 <cdm:Name>cvtwin05.ibm.com</cdm:Name> <cdm:Label>cvtwin05.ibm.com</cdm:Label> </cdm:sys.windows.WindowsOperatingSystem> <tbsm:resource id='bookid_websphere' > <tbsm:resType>J2EEServer</tbsm:resType> <tbsm:Label>websphere@host1.com</tbsm:Label> <tbsm:identity>websphere@host1.com_identity</tbsm:identity> </tbsm:resource> <my:server id=”myserver1” > <my:serveridentiy>server_1</ my:serveridentiy > <tbsm:Label>My Server 1</tbsm:Label> </my:server > <my:server id=”myserver2” > <my:serveridentiy>server_2</ my:serveridentiy > <tbsm:Label>My Server 2</tbsm:Label> </my:server > A class resource instance is defined with a containing element that first identifies the class of the resource. In the preceding examples, the instances being defined are for the following classes: cdm:sys.ComputerSystem, cdm:sys.windows.WindowsOperatingSystem, tbsm:resource, and my:server. These classes happen to be in three different namespaces. This starting element tag must contain the remainder of the elements used for the resource definition. The set of CDM classes that may be instantiated are limited to those defined in the NamingRules.xml document that is included with TBSM. o The tbsm namespace is limited to a class named resource, which mainly serves as an example of how to create alternate namespaces. o The mynamespace is a custom alternate namespace that is defined in the OtherNamespaces.xml file, which is described Error! Reference source not found.. The attributes of the class tag are id and sourceToken: o The id attribute tag must be unique within the book. The scope of this tag is only within the book and is used by relationship elements to reference the class instance. The id tag is required. o The sourceToken attribute tag allows the source of the class instance definition to pass along a value that has context only to the source. In many cases, this value is set to a unique identifier on the source system that can be easily used to look up the class instance in the external system. This value is typically used to enable simple launch incontext actions to the external source user interface. A sourceToken is optional. Contained within the class tags are a set of sibling elements, each of which provides an attribute of the instance and its value. Attribute definitions for an attribute instance include cdm:Name, Page 16 of 61 cdm:Label, tbsm:identity, and my:serveridentity. Note that each attribute contains a namespace designation: 3.4.2 o For CDM classes, a set of rules that work with attributes and relationships is used to build the unique identity for the class instance. A discussion on that topic is beyond the purpose of this document. o For the tbsm namespace, the tbsm:identity attribute provides the unique identity value for the instance. o For alternate namespace definitions, one of the attribute elements must be designated to provide the unique identity for the instance of this class. By default, the name of the attribute is tbsm:identity; however, you may assign an identifying attribute for each class in the OtherNamespaces.xml file, which is described in Error! Reference source not found.. This technique moves the responsibility of defining unique identity strings from an IBM modeling effort to the source of the data. Defining relationships in the XML format The syntax that is used to capture relationship information is even simpler. A relationship consists of the following three parts: <[relationship type] [source=book_id] [target=book_id]> Note: The book_id part is the id attribute value used to uniquely identify each resource within the book. This id value has no meaning outside the context of the book. This example defines the following two relationships between resources defined in the preceding section: <cdm:runsOn source="cvtwin05.ibm.com-WindowsOperatingSystem" target="cvtwin05.ibm.com-ComputerSystem" /> <my:dependent source="myserver1" target="myserver2" /> A relationship definition is not contained within a class resource instance definition. A relationship is started with a class designation for the relationship, which is also called the relationship type. Relationship types do not have to be defined to the XMLtoolkit in order to be created. Page 17 of 61 Use a common namespace definition for your alternative namespace resource classes and relationship types. The source and target attribute reference the unique book identifier (the id attribute tag on the class instance definition) to reference the resources within the book that participate in this relationship. Avoid circular relationships. For a typical parent child relationship the source ID is the ID of the parent and the target ID is the ID of the child. In other words, the relationship can be described as the parent (or source) that is dependent on the child (target). For clarity, see the following diagram of how the source and target relations work with regard to parent and child: Source Target 3.4.3 TBSM Generic Namespace resource definitions TBSM Generic Namespace resource definitions use a tbsm namespace prefix. This namespace value is supported by default settings and allows the Discovery Library Toolkit to distinguish between CDM resource definitions and TBSM resource definitions. The TBSM generic resource model definition follows the resource XML definition described in the preceding section but uses default support of the namespace and tbsm:resource class. The following example uses the tbsm:resource definition to define a DB2 table: <tbsm:resource id='ID_TABLE(RADARAMD)DB2ID(PB)' > <tbsm:resType>DB2Table</tbsm:resType> <tbsm:baseid>PB</tbsm:baseid> <tbsm:levelid1>RADARAMD</tbsm:levelid1> <tbsm:Label>RADARAMD</tbsm:Label> <tbsm:identity>RADARAMD:PB</tbsm:identity> </tbsm:resource> Important: Because the resource definition includes a tbsm:identity attribute, this resource definition can create an object in the tbsm namespace. The source of the 'book' provides the identity rules. Page 18 of 61 Because the tbsm namespace by default includes only the one resource class, a best practice is to include an attribute called tbsm:restype to classify the resource type. This namespace is included as a default to provide a clear example of how to use the XMLtoolkit’s alternate namespace support. However, it is a best practice to define and use a custom alternate namespace for defining resources. 3.4.4 Custom alternate namespace definition As a best practice, a custom alternate namespace is preferred over the tbsm namespace. This method gives you an opportunity to create a namespace that better reflects your environment. To define a custom namespace, you must create an additional .xml file named OtherNamespaces.xml and place this file in the xml folder of the TBSM Discovery Library Toolkit. For Windows systems, this location is used: %TBSM_HOME%\XMLtoolkit\xml For non-Windows systems, this location is used: $TBSM_HOME/XMLtoolkit/xml See the following example of the contents of the OtherNamespaces.xml file: <document> <NameSpaceDefinition classname='my:server' identityattribute='serveridentity'/> <NameSpaceDefinition classname='my:application' identityattribute=’applicationidentity'/> <NameSpaceDefinition classname='my:default'/> </document> The preceding example contains alternative namespace definitions for three classes: my:server, my:application, and my:default. Both the my:server and my:application class names also define which attribute value within the IdML book is used as the identifier for each of their respective classes. The my:default class does not specify an identifier attribute so its identifier value defaults to tbsm:identity. Page 19 of 61 With this file in place, and the XMLtoolkit restarted to load the new definitions, an alternative namespace book can be loaded that includes resource definitions for these classes. For example: <my:server id=”server_1” > <my:serveridentiy>server_1</ my:serveridentiy > <tbsm:Label>My Server 1</tbsm:Label> </my:server > <my:application id=”appl_1” > <my:applicationidentity>appl_1</ my: applicationidentity > <tbsm:Label>My Application 1</tbsm:Label> </my: application > <my:default id=”rsc_1” > <tbsm:identity>ResourceDef 1</ tbsm:identity > <tbsm:Label>Resource 1</tbsm:Label> </my:default > <my:uses source=' appl_1' target= ‘server_1' /> <my:dependsOn source=' server_1' target= ‘rsc_1' /> 3.4.5 Example payload One of the best ways to understand the payload sections is by looking at an example. In this example, you define a UserTransaction that is dependent on both an IBM WebSphere® Application Server and a DB2 database running on a particular DB2Instance. This example uses the default tbsm namespace. Comments are included to help explain the purpose of the XML content: <!-- this is a comment begin tag The following tags end the comment --> <!-- -this id is only used as reference within the file-book --> <tbsm:resource id='bookid_trans1' > <!-- the toolkit does not enforce values here but it would be wise for you to break your resources up into types which will allow you to map them to templates later on --> <tbsm:resType>UserTransaction</tbsm:resType> <!-- the displayname you will see in tbsm --> <tbsm:Label>ImportantTransaction</tbsm:Label> <!-- the unique identity string for this object - it must be namespace unique --> <tbsm:identity>UserTransaction_uniqueIdentify</tbsm:identity> Page 20 of 61 <!-- you can add any number of additional attributes on the object that may be used for your solution ... just make sure you follow standard xml formatting --> <tbsm:attr1> attrvalue1</tbsm:attr1> <!-- the closing tag for the resource definition. </tbsm:resource> <!-the definition of the websphere resource <tbsm:resource id='bookid_websphere' > <tbsm:resType>J2EEServer</tbsm:resType> <tbsm:Label>websphere@host1.com</tbsm:Label> <tbsm:identity>websphere@host1.com_identity</tbsm:identity> </tbsm:resource> --> <!-the db table --> <tbsm:resource id='bookid_dbtable' > <tbsm:resType>DBTable</tbsm:resType> <tbsm:Label>table1</tbsm:Label> <tbsm:identity>table1@Db2Instance1</tbsm:identity> </tbsm:resource> <!-the db instance --> <tbsm:resource id='bookid_db2inst' > <tbsm:resType>DB2</tbsm:resType> <tbsm:Label>Db2Instance1</tbsm:Label> <tbsm:identity>Db2Instance1@host1</tbsm:identity> </tbsm:resource> <!-and now the relationships between them --> <tbsm:uses source=' bookid_trans1' target= 'bookid_websphere' /> <tbsm:uses source=' bookid_trans1' target= 'bookid_dbtable' /> <tbsm:uses source=' bookid_dbtable' target= 'bookid_db2inst' /> After being wrapped in a correct header and tail/footnote section, the preceding XML coding can be processed by the TBSM Discovery Library Toolkit and the resources created in TBSM Component Registry. When the resource is in the component registry, the resource is then available to use to build service models. 3.4.6 Creating a business service object The XMLtoolkit maintains a repository of resources and relationships to be used to build service models within TBSM. However, the XMLtoolkit automatically pushes certain resource class types into the TBSM service model that in turn pull in all of its dependent objects. Although the list of classes that support this behavior is customizable, a CDM BusinessSystem object is a defined object that is simple to build within any IdML book. Therefore, you may want to use that namespace class to define the high-level Page 21 of 61 resource in the service model. The cdm:Name attribute is the only required attribute to provide the unique naming of the BusinessSystem resource instance. Mixing namespaces in a book is acceptable and a best practice when building resources that are meant to be business systems. To create a business service object, the Common Data Model class name for a business service must be used. See the following example of a business service definition: <cdm:sys.BusinessSystem id='myBusinessService' sourceToken='My Business Service' > <cdm:Name>My Business Service</cdm:Name> <cdm:Label>My Business Service </cdm:Label> </cdm:sys.BusinessSystem> 3.4.7 Creating the tail and footer The tail and footer of the IdML book end the XML elements of the header and operation sections of the document. For example, a refresh operation book is ended with this block of static text: <!-- END OF PAYLOAD --> </cdm:CDM-ER-Specification> </idml:create> </idml:refresh> </idml:operationSet> </idml:idml> A create operation book is ended with this block of static text: <!-- END OF PAYLOAD --> </cdm:CDM-ER-Specification> </idml:create> </idml:operationSet> </idml:idml> A delete operation book is ended with this block of static text: <!-- END OF PAYLOAD --> </cdm:CDM-ER-Specification> </idml:delete> </idml:operationSet> </idml:idml> 3.5 Summary Page 22 of 61 Combining the header, operation, payload, and tail sections together result in an IdML book that can be imported with the XMLtoolkit. The following example can be copied into a separate file and imported into the XMLtoolkit: <?xml version="1.0" encoding="UTF-8" ?> <idml:idml xmlns:idml="http://www.ibm.com/xmlns/swg/idml" xmlns:cdm="http://www.ibm.com/xmlns/swg/cdm" xmlns:tbsm="http://www.ibm.com/xmlns/swg/tbsm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com/xmlns/swg/idml idml.xsd"> <!-- NOTE THIS IDML BOOK DOES NOT FOLLOW STANDARD IDML CONVENTION ITS CONTENTS ARE SUPPORTED ONLY WITH TBSM 4.2 PLUS ENHANCEMENTS --> <!--Header... =================================================== --> <!-- Source and Software... --> <idml:source IdMLSchemaVersion="0.8"> <cdm:process.ManagementSoftwareSystem CDMSchemaVersion="2.7"> <cdm:MSSName>ibmcdm:///CDMMSS/ManufacturerName=mycompany+ProductName=myproduct+Hostname = host1</cdm:MSSName> </cdm:process.ManagementSoftwareSystem> </idml:source> <!-- Operation... --> <idml:operationSet opid="1"> <idml:refresh> <idml:create> <cdm:CDM-ER-Specification> <!-- BEGINNING OF CONTENT --> <tbsm:resource id='bookid_trans1' > <!-- -this id is only used as reference within the file-book --> <tbsm:resType>UserTransaction</tbsm:resType> <!-- the toolkit does not enforce values here but it would be wise for you to break your resources up into types which will allow you to map them to templates later on --> <tbsm:Label>ImportantTransaction</tbsm:Label> <!-- the displayname you will see in tbsm --> <tbsm:identity>UserTransaction_uniqueIdentify</tbsm:identity> <!-the unique identity string for this object - it must be globally unique this value is used to build the serviceinstancename in tbsm thought it will not be exact --> <tbsm:attr1> attrvalue1</tbsm:attr1> <!-you can add any number of additional attributes on the object that may be used to your solution ... just make sure you follow standard xml formatting --> </tbsm:resource> Page 23 of 61 <tbsm:resource id='bookid_websphere' > <tbsm:resType>J2EEServer</tbsm:resType> <tbsm:Label>websphere@host1.com</tbsm:Label> <tbsm:identity>websphere@host1.com_identity</tbsm:identity> </tbsm:resource> <tbsm:resource id='bookid_dbtable' > <tbsm:resType>DBTable</tbsm:resType> <tbsm:Label>table1</tbsm:Label> <tbsm:identity>table1@Db2Instance1</tbsm:identity> </tbsm:resource> <tbsm:resource id='bookid_db2inst' > <tbsm:resType>DB2</tbsm:resType> <tbsm:Label>Db2Instance1</tbsm:Label> <tbsm:identity>Db2Instance1@host1</tbsm:identity> </tbsm:resource> <tbsm:uses source=' bookid_trans1' target= 'bookid_websphere' /> <tbsm:uses source=' bookid_trans1' target= 'bookid_dbtable' /> <tbsm:uses source=' bookid_dbtable' target= 'bookid_db2inst' /> <cdm:sys.BusinessSystem id='myBusinessService'> <cdm:Name>My Business Service</cdm:Name> <cdm:Label>My Business Service </cdm:Label> </cdm:sys.BusinessSystem> <tbsm:contains source=’ myBusinessService‘ target=' bookid_trans1' /> <!-- END OF CONTENT --> </cdm:CDM-ER-Specification> </idml:create> </idml:refresh> </idml:operationSet> </idml:idml> Page 24 of 61 4 Next steps After the alternate namespace IdML book is created, you must complete a few more steps to successfully use the resource, attribute, and relationship information within the TBSM service model. 4.1 Naming the book The name of the .xml file for a book is important. The name not only helps identify the author or source of the book, but this file name also contains a date and time that enables the Discovery Library Toolkit to process multiple books from the same author in the correct sequence. Use the following format to name the .xml file: <author_name><host_name>.YYYY-MM-DDTHH.MM.SSZ.xml where: <author_name> is the unique name classifying the source of the book. <host_name> is the fully qualified host name of the host the file was generated from. A period (.) is used to separate the host name from the date. YYYY signifies the four-digit year. MM is the zero-padded two-digit month. DD is the zero-padded two-digit day. A “T” is used to separate the date and time. HH is the zero-padded two-digit hour in 24-hour time. MM is the zero-padded two-digit minute. SS is the zero-padded two-digit second. A “Z” is used to represent the time zone offset. The “Z” defines no offset. This attribute is required. The .xml extension is used by all files. Any book that contains the cdm:refresh operation should include the word refresh in the file name following the timestamp of the book. See the following examples of file names: ABCCorp.myserver.mylocation.abc.com.2005-03-07T12.05.00Z.xml ABCCorp.myserver.mylocation.abc.com.2005-04-07T22.12.08Z.refresh.xml Page 25 of 61 Page 26 of 61 4.2 Loading the book into TBSM 4.2.1 The book can be loaded into TBSM by using the Discovery Library Toolkit. Ensure that the Discovery Library Toolkit is configured to read books and copy the book into the import book folder/directory provided when Discovery Library Toolkit was installed. By default, this important directory is named in the following way: For Windows systems: %TBSM_HOME%\discovery\dlbooks For Non-Windows systems: $TBSM_HOME/discovery/dlbooks Important: Verify that the Discovery Library Toolkit is configured to process books by looking in the xmltoolkitsvc.properties properties file. This file is located in the %TBSM_HOME%\XMLtoolkit\bin directory. To import books, set the DL_ImportSource property to all or books. 4.3 Mapping class instances to templates For the information in an IdML book to be used within TBSM, the alternate namespace classes must be mapped to the TBSM templates. Templates are used by TBSM to provide a definition and default behavior to all TBSM resource instances. Resource instances can have more than one template assigned to them. 4.3.1 Mapping to TBSM templates TBSM includes a default set of templates that can be assigned and used when processing an IdML book. New templates can also be defined and used in this mapping process. For more information about using templates, see Working with service templates in Exploring TBSM 4.2.1 (http://publib.boulder.ibm.com/infocenter/tivihelp/v3r1/topic/com.ibm.tivoli.itbsm.doc/ServiceConfigu rationGuide/bsmu_dftc.html). Page 27 of 61 The CDM_TO_TBSM4x_MAP_Templates.xml file in the Discovery Library Toolkit contains all the template mappings that are used when an IdML book is read. Edit this file to add new template mappings for alternate namespace classes. For more information about how to add template mappings, see Customizing Discovery Library data with XML control files (http://publib.boulder.ibm.com/infocenter/tivihelp/v3r1/topic/com.ibm.tivoli.itbsm.doc_4.1/bsma_dsc c_discoverylibraryeventmapping.htm?resultof="Customizing" "custom" "Discovery" "discoveri" "Library" "librari" "data" "XML" "xml" "control" "files" "file"). See the following example of the Business Service template mapping: <template primary='BSM_BusinessService' > <othertemplate name='SCR_RetrieveDependentObjectsTemplate'/> <othertemplate name='SCR_ServiceComponentRawStatusTemplate'/> <cdmclass name='cdm:sys.BusinessSystem'/> <cdmclass name='cdm:process.BusinessService'/> </template> In this example, a primary template named BSM_BusinessService and secondary templates SCR_RetrieveDependentObjectsTemplate and SCR_ServiceComponentRawStatusTemplate are assigned to an item within the IdML book whenever an item contains an XML tag with a value of n element with a value of cdm:sys.BusinessSystem. Although assigning “other” templates is always optional when creating a template to class mapping, because the alternate namespace objects are managed through the XMLtoolkit, be sure to add the SCR_RetrieveDependentObjectsTemplate template to all the alternate namespace resource classes. The SCR_ServiceComponentRawStatusTemplate template is a default event status template that is replaced in most TBSM implementations. Important: Whenever a new mapping is added to the CDM_TO_TBSM4x_MAP_Templates.xml file, the Discovery Library Toolkit must be stopped and restarted. Note: In this example, the CDM class name is cdm:sys.BusinessSystem, but the TBSM template name is BSM_BusinessService. When using alternate namespace classes, the template mapping syntax is the same. If a TBSM namespace value of tbsm:resource is mapped to the BSM_BusinessService template, use the following business service template mapping: <template primary='BSM_BusinessService' > <othertemplate name='SCR_RetrieveDependentObjectsTemplate'/> Page 28 of 61 <othertemplate name='SCR_ServiceComponentRawStatusTemplate'/> <cdmclass name='cdm:sys.BusinessSystem'/> <cdmclass name='cdm:process.BusinessService'/> <cdmclass name='tbsm:resource'/> </template> Notice the addition of the <cdmclass name='tbsm:resource'/> line to the mapping. A template mapping can also assign templates that you create. The process of mapping a user-defined template to the alternate namespace classes in the IdML book is no different that mapping the value to a template supplied by TBSM. The template must be defined before it can be used in a template mapping definition. 4.4 Pushing resource attributes into the TBSM service model You can add any number of attributes to a resource by adding XML elements for each attribute within the resource tag, for example: <tbsm:resource id='bookid_db2inst' > <tbsm:resType>DB2</tbsm:resType> <tbsm:Label>Db2Instance1</tbsm:Label> <tbsm:identity>Db2Instance1@host1</tbsm:identity> <tbsm:ownername>Marketing</tbsm:ownername> </tbsm:resource> In this example, the resource contains four attributes: tbsm:resType tbsm:Label tbsm:identity tbsm:ownername These attributes are added to the resource when the resource is created in the XMLtoolkit Component Registry, but the attributes are not pushed into the TBSM memory service model. These attributes are not displayed on the Additional tab of the Service Editor. To load the additional attributes into the TBSM service model so they are viewable on the Additional tab, you must modify the componentAttributesLimited database view . The modification of this database view is currently seen as an inconvenience might be addressed in a future release of TBSM. Page 29 of 61 The view’s definition is contained in the scc_schema_views.sql file that is installed as part of the TBSM Discovery Library Toolkit. The file is located in the sql folder. Depending on your system, the sql folder is typically found in the following location: For Windows systems: %TBSM_HOME%\XMLtoolkit\sql For non-Windows systems: $TBSM_HOME/XMLtoolkit/sql To add a new attribute so it is displayed on the Additional tab of the Service Editor, complete the following steps: 1. Make a backup copy of the scc_schema_views.sql file in case you need to restore it for any reason. Important: The Discovery Library Toolkit does not detect that a file such as scc_schema_views.sql has been changed from its installed version. You must copy your modified version to a safe location. If an update is applied to the Discovery Library Toolkit, you might have to apply your view changes after the update. 2. Edit the view definition in the scc_schema_views.sql file by searching for “CREATE view view_componentAttributesLimited”. You should see a set of sql commands that look similar to these commands: CREATE view view_componentAttributesLimited AS select lmain.service_id as id, p.keyword as keyword, c.weight as weight, lmain.radinstanceid as radinstanceid, c.arrayindex as arrayindex, c.value as value FROM sccp_componentAttributes as c JOIN scc_serviceId_to_component_id as ll ON ll.comp_id=c.comp_id and ll.type in (0,1) JOIN scc_serviceId_to_component_id as lmain ON lmain.service_id=ll.service_id and lmain.type=0 and lmain.radinstanceid is not null JOIN cdm_AttributeIds as p ON p.id=c.keyword_id WHERE c.deleted=0 and p.id in (select id from cdm_AttributeIds WHERE keyword IN ( 'cdm:ManagedSystemName', 'cdm:Name', 'cdm:Fqdn', 'cdm:SMFID', 'cdm:OSName', 'cdm:JobName', 'cdm:Label', Page 30 of 61 'cdm:JobType' )) 3. The important line is the last line that is highlighted in bold. To add attributes to the view, add each attribute name to the list of names contained in the IN() list. As an example, to add an attribute with a name of tbsm:resType, change the list of names to this: WHERE c.deleted=0 and p.id in (select id from cdm_AttributeIds WHERE keyword IN ( 'cdm:ManagedSystemName', 'cdm:Name', 'cdm:Fqdn', 'cdm:SMFID', 'cdm:OSName', 'cdm:JobName', 'cdm:Label', 'cdm:JobType', 'tbsm:resType' )) Important: Notice the new attribute name in the list that is highlighted in bold. Also notice that a comma is added to the cdm:JobType attribute name. The list of names must be in the form of a comma-separated list. 4. Save the file changes. 5. To update the view, run this TBSM Discovery Library Toolkit command found in the $TBSMHOME/XMLtoolkit/bin directory: On Windows systems: setdbschema.bat –U database_userid –P < database_password –f v On non-Windows systems: setdbschema.sh –U database_userid –P < database_password –f v Note: Be sure to replace the database_userid and database_password with the correct values for your configuration. 6. If the alternate namespace resources are already in the TBSM service model, log in to TBSM and invalidate the service tree. To add a set of attributes that begin with the same namespace, follow these steps: Page 31 of 61 1. Follow the same steps used to add individual attributes above except add a like… clause to the sql in this manner: WHERE c.deleted=0 and p.id in (select id from cdm_AttributeIds WHERE keyword IN ( 'cdm:ManagedSystemName', 'cdm:Name', 'cdm:Fqdn', 'cdm:SMFID', 'cdm:OSName', 'cdm:JobName', 'cdm:Label', 'cdm:JobType' ) or keyword like ‘tbsm:%’) The new clause is inserted between the two close parentheses ( ) ) after the IN() list statement. This modification adds any attribute with a keyword value that begins with tbsm: to the list of attributes on the Additional tab. See the following example of what the tab contents look like: Notice the tbsm: named attribute at the bottom of the panel. Page 32 of 61 2. To update the view, run the following TBSM Discovery Library Toolkit command found in the $TBSMHOME/XMLtoolkit/bin directory: On Windows systems: setdbschema.bat –U database_userid –P < database_password –f v On non-Windows systems: setdbschema.sh –U database_userid –P < database_password –f v Note: Be sure to replace database_userid and database_password with the correct values for your configuration. 3. If the alternate namespace resources are already in the TBSM service model, log in to TBSM and invalidate the service tree. Page 33 of 61 5 Example MyUniverse IdML book A non-technical example of an IdML book is included to illustrate the flexibility of the Discovery Library Toolkit and the use of a namespace. In this example, a book is created that represents a small portion of the universe. This book contains a high-level business service named My Universe that contains dependent items such as planets. The planet item contains dependent continent items and so on. See the following sample hieratical view: My Universe Planet Earth North America United States 5.1 Book contents The IdML book contents for the universe model looks like the following example: <?xml version="1.0" encoding="UTF-8" ?> <idml:idml xmlns:idml="http://www.ibm.com/xmlns/swg/idml" xmlns:cdm="http://www.ibm.com/xmlns/swg/cdm" xmlns:tbsm="http://www.ibm.com/xmlns/swg/tbsm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com/xmlns/swg/idml idml.xsd"> <!-- NOTE THIS IDML BOOK DOES NOT FOLLOW STANDARD IDML CONVENTION ITS CONTENTS ARE SUPPORTED ONLY WITH TBSM 4.2 PLUS ENHANCEMENTS --> <!--Header... =================================================== --> <!-- Source and Software... --> <idml:source IdMLSchemaVersion="0.8"> <cdm:process.ManagementSoftwareSystem CDMSchemaVersion="2.7"> <cdm:MSSName>ibmcdm:///CDMMSS/ManufacturerName=AnyCustomer+ProductName=AnyProductName+H ostname=host1</cdm:MSSName> </cdm:process.ManagementSoftwareSystem> Page 34 of 61 </idml:source> <!-- Operation... --> <idml:operationSet opid="1"> <idml:refresh> <idml:create> <cdm:CDM-ER-Specification> <!-- BEGINNING OF CONTENT --> <cdm:sys.BusinessSystem id='myuniverse' sourceToken='My Universe' > <cdm:Name>My Universe</cdm:Name> <cdm:DisplayName>My Universe</cdm:DisplayName> </cdm:sys.BusinessSystem> <tbsm:resource id='earth' > <tbsm:resType>Planet</tbsm:resType> <tbsm:Label>Earth</tbsm:Label> <tbsm:identity>planet_earth_uniqueIdentity</tbsm:identity> <tbsm:attr1>billions</tbsm:attr1> </tbsm:resource> <tbsm:resource id='mars' > <tbsm:resType>Planet</tbsm:resType> <tbsm:Label>Mars</tbsm:Label> <tbsm:identity>planet_mars_uniqueIdentity</tbsm:identity> </tbsm:resource> <tbsm:resource id='continent1' > <tbsm:resType>Continent</tbsm:resType> <tbsm:Label>North America</tbsm:Label> <tbsm:identity>continent1@earth</tbsm:identity> </tbsm:resource> <tbsm:resource id='country1' > <tbsm:resType>Country</tbsm:resType> <tbsm:Label>United States</tbsm:Label> <tbsm:identity>country1@continent1</tbsm:identity> </tbsm:resource> <tbsm:resource id='country2' > <tbsm:resType>Country</tbsm:resType> <tbsm:Label>Canada</tbsm:Label> <tbsm:identity>country2@continent1</tbsm:identity> </tbsm:resource> <!-- relationships that link continents to planets, countries to continents and planets to the universe --> <tbsm:uses source='earth' target= 'continent1' /> <tbsm:uses source='continent1' target= 'country1' /> <tbsm:uses source='continent1' target= 'country2' /> <tbsm:uses source='myuniverse' target= 'earth' /> <tbsm:uses source='myuniverse' target= 'mars' /> <!-- END OF CONTENT --> </cdm:CDM-ER-Specification> Page 35 of 61 </idml:create> </idml:refresh> </idml:operationSet> </idml:idml> The book contains the required sections, including header, operation, payload, and tail and footnote as described previously. The book also contains one business service definition that serves the purpose of forcing the universe instance model into the TBSM service model under the Imported Business Systems service instance in TBSM: <cdm:sys.BusinessSystem id='myuniverse' sourceToken='My Universe' > <cdm:Name>My Universe</cdm:Name> <cdm:DisplayName>My Universe</cdm:DisplayName> </cdm:sys.BusinessSystem> 5.2 Templates used for the Hello World example To keep this example simple, no new templates are defined. This example book uses templates that are delivered and installed with the TBSM 4.2.1 base product. The following templates are used: 1. BSM_BusinessService 2. SCR_RetrieveDependentObjectsTemplate 3. SCR_ServicecomponentRawStatusTemplate 5.2.1 Processing the Hello World book A single class to template mapping was added to the CDM_TO_TBSM4x_MAP_Templates.xml file before this example book was processed. This mapping maps any cdmclass element that contains a tbsm:resource name attribute value and assigns the SCR_RetrieveDependentObjectsTemplate and SCR_ServicecomponentRawStatusTemplate templates to the created service instance. To process this book, copy the XML file into the folder that the TBSM Discovery Library Toolkit was configured to read books from. The TBSM Discovery Library Toolkit processes this .xml file similarly to other IdML books. Page 36 of 61 5.2.2 Viewing the business service in TBSM When processed by the TBSM Discovery Library Toolkit, this business service is then displayed in the Services tree in the container named “Imported Business Services,” as shown in the following figure: Page 37 of 61 6 Adding the new services to the Service Component Repository Although the new services instances are now visible in the Service Tree, they are not visible in the Service Component Repository (SCR). To see them in the SCR, use the RAD shell command that is built into the TBSM 4.2.1 product. The RAD shell is a command-line scripting tool that is available on the TBSM 4.2.1 Data server. Using the RAD shell command is fairly straightforward. For more information about the RAD shell, see the link in chapter 5, “Other References”. 6.1 The RAD shell script See the following complete RAD shell script from the Hello World book example: addServiceInstance( new String[] { "SCR_RootTemplate" }, "SCR_Namespace", "Alternate Namespace", "SCR Alternate Namespace Resources", "Standard", null, null, "REGULAR" ); addServiceInstance( new String[] { "SCR_TopLevelAggregateTemplate","SCR_ServiceComponentRawStatusTem plate" }, "SCR_HelloWorld", "Hello World", "SCR Hello World Resources", "Standard", null, null, "REGULAR" ); addServiceInstanceDependency( "SCR_Namespace", "SCR_HelloWorld" ); addUserPreferencesForInstance( "SCR_HelloWorld", Page 38 of 61 "classnamefilter", "'tbsm:resource'" ); Basically, this script creates the service model in the SCR that is used to place the new services added by the alternate namespace book. After running the script, the SCR looks like the example Service Navigation window shown in the following figure: Page 39 of 61 See the following description of what each RAD command in the script does: 1. This script command creates a service instance and assigns it a template named SCR_RootTemplate: addServiceInstance( new String[] { "SCR_RootTemplate" }, "SCR_Namespace", "Alternate Namespace", "SCR Alternate Namespace Resources", "Standard", null, null, "REGULAR" ); This template is defined as part of the TBSM 4.2.1 installation. The command also assigns the following values to the service instance: Service Name = “SCR_Namespace” Display Label = “Alternate Namespace” Description = “SCR Alternate Namespace Resources” Service Level = “Standard” The command also assigns the following three parameters that are not relevant to this example, but are included for completeness in describing the values assigned by the RAD command: Raw Event Fields = null Raw Event Values = null Instance Type “REGULAR” Page 40 of 61 This created service instance becomes the top-level container for the remaining service instances as shown in the following figure: 2. This script command creates a second service instance and assigns it two templates named SCR_TopLevelAggregateTemplate and SCR_ServiceComponentRawStatusTemplate: addServiceInstance( new String[] { "SCR_TopLevelAggregateTemplate","SCR_ServiceComponentRawSta tusTemplate" }, "SCR_HelloWorld", "Hello World", "SCR Hello World Resources", "Standard", null, null, "REGULAR" ); These templates are also defined as part of the TBSM 4.2.1 installation. The command also assigns these values to the service instance: Service Name = “SCR_HelloWorld” Display Label = “Hello World” Description = “SCR Hello World Resources” Service Level = “Standard” Page 41 of 61 The last 3 parameters are not relevant to this example, but for completeness they are: Raw Event Fields = null Raw Event Values = null Instance Type “REGULAR” This service instance will become the second level container for the service instances. In general you can have as many containers as you need. For this example we have 1. Page 42 of 61 1. The last two script commands: addServiceInstanceDependency( "SCR_Namespace", "SCR_HelloWorld" ); addUserPreferencesForInstance( "SCR_HelloWorld", "classnamefilter", "'tbsm:resource'" ); a. Creates a dependency link between the two service instances created by the first two commands. b. Adds a new attribute to the “SCR_HelloWorld” service instance named “classnamefilter” and gives this new attribute a value of “'tbsm:resource”. This class filter determines which service instances will appear under the “SCR_HelloWorld” instance. For this example all of the alternate namespace service were assigned the “tbsm:resource” class. Page 43 of 61 6.2 Running the RAD Shell Script To run the example RAD shell scripts: 1. Copy this entire script and paste it into a text editor: addServiceInstance( new String[] { "SCR_RootTemplate" }, "SCR_Namespace", "Alternate Namespace", "SCR Alternate Namespace Resources", "Standard", null, null, "REGULAR" ); addServiceInstance( new String[] { "SCR_TopLevelAggregateTemplate","SCR_ServiceComponentRawStatusTemplate" }, "SCR_HelloWorld", "Hello World", "SCR Hello World Resources", "Standard", null, null, "REGULAR" ); addServiceInstanceDependency( "SCR_Namespace", "SCR_HelloWorld" ); addUserPreferencesForInstance( "SCR_HelloWorld", "classnamefilter", "'tbsm:resource'" ); 2. Save the script file with a file extension of .radsh. 3. On your TBSM 4.2.1 Data server, open a command prompt and navigate to Page 44 of 61 • $TBSM_HOME/bin on Linux or UNIX systems or • %TBSM_HOME%\bin on Windows systems Run one of these command to run the script, replacing <file_name> with the fully qualified file name of your script: • cat <file_name> | $TBSM_HOME/bin/rad_radshell on Linux or UNIX systems or • type <file_name> | %TBSM_HOME\bin\rad_radshell on Windows systems Page 45 of 61 7 Prerequisite and installation requirements Other than having TBSM 4.2.1 installed and configured, the only other components that are required to process alternate namespace book are the TBSM 4.2.1 Discovery Library Toolkit . Page 46 of 61 8 Other references The following table contains IBM TBSM Information Center links to useful resources: TBSM guides Links to TBSM Information Center websites TBSM 4.2.1 Installation Guide, Installing the Discovery Library Toolkit http://publib.boulder.ibm.com/infocenter/tivihelp/v3r1 /topic/com.ibm.tivoli.itbsm.doc/installguide/bsmi_t_inst alling_discovery_library_toolkit.html TBSM 4.2.1 Customization Guide, Customizing http://publib.boulder.ibm.com/infocenter/tivihelp/v3r1 /topic/com.ibm.tivoli.itbsm.doc/scenarios/bsms_dscc_di Discovery Library data and XML control files scoverylibraryeventmapping.html TBSM 4.2.1 Service configuration Guide, ESDA Overview http://publib.boulder.ibm.com/infocenter/tivihelp/v3r1 /topic/com.ibm.tivoli.itbsm.doc/ServiceConfigurationGu ide/bsmu_esdc.html TBSM 4.2.1 Adminstration Guide, Administering TBSM using the RAD shell tool. http://publib.boulder.ibm.com/infocenter/tivihelp/v3r1 /topic/com.ibm.tivoli.itbsm.doc/adminguide/bsma_t_us ing_rad_shell.html 9 Appendix A. Sample code See the following sample Hello World code and RAD shell script. 9.1 Hello World Sample book <?xml version="1.0" encoding="UTF-8" ?> <idml:idml xmlns:idml="http://www.ibm.com/xmlns/swg/idml" xmlns:cdm="http://www.ibm.com/xmlns/swg/cdm" xmlns:tbsm="http://www.ibm.com/xmlns/swg/tbsm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com/xmlns/swg/idml idml.xsd"> <!-- NOTE THIS IDML BOOK DOES NOT FOLLOW STANDARD IDML CONVENTION ITS CONTENTS ARE SUPPORTED ONLY WITH TBSM 4.2 PLUS ENHANCEMENTS Page 47 of 61 --> <!--Header... =================================================== --> <!-- Source and Software... --> <idml:source IdMLSchemaVersion="0.8"> <cdm:process.ManagementSoftwareSystem CDMSchemaVersion="2.7"> <cdm:MSSName>ibmcdm:///CDMMSS/ManufacturerName=AnyCustomer+ProductName=AnyProductName</ cdm:MSSName> </cdm:process.ManagementSoftwareSystem> </idml:source> <!-- Operation... --> <idml:operationSet opid="1"> <idml:refresh> <idml:create> <cdm:CDM-ER-Specification> <!-- BEGINNING OF CONTENT --> <cdm:sys.BusinessSystem id='myuniverse' sourceToken='My Universe' > <cdm:Name>My Universe</cdm:Name> <cdm:DisplayName>My Universe</cdm:DisplayName> </cdm:sys.BusinessSystem> <tbsm:resource id='earth' > <tbsm:resType>Planet</tbsm:resType> <tbsm:Label>Earth</tbsm:Label> <tbsm:identity>planet_earth_uniqueIdentify</tbsm:identity> <tbsm:attr1>billions</tbsm:attr1> </tbsm:resource> <tbsm:resource id='mars' > <tbsm:resType>Planet</tbsm:resType> <tbsm:Label>Mars</tbsm:Label> <tbsm:identity>planet_mars_uniqueIdentify</tbsm:identity> </tbsm:resource> <tbsm:resource id='continent1' > <tbsm:resType>Continent</tbsm:resType> <tbsm:Label>North America</tbsm:Label> <tbsm:identity>continent1@earth</tbsm:identity> </tbsm:resource> <tbsm:resource id='country1' > <tbsm:resType>Country</tbsm:resType> <tbsm:Label>United States</tbsm:Label> <tbsm:identity>country1@continent1</tbsm:identity> </tbsm:resource> <tbsm:resource id='country2' > <tbsm:resType>Country</tbsm:resType> <tbsm:Label>Canada</tbsm:Label> Page 48 of 61 <tbsm:identity>country2@continent1</tbsm:identity> </tbsm:resource> <!-- relationships that link continents to planets, countries to continents and planets to the universe --> <tbsm:uses source='earth' target= 'continent1' /> <tbsm:uses source='continent1' target= 'country1' /> <tbsm:uses source='continent1' target= 'country2' /> <tbsm:uses source='myuniverse' target= 'earth' /> <tbsm:uses source='myuniverse' target= 'mars' /> <!-- END OF CONTENT --> </cdm:CDM-ER-Specification> </idml:create> </idml:refresh> </idml:operationSet> </idml:idml> Page 49 of 61 9.2 Hello World Sample SCR Rad shell script addServiceInstance( new String[] { "SCR_RootTemplate" }, "SCR_Namespace", "Alternated Namespace", "SCR Alternate Namespace Resources", "Standard", null, null, "REGULAR" ); addServiceInstance( new String[] { "SCR_TopLevelAggregateTemplate","SCR_ServiceComponentRawStatusTem plate" }, "SCR_HelloWorld", "Hello World", "SCR Hello World Resources", "Standard", null, null, "REGULAR" ); addServiceInstanceDependency( "SCR_Namespace", "SCR_HelloWorld" ); addUserPreferencesForInstance( "SCR_HelloWorld", "classnamefilter", "'tbsm:resource'" ); Page 50 of 61 10 Appendix B. Troubleshooting This section covers some of the issues that new users of the XMLtoolkit and alternate namespaces commonly encounter. References to log files in the section refer to the XMLtoolkit log that can be found in the $TBSM_HOME/XMLtoolkit/log/msg_GTM_XT_log.0 or %TBSM_HOME%\XMLtoolkit\log\msg_GTM_XT_log file. See common issues and brief descriptions of possible workarounds. 10.1.1 The book was processed but nothing appears in the SCR You created the alternate namespace xml file in the /XMLtoolkit/xml directory and entered the class definitions for the new namespace. Books are loaded but when you check the SCR, nothing seems to be related to the new namespace. This situation can be caused by an incorrectly named xml file or by errors in the file. Naming the alternate namespace file The toolkit does not process the OtherNamespaces.xml file if the naming, including case sensitivity, is incorrect. Because this file is created by the user and not included as part of the product, verify the name carefully. For example, a file name of othernamespaces.xml is ignored on UNIX and Linux systems and consequently, no services are created in the SCR. Invalid definitions in the alternate namespace file Unlike other toolkit XML files, such as the CDM_TO_TBSM4x_MAP_Templates.xml file, no messages are written to the log to indicate parsing errors in the xml file or that an alternate namespace is being used. The toolkit starts regardless of errors in this xml file; however, nothing is shown in the SCR that is related to the alternate namespace even though the log suggests that the book was processed successfully. Verify the syntax of the OtherNamespaces.xml file by using an XML editor or Internet Explorer browser to eliminate the possibility of an invalid xml file. If errors are found, update the OtherNamespaces.xml file, restart the toolkit, and reload the books. Books containing the alternate namespace resources that were processed must be reloaded. In either case, an invalid file name or invalid service definitions, if the toolkit processes a book once, it does not reprocess a book with the same name again. To verify a book has been processed, check the authorList41.cfg file in the XMLtoolkit/xml directory. If the book is listed in this file, it is regenerated with a new name, typically a new timestamp, or renamed following the naming standards described in this paper. Copy the newly named book into the appropriate discovery library book direcPage 51 of 61 tory, typically $TBSM_HOME/discovery/dlbooks. Do not rename the book from within the discovery library book directory while the toolkit is running. Unexpected results can occur. 10.1.2 Errors in the log show the book was not processed successfully and were preceded with prefix not bound errors The toolkit writes out error messages if the prefix for the namespace is not defined in the header of the IdML book: See section 3.2.1 for the correct way to declare a namespace prefix. 10.1.3 Adding a Description field to the services created by IdML books Use the Edit Services tab of the Administration page to provide a description of the service. To add text in this field when creating alternate namespace resources, add the <description> </description> attribute in the IdML book: Page 52 of 61 <tbsm:resource id='earth' > <tbsm:resType>Planet</tbsm:resType> <tbsm:Label>Earth</tbsm:Label> <description>The planet Earth</description> <tbsm:identity>planet_earth_uniqueIdentity</tbsm:identity> <tbsm:attr1>billions</tbsm:attr1> </tbsm:resource> When finished adding a description of the service, make sure the attribute is loaded into the TBSM service model. See section 4.4 for details. 10.1.4 Can I change the service name that appears in TBSM? While the label can be specified using the tbsm:Label attribute, the actual service name is generated and cannot be changed. 10.1.5 Top-level services are not showing up under the ‘Imported Business Services’ object When a top-level (no parents) SCR object is tagged with a primary template of either BSM_BusinessService or BSM_BusinessApplication, it will be automatically pulled from the SCR into the TBSM service model via the TBSM object named Imported Business Services. If you want to use a different primary template and want this same support, complete the following steps: 1. Edit the CDM_TBSM4x_MAP_Templates.xml file: o Add a statement to the <refreshserviceinstance> element and designate your primary template for the top level service. o Save the file Page 53 of 61 2. Restart the toolkit. 3. Use the TBSM User interface to view the Additional Properties of the Imported Business Service object and add in your template name to the list of templates for the property named ‘primarytemplatefilter’. Save the changes. 4. Invalidate the Imported Business Service Object. For an example of adding the primary MY_BusinessServiceTemplate template to the CDM_TBSM4x_MAP_Templates.xml file, see the following section of text: <refreshserviceinstance> <add radinstanceid='ImportedBusinessServices_OOB_Anchor' primarytemplate='BSM_BusinessService' /> <add radinstanceid='ImportedBusinessServices_OOB_Anchor' primarytemplate='BSM_BusinessApplication' /> <add radinstanceid='ImportedBusinessServices_OOB_Anchor' primarytemplate='MY_BusinessServiceTemplate' /> </refreshserviceinstance> 10.1.6 Rather than using the Imported Business Services object as an anchor point in the TBSM services tree, I would like to have a different anchor point for my alternate namespace objects. Alternately, use to following steps to manually create a top-level service from the TBSM Administration page that, when using the appropriate parameters, pulls in services from the SCR: 1. Add a new service and assign the SCR_TopLevelAggregateTemplate to the newly created service. For purposes of this example, the service instance name is called ‘MyImportStartingPoint.’ Page 54 of 61 2. Select the Additional tab for this service. 3. For the primarytemplatefilter parameter, specify the primary templates of the services that you want to be children of this top-level service. Multiple templates may be specified. In this example, any service in the IdML book that as been mapped to the MY_CINode template is a child of the manually created top-level service: 4. Edit the CDM_TBSM4x_MAP_Templates.xml file by adding a statement to the <refreshserviceinstance> element. Designate your primary template for the top-level service and the service instance name of the new top level anchor point. <refreshserviceinstance> <add radinstanceid='ImportedBusinessServices_OOB_Anchor' primarytemplate='BSM_BusinessService' /> <add radinstanceid='ImportedBusinessServices_OOB_Anchor' primarytemplate='BSM_BusinessApplication' /> <add radinstanceid='MyImportStartingPoint' primarytemplate='MY_BusinessServiceTemplate' /> </refreshserviceinstance> Page 55 of 61 5. Restart the toolkit. 10.1.7 How can I query the database to verify my services have been imported into the SCR? You can use the following SQL queries to help determine if your services loaded correctly. select * from view_components where class = ‘yournamespaceclass’ or select * from view_components where class like ‘myprefix:%’ where yournamespaceclass is a class defined in OtherNamespaces.xml and myprefix is the namespace prefix defined in the IdML book. Because a resource in the SCR must be mapped to a template in the CDM_TO_TBSM4x_MAP_Templates.xml document to show up within the TBSM UI, these queries help you determine if your system is correctly customized for the alternative namespace objects: select * from view_componentswithtemplates where class = ‘yournamespaceclass’ or select * from view_componentswithtemplates where class like ‘myprefix:%’ Page 56 of 61 10.1.8 How can I clean out the SCR and start with an empty database? During the development of IdML books, it is sometimes necessary or desirable to start with a clean SCR. The setdbschema command can be used to accomplish this task. Important: When the setdbschema command is issued, all data in the SCR is lost. setdbschema –U user –P password –f a This command uses the scc_schema_views.sql file that might have been modified to include new attributes for the alternate namespace. You might need to rerun this sql file if modifications were made to a copy of this file. For more information about using the scc_schema_views.sql file, see section 4.4 ‘Pushing Resource Attributes into the TBSM Service Model’. Page 57 of 61 11 Appendix C. Tools and utilities 11.1.1 The Component Registry Viewer The Component Registry Viewer (CR Viewer) is a tool that was first delivered with TBSM 4.2.1.2 Interim Fix 2. By using the CR Viewer, you can see the resources that have been loaded into the SCR and for each resource, see the resource attributes, relationships, BSM_Identities (in addition to other identifiers), template-mapping, and other resource information. 11.1.2 Starting the CRViewer The CRViewer is installed with the Discovery Library Toolkit in the TBSM 4.2.1.2 Interim Fix 2 release. The toll can be found in the following location: <drive letter>:\IBM\tivoli\tbsm\XMLtoolkit\tools on Windows systems or /IBM/tivoli/tbms/XMLtoolkit/tools on non-Windows systems To start the CR Viewer, use either the CRC-Start.bat file for Windows systems or the CRCStart.sh script for non-Windows systems. The CR Viewer requires either the V1.5 or V1.6 Java Runtime Environment. Page 58 of 61 Notices This information was developed for products and services offered in the U.S.A. IBM may not offer the products, services, or features discussed in this document in other countries. Consult your local IBM representative for information on the products and services currently available in your area. Any reference to an IBM product, program, or service is not intended to state or imply that only that IBM product, program, or service may be used. Any functionally equivalent product, program, or service that does not infringe any IBM intellectual property right may be used instead. However, it is the user's responsibility to evaluate and verify the operation of any non-IBM product, program, or service. IBM may have patents or pending patent applications covering subject matter described in this document. The furnishing of this document does not grant you any license to these patents. You can send license inquiries, in writing, to: IBM Director of Licensing IBM Corporation North Castle Drive Armonk, NY 10504-1785 U.S.A. For license inquiries regarding double-byte (DBCS) information, contact the IBM Intellectual Property Department in your country or send inquiries, in writing, to: Intellectual Property Licensing Legal and Intellectual Property Law IBM Japan, Ltd. 1623-14, Shimotsuruma, Yamato-shi Kanagawa 242-8502 Japan The following paragraph does not apply to the United Kingdom or any other country where such provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this statement may not apply to you. This information could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the publication. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time without notice. Any references in this information to non-IBM websites are provided for convenience only and do not in any manner serve as an endorsement of those websites. The materials at those websites are not part of the materials for this IBM product and use of those websites is at your own risk. Page 59 of 61 IBM may use or distribute any of the information you supply in any way it believes appropriate without incurring any obligation to you. Licensees of this program who want to have information about it for the purpose of enabling: (i) the exchange of information between independently created programs and other programs (including this one) and (ii) the mutual use of the information which has been exchanged, should contact: IBM Corporation 2Z4A/101 11400 Burnet Road Austin, TX 78758 U.S.A. Such information may be available, subject to appropriate terms and conditions, including in some cases payment of a fee. The licensed program described in this information and all licensed material available for it are provided by IBM under terms of the IBM Customer Agreement, IBM International Program License Agreement, or any equivalent agreement between us. Any performance data contained herein was determined in a controlled environment. Therefore, the results obtained in other operating environments may vary significantly. Some measurements may have been made on development-level systems and there is no guarantee that these measurements will be the same on generally available systems. Furthermore, some measurements may have been estimated through extrapolation. Actual results may vary. Users of this document should verify the applicable data for their specific environment. Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products. All statements regarding IBM's future direction or intent are subject to change or withdrawal without notice, and represent goals and objectives only. This information contains examples of data and reports used in daily business operations. To illustrate them as completely as possible, the examples include the names of individuals, companies, brands, and products. All of these names are fictitious and any similarity to the names and addresses used by an actual business enterprise is entirely coincidental. If you are viewing this information softcopy, the photographs and color illustrations may not appear. Trademarks IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the web at "Copyright and trademark information” at http://www.ibm.com/legal/copytrade.shtml. Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both. Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both. UNIX is a registered trademark of The Open Group in the United States and other countries. Page 60 of 61 Java and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle and/or its affiliates. Page 61 of 61