BMC Atrium CMDB 2.1.00
Developer’s Reference Guide
If you have comments or suggestions about this documentation, contact Information Development by email at
about the company, its products, corporate offices, special events, and career opportunities.
United States and Canada
Address BMC SOFTWARE INC 2101 CITYWEST BLVD HOUSTON TX 77042-2827 USA Telephone 713 918 8800 or 800 841 2031 Fax 713 918 8000
Outside United States and Canada
Telephone (01) 713 918 8800 Fax (01) 713 918 8000
© Copyright 2005–2007 BMC Software, Inc.
BMC, BMC Software, and the BMC Software logo are the exclusive properties of BMC Software, Inc., are registered with the U.S. Patent and Trademark Office, and may be registered or pending registration in other countries. All other BMC trademarks, service marks, and logos may be registered or pending registration in the U.S. or in other countries. All other trademarks or registered trademarks are the property of their respective owners.
ITIL is a registered trademark, and a registered community trademark of the Office of Government Commerce, and is registered in the U.S. Patent and Trademark Office.
Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. UNIX is a registered trademark of The Open Group.
BMC Software considers information included in this documentation to be proprietary and confidential. Your use of this information is subject to the terms and conditions of the applicable End User License Agreement for the product and the proprietary and restricted rights notices included in this documentation.
Restricted Rights Legend
U.S. Government Restricted Rights to Computer Software. UNPUBLISHED -- RIGHTS RESERVED UNDER THE
COPYRIGHT LAWS OF THE UNITED STATES. Use, duplication, or disclosure of any data and computer software by the U.S. Government is subject to restrictions, as applicable, set forth in FAR Section 52.227-14, DFARS 252.227-7013, DFARS 252.227-7014, DFARS 252.227-7015, and DFARS 252.227-7025, as amended from time to time. Contractor/Manufacturer is BMC Software, Inc., 2101 CityWest Blvd., Houston, TX 77042-2827, USA. Any contract notices should be sent to this address.
Customer Support
You can obtain technical support by using the Support page on the BMC Software website or by contacting Customer Support by telephone or email. To expedite your inquiry, please see “Before Contacting BMC Software.”
Support Website
You can obtain technical support from BMC Software 24 hours a day, 7 days a week at
http://www.bmc.com/support_home. From this website, you can:
■ Read overviews about support services and programs that BMC Software offers.
■ Find the most current information about BMC Software products. ■ Search a database for problems similar to yours and possible solutions. ■ Order or download product documentation.
■ Report a problem or ask a question.
■ Subscribe to receive email notices when new product versions are released.
■ Find worldwide BMC Software support center locations and contact information, including email addresses, fax numbers, and telephone numbers.
Support by telephone or email
In the United States and Canada, if you need technical support and do not have access to the Web, call 800 537 1813 or send an email message to [email protected]. (In the Subject line, enter
SupID:<yourSupportContractID>, such as SupID:12345.) Outside the United States and Canada, contact your local support center for assistance.
Before Contacting BMC Software
Have the following information available so that Customer Support can begin working on your issue immediately:
■ Product information
— Product name
— Product version (release number)
— License number and password (trial or permanent)
■ Operating system and environment information
— Machine type
— Operating system type, version, and service pack — System hardware configuration
— Serial numbers
— Related software (database, application, and communication) including type, version, and service pack or maintenance level
■ Sequence of events leading to the problem
■ Commands and options that you used
■ Messages received (and the time and date that you received them)
— Product error messages
— Messages from the operating system, such as file system full — Messages from related software
Contents
Preface 9
Audience . . . 9
The New icon . . . 9
BMC Atrium CMDB documentation . . . 10
Related documentation . . . 11
Section I Developing programs with the CMDB APIs
13
Chapter 1 Introduction to the BMC Atrium CMDB APIs 15 BMC Atrium CMDB API overview. . . 16C API . . . 17
Web services API . . . 18
Java API. . . 18
Using API programming compared with the CMDB Console . . . 19
When to use the API compared with the CMDB Console. . . 19
CMDB Console and API terminology . . . 20
Chapter 2 Getting started 21 New in this release . . . 22
API compatibility. . . 22
Java API changes . . . 23
API version requirements . . . 23
C API package contents. . . 24
Header files. . . . 24
Library files. . . 25
Compiler information . . . 26
Link information . . . 27
Java API package contents . . . 27
Requirements . . . 27
Library files. . . 28
Header files. . . . 28
Version information for BMC Atrium CMDB API . . . 28
Sample source code . . . 29
Java program requirements . . . 32
Working with configuration item classes and instances. . . 32
Creating a CI class . . . 32
Creating attributes for your class. . . 34
Creating a CI instance . . . 36
Working with relationship classes and instances . . . 37
Creating a relationship class. . . 37
Creating a relationship between two CI instances . . . 39
Retrieving instance details . . . 40
Chapter 4 BMC Atrium CMDB tools 41 Working with the cmdbdriver program . . . 42
From the command line . . . 42
Using a script . . . 44
Using cmdbdriver on UNIX . . . 45
Migrating data between BMC Atrium CMDB servers . . . 45
Logging in to the cmdbdriver program . . . 46
Step 1—Exporting class data with cmdbdriver . . . 47
Step 2—Export instance data with cmdbdriver. . . 48
Step 3—Import class definitions with cmdbdriver . . . 49
Step 4—Import instance data with cmdbdriver . . . 50
Step 5—Export reconciliation definitions . . . 50
Step 6—Import reconciliation definitions . . . 52
Known issues . . . 52
Using the extension loader . . . 53
The extension loader directory structure . . . 53
Packaging and installing BMC Atrium CMDB extensions . . . 54
Verifying your installed extensions. . . 62
Integrating the CI Relationship Viewer with other applications. . . 63
Launching the CI Relationship Viewer from AR System applications . . . 64
Embedding the CI Relationship Viewer in AR System applications . . . 66
Launching the CI Relationship Viewer from non-AR System applications . . . 67
Configuring the CI Relationship Viewer. . . 69
Working with filters. . . 69
Customizing the configuration file . . . 70
Creating CI Relationship Viewer events. . . 75
Creating CMDB status alerts. . . 75
Importing data with Integration Engine . . . 76
Working with SQL views . . . 77
Section II API reference
79
Chapter 5 C API functions and data structures 81
Related files . . . 82
Functions . . . 82
Data model functions . . . 82
Instance functions . . . 107
Bulk entry transaction functions . . . 118
Environment functions . . . 120
User interface component functions . . . 125
Import and Export functions . . . 128
Utility functions . . . 134
Free functions . . . 136
Reconciliation Engine functions . . . 148
Federation functions . . . 152 Audit functions . . . 155 Data structures . . . 158 Class structures . . . 158 Attribute structures . . . 161 Instance structures. . . 169
General purpose structures . . . 171
Export and import structures . . . 172
Graph query structures. . . 178
User interface components structures . . . 181
Reconciliation Engine structures . . . 183
Federation structures . . . 186
Audit structures . . . 188
Chapter 6 Web services API operations and data structures 191 Operations . . . 192
Instance data operations. . . 192
Data model operations . . . 204
Reconciliation Engine operations . . . 215
Federation operations . . . 219
Audit operations . . . 222
User interface component operations. . . 224
Utility operations . . . 225
Data structures . . . 227
Instance structures. . . 227
Graph query structures. . . 232
Class Structures . . . 236
Attribute structures . . . 242
Utility structures . . . 250
User interface component structures . . . 251
Reconciliation Engine structures . . . 253
Federation structures . . . 256
Events from AR System to CI Relationship Viewer . . . 262
Events from CI Relationship Viewer to AR . . . 264
Appendix B Using graph queries to find related CIs 265 Representing graphs . . . 266
The CMDBGraphQuery API function . . . 267
Example 1 . . . 268
Example 2 . . . 271
Glossary 275
Preface
The BMC Atrium CMDB Developer’s Reference Guide describes how to use the BMC Atrium Configuration Management Database (CMDB) C, Java, and web services APIs, and other BMC Atrium CMDB tools to program your BMC Atrium CMDB application and integrate it with other applications.
This guide is divided into the following sections:
Developing programs with the BMC Atrium CMDB APIs—This section provides an introduction to the BMC Atrium CMDB API suite, provides instructions on how to program the BMC Atrium CMDB application using Java methods, and provides procedures for using other BMC Atrium CMDB tools. API reference—This section provides descriptions of the C API functions, web
services operations, and the data structures used by each function and operation.
The BMC Atrium CMDB application runs on top of the BMC® Remedy® Action Request System® application (AR System®) and enables you to manage data about your IT environment.
Audience
This guide is intended for application programmers. For more information about configuring the application, see the Installation and Configuration Guide.
The New icon
Documentation for the BMC Atrium CMDB Developer’s Reference Guide contains a New icon that identifies features or products that are new or enhanced with version 2.1.00.
BMC Atrium CMDB documentation
The following table lists the documentation available for BMC Atrium CMDB. Unless otherwise noted, softcopy documentation is available in the Docs directory of the product DVD and the Support site at http://www.bmc.com/support_home.
Title Document provides Audience Format
Common Data Model Diagram
Hierarchical diagram of all classes in the Common Data Model (CDM) including unique attributes and applicable relationships
Administrators Print and PDF
Concepts and Best Practices Guide
Information about CMDB concepts and best practices for planning your BMC Atrium CMDB implementation
IT leaders and administrators
Print and PDF
Data Model Help Description and details of superclasses, subclasses, attributes, and relationship classes for each class. Contains only information about the Common Data Model at first, but can be updated to include information about data model extensions you install. Administrators HTML (product DVD only) Developer’s Reference Guide
Information about creating API programs, using C and web services API functions and data structures, and a list of error messages
Administrators and programmers Print and PDF Installation and Configuration Guide
Information about installing and configuring BMC Atrium CMDB, including permissions, class definitions, reconciliation, and federation
Administrators Print and PDF
Javadoc API Help Information about Java classes, methods, and variables that integrate with BMC Atrium CMDB
Programmers HTML (product DVD only)
Mapping Your Data to BMC Atrium CMDB Classes
Mappings of common IT objects to the appropriate class in which to store them, whether part of the Common Data Model or an extension. Also includes information about further categorizing instances using key attributes.
Administrators Spreadsheet, print and PDF
Master Index Combined index of all guides Everyone Print and PDF Online Help Help for using and configuring BMC Atrium
CMDB, available by clicking Help in the product interface Users and administrators Product Help (available from Help links once installed)
Release Notes Information about new features, open issues, and resolved issues
Related documentation
Related documentation
The following table lists some documentation for related BMC products that might be of interest to BMC Atrium CMDB users. This documentation is available from the Support site at http://www.bmc.com/support_home.
Troubleshooting Guide Information about resolving issues with BMC Atrium CMDB components, including API, filter, and console error messages and their solutions.
Administrators, programmers, and BMC Support personnel Print and PDF
User’s Guide Information about using BMC Atrium CMDB, including searching for and comparing CIs and relationships, relating CIs, viewing history, and launching federated data
Users Print and PDF
Title Document provides Audience Format
Title Document provides Audience Format
BMC Atrium Integration Engine 7.1.00 User’s Guide
Information about how to establish a data transfer between third-party databases and BMC Atrium CMDB. Administrators and developers Print and PDF BMC Configuration Management Configuration Discovery Integration for CMDB 7.1 Implementation Guide
Information about the following:
Transferring configuration data from BMC Configuration Management to BMC Atrium CMDB
Normalizing discovered software configuration data with the BMC Definitive Software Library before transferring it to BMC Atrium CMDB.
Administrators and developers Print and PDF BMC Foundation Discovery and BMC Topology Discovery Installation and Configuration Guide
Information about the configuration of a connection between BMC Atrium CMDB and the discovery data store from BMC Foundation Discovery and BMC Topology Discovery. Administrators and developers Print and PDF BMC Foundation Discovery and BMC Topology Discovery User Guide
Information about the synchronization of the topology datastore with BMC Atrium CMDB.
Administrators and developers Print and PDF BMC Remedy Action Request System 7.1.00: C API Reference
Information about AR System data structures, C API function calls, and OLE support.
Administrators and programmers Print and PDF BMC Remedy Action Request System 7.1.00: Configuring
Information about configuring AR System servers and clients, localizing, importing and exporting data, and archiving data.
Administrators Print and PDF
BMC Remedy Action Request System 7.1.00: Form and Application Objects
Information about components necessary to build applications in AR System, including applications, fields, forms, and views.
BMC Remedy Action Request System 7.1.00: Installing
Procedures for installing AR System Administrators Print and PDF
BMC Remedy Action Request System 7.1.00: Installing and
Administering BMC Remedy Mid Tier
Information about the mid tier, including mid tier installation and configuration, and web server configuration.
Administrators Print and PDF
BMC Remedy Action Request System 7.1.00: Integrating with Plug-ins and Third-Party Products
Information about integrating AR System with external systems using plug-ins and other products, including LDAP, OLE, and ARDBC.
Administrators and developers Print and PDF Definitive Software Library 7.1 Administrator’s Guide
Information about installing and configuring DSL, updating vendor data, and connecting DSL to BMC Configuration Management and AR System databases
Administrators Print and PDF
Section
I
Developing programs with the
CMDB APIs
This section explains how to use the BMC Atrium CMDB tools, such as the
cmdbdriver program and the extension loader, and how through programming, you can extend your application using the BMC Atrium CMDB APIs.
This section is organized into the following chapters:
Chapter 1, “Introduction to the BMC Atrium CMDB APIs,” provides an overview of the BMC Atrium CMDB architecture and the BMC Atrium CMDB API suite, which includes a C API, Java API, and web services API. It also provides information about when to use API programming and when to use the BMC Atrium CMDB Console to perform the required tasks.
Chapter 2, “Getting started,” provides information about the preparatory steps you must follow before you use the BMC Atrium CMDB API suite.
Chapter 3, “Programming common BMC Atrium CMDB tasks,” provides Java code samples for a list of basic programming tasks that are performed most often in BMC Atrium CMDB API programs.
Chapter 4, “BMC Atrium CMDB tools,” provides instructions for using the BMC Atrium CMDB tools, such as the cmdbdriver and extension loader.
Chapter
1
Introduction to the BMC
Atrium CMDB APIs
This section provides an overview of BMC Atrium CMDB programming interface (API) suite.
The following topics are provided:
BMC Atrium CMDB API overview (page 16)
BMC Atrium CMDB API overview
The BMC Atrium CMDB provides an API suite that allows you, through programming, to work with class definitions, instance data, federation,
reconciliation, audit and other functions. The BMC Atrium CMDB API suite is composed of the C, Java, and web services APIs.
The C and Java APIs provide similar data structures and functions to encapsulate information and functionality. You can use either C or Java API depending on your application platform.
The Web services API provides a set of platform-independent operations that communicate with your applications to retrieve and send data.
Figure 1-1: BMC Atrium CMDB C and Java architecture
NOTE
The arrows indicate the directions in which each program or process can initiate an API function. Data can flow in any direction.
As shown in Figure 1-1, a BMC Atrium CMDB components, such as the CI Relationship Viewer and CMDB Console use the Java API to manipulate the CDM, whereas the external data consumers and data providers can communicate either using the web services API or Java API.
BMC BMC
Reconciliation Engine Service Impact
Manager DiscoveryTopology CMDB Console CI Relationship Viewer
AR System API CMDB C API CMDB Java API CMDB Web Services API Database CDM BMC Atrium CMDB Action Request System
Web Client Remedy User AR System Applications Remedy User Web Client
Web Service Clients
.Net
Client ClientAXIS
BMC Remedy Mid Tier (CMDB API)
BMC Atrium CMDB API overview
This guide describes the C and web services APIs. For more information about the Java API, see the Javadoc API Help, which is located in the sdk/javadoc/cmdbapi/
subdirectory of your BMC Atrium CMDB installation directory. To access the Javadoc API Help, open the index.html file.
C API
A BMC Atrium CMDB client can use the C API to create, modify, delete, and query the class definitions, instance data, federation, reconciliation, and other functions. The C API:
Contains data structures that store both simple and complex information. A simple data structure serves as the primary building block for a complex data structure.
Includes a set of Free functions that you can use to deallocate memory.
Provides server-access information with every call in the control parameter of the function.
Features
You can use the C API functions to perform the following operations: Create, modify, and delete classes and instances.
Retrieve CI and relationship information.
Create log files in a format that is different from the standard reports.
Components
The C API consists of a set of functions and data structures, most of which perform a specific database or data source operation. For example, you can use a function to retrieve information about a particular BMC Atrium CMDB class.
Most of these C API functions accept one or more BMC Atrium CMDB C data structures as parameters that qualify the action to perform, such as type of class to create, qualification for an instance to retrieve or delete, or class name to modify. For more information about the C API functions and data structures, see Chapter 5, “C API functions and data structures.”
The sdk/samples/driver subdirectory in your BMC Atrium CMDB installation directory contains the source code for the cmdbdriver program. This program provides a command-line interface for calling C API functions. The cmdbdriver
program also includes print routines for every data structure in the API, making it a useful debugging tool.
For more information about the print routines, see “Debugging BMC Atrium CMDB API programs using print.c routines” on page 78.
Web services API
The BMC Atrium CMDB web services API, which conforms to SOAP and WSDL standards, provides a standard interface for interacting with BMC Atrium CMDB. You can use the web services API to integrate BMC Atrium CMDB data with other applications, for example, BMC Topology Discovery and BMC Foundation Discovery, BMC® Remedy® Change Management, or any other third-party application.
Features
External web-based programs can communicate with BMC Atrium CMDB using the web services operations. The BMC Atrium CMDB web services operations are developed to assist the following communities:
BMC software partners—For developing integrated solutions with BMC Atrium CMDB.
Users—For developing programs that set up communication between BMC Atrium CMDB and other products running in the environment.
Components
The BMC Atrium CMDB web services API consists of operations and data structures. Although the web services operations correspond to the BMC Atrium CMDB C API functions, they do not correspond one-to-one with the C API. The web services API data structures correspond to the classes in the Java API. For more information about the web services operations that are currently available, see Chapter 6, “Web services API operations and data structures.”
Java API
The BMC Atrium CMDB Java API is a collection of Java classes and methods that provide the C API functionality in a Java development environment. Use the Java API if you write server-side web applications that you access through the Java Server page (JSP) or Java servlets web tier layer.
The Java API provides an object model of BMC Atrium CMDB. You will find it easier to use the Java API if you are already familiar with the C API.
For more information about the Java API, see the Javadoc API Help, which is located in the sdk/javadoc/cmdbapi/ subdirectory of your CMDB installation directory. To access the Javadoc API Help, open the index.html file.
Using API programming compared with the CMDB Console
Features
The following list describes the Java API features:
The Java virtual machine (JVM) automatically deallocates objects that are created with the Java API.
In the Java API, server access information is encapsulated in an ARServerUser
object. For more information about ARServerUser object, see BMC Remedy Action
Request System 7.1.00: Integrating with Plug-ins and Third-Party Products.
The Java API has its own naming conventions.
Using API programming compared with the
CMDB Console
The primary reason to write your own API program is to satisfy specific business needs that you cannot meet with the CMDB Console.
In addition, API programming gives you the flexibility to customize your
application. However, API solutions are more complex to design, implement, and maintain.
The CMDB Console provides an easy-to-use graphical user interface for performing BMC Atrium CMDB tasks, such as creating classes, CIs, and relationships, and viewing instance history.
For more information about performing administrator tasks using the CMDB Console, such as using the Class Manager, Federation Manager, and, the
Reconciliation Engine Manager, see the BMC Atrium CMDB 2.1.00 Installation and
Configuration Guide.
For more information about performing user tasks using the CMDB Console, such as viewing CI history, Viewing CI and relationship classes, and comparing instances, see the BMC Atrium CMDB 2.1.00 User’s Guide.
When to use the API compared with the CMDB Console
Table 1-1 outlines the scenarios in which you should use APIs instead of the CMDB Console.
Table 1-1: API Programming scenarios
Requirement Use API Programming? Use the CMDB Console?
You want to modify the CDM. Yes
You need to access multiple BMC Atrium CMDB components at the same time or integrate with programs or data outside the BMC Atrium CMDB.
CMDB Console and API terminology
The CMDB Console and the APIs use different terms to see a specific task. Table 1-2 list these differences.
Table 1-2: CMDB Console and API terminology
You need to create, delete, or search for BMC Atrium CMDB classes.
Yes You need to perform complex
operations that involve multiple objects.
Yes
You need to create, delete, or search BMC Atrium CMDB relationships.
Yes You need a two-way interface (or
gateway) between the BMC Atrium CMDB and another application.
Yes
The values you want to specify for $PROCESS$ or the Run Process action exceed the size limitation of the command line.
Yes
Requirement Use API Programming? Use the CMDB Console?
BMC Atrium CMDB term API term
search getList
create create
modify set
Chapter
2
Getting started
This section provides the information you need to know before you start using the BMC Atrium CMDB API suite.
The following topics are provided:
New in this release (page 22) C API package contents (page 24) Java API package contents (page 27)
Version information for BMC Atrium CMDB API (page 28) Sample source code (page 29)
New in this release
In BMC Atrium CMDB version 2.1.00, changes have been made to the APIs. This section provides the API compatibility information and explains these API changes. For more information about these changes, see the Overview page of your Javadoc Help.
API compatibility
The following list explains the backward and forward compatibility of BMC Atrium CMDB 2.1.00:
If you developed 2.0.x clients that use version 2.0.x DLLs and libraries, they can continue to work with the 2.1 server.
If you use version 2.1.00 DLLs and libraries for your clients, you need to make appropriate changes to your code and recompile it.
Table 2-1 provides a compatibility matrix for the AR System server and BMC Atrium CMDB.
Table 2-1: BMC Atrium CMDB compatibility matrix A R System server BMC Atrium CMDB server BMC Atrium CMDB client Supported Remarks 7.1.00 2.1.00 2.1.00 Yes
7.1.00 2.1.00 2.0.x Yes BMC Atrium CMDB backwards compatibility: older client and newer server.
7.1.00 2.0.x 2.1.00 No BMC Atrium CMDB forward
compatibility: newer client and older server.
7.1.00 2.0.1 patch x 2.0.1 patch x Yes AR System backwards compatibility. 7.1.00 2.0.1 patch x 2.0.1 patch x Yes AR System and BMC Atrium CMDB backwards compatibility. Preferably, upgrade to BMC Atrium CMDB 2.1 server. 7.1.00 2.0.0 patch x or earlier 2.0.0 patch x or earlier
No You must upgrade BMC Atrium CMDB server to version 2.1.00.
7.0.x or earlier 2.1.00 Any No The Foundation piece has to be of a more recent version than the application. Upgrade the server before upgrading BMC Atrium CMDB.
New in this release
Java API changes
In version 2.1.00, the following changes have been made to the Java API: Package name changes—The package name has been changed from
com.remedy.cmdb.api to com.bmc.cmdb.api.
JRE version changes—With 2.1.00, the minimum JRE version required is 1.5.0_06
or greater.
Java API changes—The AR System version 7.1.00 Java API is enhanced to use some of the features of Java, such as annotations, enumerations, and typed-collections. Therefore, the BMC Atrium CMDB Java API has also changed. For more information about these changes, see the Overview page of your Javadoc Help.
API version requirements
In version 2.1.00, a new feature is developed that allows you to restrict older versions of BMC Atrium CMDB clients from connecting to a newer version of the server. To specify the minimum API version with which the server can
communicate, you configure the Minimum-CMDB-API-Version parameter in the ar.cfg (Windows) or ar.conf (UNIX) file. The default value for this setting is configured to 3.
For example, if you set Minimum-CMDB-API-Version to 4, clients prior to version 2.1.00 will not be able to communicate with the server. For more information about the ar.cfg or ar.conf configuration file, see BMC Remedy Action Request System 7.1.00
Configuring. Table 2-2 provides the BMC Atrium CMDB releases and their
corresponding API versions.
Table 2-2: BMC Atrium CMDB releases and corresponding versions
BMC Atrium CMDB release API version
BMC Atrium CMDB 2.1.00 4 BMC Atrium CMDB 2.0.x 3
C API package contents
The C API package includes header files, library files, and source code for the
cmdbdriver sample program. When you install the BMC Atrium CMDB application, the C API is also installed with the package.
Header files
Table 2-3 displays the list of C API header files installed in the include directory:
Table 2-3: C API Header files
File Name Contents
ar.h AR System API data type and structure definitions, size limits, and constant definitions.
cmdb.h BMC Atrium CMDB C API data type and structure definitions, size limits, and constant definitions.
arerrno.h Error code definitions.
arextern.h External declarations for the API functions, specified with and without prototypes for use with standard C, ANSI C, or C++ compilers.
arfree.h External declarations for the FreeAR functions. These functions recursively free all allocated memory associated with a particular data structure.
cmdbfree.h External declarations for the FreeCMDB functions. These functions recursively free all allocated memory associated with a particular data structure.
arstruct.h Core and reserved subclasses ID definitions, database separator characters, and labels for exporting structure definitions.
C API package contents
Library files
You must have arcatalog_eng.dll in your path at runtime and make sure the lib
directory contains the BMC Atrium CMDB C API library files listed in Table 2-4.
NOTE
The SDK contains files that are not listed here. Those files are required for Java API or for working with the cmdbdriver program, but are not required to create a C API program.
Table 2-4: C API library files
Platform Files Windows arapi71.dll arcatalog_eng.dll arjni71.dll arrpc71.dll arutiljni71.dll arutl71.dll cmdbapi21.dll cmdbjni21.dll icudt32.dll icudtbmc32.dll icuinbmc32.dll icuucbmc32.dll mfc71.dll msvcp71.dll msvcr71.dll rcmn71.dll Solaris libarjni71.so libarutiljni71.so libcmdbapi21.so libcmdbjni21.so libicudatabmc.so.32 libicui18nbmc.so.32 libicuucbmc.so.32 libjlicapi71.so AIX libarjni71.a libarutiljni71.a libcmdbjni21.a libcmdbapi21.a libicudatabmc32.a libicui18nbmc32.a libicuucbmc32.a libjlicapi71.a
For Solaris and Linux: To load dynamic libraries, you need to include the
-ldl link flag in the link command. For more information about linking and compiling your code, see the driver sample makefile in the sdk\samples\driver
subdirectory of the BMC Atrium CMDB installation directory.
Compiler information
Before you write C API programs, make sure that the following software programs are installed or configured on your system:
Microsoft Visual C++ version 7.0 or later Structure member alignment: 8 bytes (default)
Set code generation to Multithreaded DLL, not DebugMultithreaded DLL. Where other included libraries cause conflicts, add
/nodefaultlib:"MSVCRTD" to the project options to avoid using the Debug C runtime library. If your program references this library at runtime, memory management errors will occur when memory pointers are referenced by both the Debug and Release C runtime libraries.
ANSI standard C or C++ compiler (for UNIX)
IMPORTANT
If you develop C++ clients that run on HP machines using the BMC Atrium CMDB C API, you need to compile your code with the __HPACC_THREAD_SAFE_RB_TREE flag enabled. This is because the libraries that the tree header file uses, which includes
tree.cc, are not thread safe. For more information, see the following link: http://h21007.www2.hp.com/dspp/tech/tech_TechDocumentDetailPage_IDX/ 1,1701,7866,00.html. HP-UX libicudatabmc.sl.32 libicui18nbmc.sl.32 libicuucbmc.sl.32 libarjni71.sl libarutiljni71.sl libcmdbapi21.sl libcmdbjni21.sl libjlicapi71.sl Linux libicudatabmc.so.32 libicui18nbmc.so.32 libicuucbmc.so.32 libarjni71.so libarutiljni71.so libcmdbapi21.so libcmdbjni21.so libjlicapi71.so Platform Files
Java API package contents
Link information
Table 2-5 lists the libraries that your programs must use for linking to BMC Atrium CMDB.
Table 2-5: Link files
Java API package contents
The Java API package includes several header files and library files. When you install the BMC Atrium CMDB application, the Java API is also installed with the package.
NOTE
In version 2.1, the BMC Atrium CMDB Java API has changed as a result of modifications in the AR System Java API. For a list of affected CMDB Java classes, see the Javadoc API Help, which is located in the sdk/javadoc/cmdbapi/
subdirectory of your CMDB installation directory. To access the Javadoc API Help, open the index.html file.
Requirements
To build and run a Java API program on either Windows or UNIX, you need the following environment components:
All C API libraries and DLLs, as listed in the “C API package contents” on page 24.
J2SE Software Development Kit (SDK), version 1.5.0_06 or higher.
Windows dynamic link library (DLL) files or UNIX library files as listed in Table 2-4 on page 25.
Platform Links
Windows cmdbapi21.dll arapi71.dll Solaris, Linux libcmdbapi21.so
libarapi71.so HP-UX libcmdbapi21.sl
libarapi71.sl
AIX libcmdbapi21.a
Library files
When you install BMC Atrium CMDB, a list of Java API library files are installed with the application. For more information about these library files, see the section “Installation and deployment” of the JavaAPI_Overview.html page of the Javadoc API Help.
Header files
Table 2-6 lists the header files that are installed with the Java API.
Table 2-6: Header files for the CMDB programs
Version information for BMC Atrium CMDB API
With BMC Atrium CMDB 2.1.00, you can view version information, such as version number, and build date and time for the BMC Atrium CMDB API. To view the information, open a command line window and type java –jar
cmdbapi21.jar. On Windows, a command line window is displayed, as shown in Figure 2-1
Figure 2-1: API version information
Header file name Description
com.bmc.arsys.api.*; AR System API functions com.bmc.cmdb.api.*; CMDB API functions
java.util.*; Java utilities library
Build date Build time
Sample source code
Sample source code
The sdk/samples/driver subdirectory in the BMC Atrium CMDB installation directory, includes the source code for a sample BMC Atrium CMDB client program. A compiled version of the cmdbdriver program is located in the sdk/bin
directory.
When the BMC Atrium CMDB API package is installed, a series of directories is created in the installation directory. The src directory contains subdirectories with source code for the cmdbdriver sample program.
For more information about the cmdbdriver program, seeChapter 4, “Working with the cmdbdriver program.”
After compiling the source code or locating the prebuilt program supplied with the API, you can use cmdbdriver to:
Identify function input parameters and load them with appropriate values. Examine the content and structure of function output parameters.
Experiment with different parameter values.
Migrating to the BMC Atrium CMDB from 1.1 to
2.0 API
In version 2.0, several API changes were made, such as modifications to the function parameters and data structures. For the list of parameters and data structures that were modified, see the BMC Atrium CMDB 2.0 Developer’s Reference
Chapter
3
Programming common BMC
Atrium CMDB tasks
This section describes how to use the BMC Atrium CMDB Java methods to perform common tasks. These tasks are explained using Java code samples. The following topics are provided:
Java program requirements (page 32)
Working with configuration item classes and instances (page 32) Working with relationship classes and instances (page 37)
Java program requirements
The procedural building blocks of a BMC Atrium CMDB program are functions or operations that can invoke one another. For more information about specific Java method parameters, see the Javadoc API Help, which is located in the sdk/
javadoc/cmdbapi/ subdirectory of your CMDB installation directory. To access the Javadoc API Help, open the index.html file.
For your Java code to compile with the BMC Atrium CMDB classes, make sure you point the class path environment variable to the BMC Atrium CMDB jar files directory.
For the list of header files and link files required for your Java code, see “Java API package contents” on page 27.
Working with configuration item classes and
instances
Configuration items (CIs) are the focal point of the BMC Atrium CMDB
application. The attributes of a CI and other properties, such as data storage and inheritance, are encapsulated in a CI class definition. When you create a class, you define all the characteristics for it, such as the class name, namespace, superclass, and data storage method.
Creating a CI class
The following example creates two classes, PhoneSystem and Socket. Both classes are created in the ACME namespace. All class definitions that extend the CDM use a namespace other than BMC.CORE.
Example: Creating classes
//Create variables to hold the class name data String acmeNamespace = "ACME";
String phoneSystemClassName = "phoneSystem"; String socketClassName = "Socket";
//Create the class name key for the Phone System class. CMDBClassNameKey phoneSystemClassNameKey = new
CMDBClassNameKey(phoneSystemClassName, acmeNamespace); String phoneSystemClassID = "ABCD-1234";
Working with configuration item classes and instances
//Create an instance of the CMDBClass
CMDBClass phoneSystemClass = new CMDBClass(phoneSystemClassNameKey, phoneSystemClassID, null);
try {
//Create the Phone System class in BMC Atrium CMDB phoneSystemClass.create(currentUser);
}
catch (ARException ex) {
System.out.println(ex.toString()); }
//create the socket class
CMDBClassNameKey socketClassNameKey = new
CMDBClassNameKey(socketClassName, acmeNamespace); String socketClassID = "ACME_SocketClass";
CMDBClass socketClass = new CMDBClass(socketClassNameKey, socketClassID, null);
// create the socket class in BMC Atrium CMDB try {
socketClass.create(currentUser); }
catch (ARException ex) {
System.out.println(ex.toString()); }
In the example, the phoneSystemClassNameKey and socketClassNameKey class variables hold the class name and namespace definitions for the phoneSystem and
Socket classes respectively. The classNameKey class variables are passed as parameters to the constructor of the CMDBClass class. A class ID is an identification string that uniquely identifies a particular class within the BMC Atrium CMDB. In the try loop, the phoneSystemClass and socketClass classes are created in the BMC Atrium CMDB. The currentUser parameter is a pre-instantiated
ARServerUser class that has valid user login credentials.
For more information about the parameters for the CMDBCreateClass function, open
index.html of the Java API Help, which is located in the sdk/javadoc/cmdbapi/
Creating attributes for your class
Every class you create will have attributes that hold different values for each instance of the class. The following example illustrates how to create attributes for the phoneSystemClass.
Example: Creating attributes
//Create attributes for the phoneSystem class String serialNumAttrName = "ACMESerialNumber"; int serialNumFieldId = ACME_SERIAL_NUM_FIELD_ID; int serialNumEntryMode =
CMDBAttribute.CMDB_ATTR_ENTRYMODE_REQUIRED; //Define a data type and limit for the attribute
CMDBAttributeLimit serialNumLimit = newCMDBCharLimit(30); //Create a default value for the attribute
Value serialNumDefaultValue = null; //Create a Java instance of the attribute CMDBAttribute serialNumAttr = new
CMDBAttribute(serialNumAttrName, serialNumFieldId, serialNumEntryMode,
serialNumLimit, null);
//Create another attribute for the phoneSystem class String costAttrName = "Cost";
int costFieldId = ACME_COST_FIELD_ID; int costEntryMode =
CMDBAttribute.CMDB_ATTR_ENTRYMODE_OPTIONAL; //Create a variable of type Currency
CMDBAttributeLimit costLimit = new CMDBCurrencyLimit; //create a Java instance of the Cost attribute
CMDBAttribute costAttr = new CMDBAttribute(costAttrName, costFieldId, costEntryMode,
costLimit, null);
//Create a hash map to hold the attribute data HashMap attributeHashMap = new HashMap(); //Add the two attributes to the hash map
attributeHashMap.put(serialNumAttruName, serialNumAttr); attributeHashMap.put(costAttrName, costAttr);
//Associate these attributes to the phoneSystemClass phoneSystemClass.setAttributes(attributeHashMap); // Update the BMC Atrium CMDB with the new attributes try {
phoneSystemClass.update(currentUser); }
catch (ARException ex) {
System.out.println(ex.toString()); }
Working with configuration item classes and instances
In the example, the serialNumAttrName,serialNumFieldId, and
serialNumEntryMode variables are created to hold the attribute name, attribute field ID, and the entry mode for the attribute, respectively.
When you specify the Required entry mode for an attribute, you must provide a value for this attribute for every instance of the class. The field ID is a unique numeric identifier for an attribute.
The data type and limit for the attribute is defined using the serialNumLimit class variable, which is of type CMDBAttributeLimit class. In the example, the
serialNumAttr attribute is defined as a character data type with a limit of 30 characters.
A default value of Null is specified for the attribute in the serialNumDefaultValue
variable. This value is used if no value is provided for the ACMESerialNumber
attribute when creating an instance.
After these values are defined for the variables, they are passed as parameters to the CMDBAttribute class constructor, which creates a Java instance of the attribute. In the example, the Cost attribute is created to hold the cost information for the
phoneSystemClass class. Similar to the ACMESerialNumber definition, the attribute name, field ID, entry mode, and attribute limit details are specified for the Cost
attribute.
The entry mode for the Cost attribute is defined as Optional. The attribute data type is defined as Currency. After the attributes for a specific class are defined as
CMDBAttribute variables, these attributes are added to a hash map. These hash maps can hold multiple attributes at a time.
The setAttributes method of the phoneSystemClass is used to set the attributes for the class. The hash map array, which holds the attribute definitions, is passed to this setAttributes method as a parameter. After the attributes are set in the class, the class information is updated in the BMC Atrium CMDB using the update
method of the phoneSystemClass.
For more information about the setAttributes method of the CMDBClass Java class, data types, and data limits, open index.html of the Java API Help, which is located in the sdk/javadoc/cmdbapi/ subdirectory of your CMDB installation directory.
Creating a CI instance
After you create a class in the BMC Atrium CMDB, you can create an instance of this class. When you create an instance, you must specify all the required attributes for the class. The following code illustrates how to create an instance of the
phoneSystemClass.
Example: Creating a CI instance
//Create variables to hold the serial number and cost details for the instance
String serialNum = "SN-1492-22919";
Value cost = new Value("12.95",Constants.AR_DATA_TYPE_CURRENCY); CMDBAttributeValue serialNumAttrValue = new
CMDBAttributeValue(serialNumAttrName, serialNum); CMDBAttributeValue costAttrValue = new
CMDBAttributeValue(costAttrName, cost); //Create a HashMap to hold the attribute values Map attributeHashMap = new HashMap();
attributeHashMap.put(serialNumAttrName, serialNumAttrValue); attributeHashMap.put(costAttrName, costAttrValue);
// create an instance of a phoneSystemClass
CMDBInstance phoneInstance = new CMDBInstance(phoneSystemClassNameKey, attributeHashMap);
//create a variable to hold the dataset ID String acmeDatasetId = "ACME.DATASET"; try {
//Create the new instance within the BMC Atrium CMDB phoneInstance.create(currentUser, datasetId);
}
catch (ARException ex) {
System.out.println(ex.toString()); }
//Get the instance ID of the new instance
String phoneSystemInstId = phoneInstance.getId();
In the example, the serialNum and cost variables are created to hold the serial number and cost information for the instance. The serialNumAttrValue and
costAttrValue class variables are created of type CMDBAttributeValue.
After the attribute name and other attribute information is created as explained in the previous section, the serialNumAttrName and serialNum variables are assigned to the serialNumAttrValue variable, which is of type CMDBAttributeValue. The
costAttrValue class variable holds the costAttrName and cost details for the instance.
Using a hash map, the serial number and cost details are added to the
phoneInstance instance, which is of type CMDBInstance. To create the new instance in Java, the phoneSystemClassNameKey, which was shown in “Creating a CI class” on page 32, and attributeHashMap variables are passed as parameters to the instance.
Working with relationship classes and instances
Before creating the phoneInstance instance in the BMC Atrium CMDB, a dataset variable is created to specify the dataset to which the instance belongs. In the example, the acmeDatasetId variable is created that holds the dataset details. Because an instance must reside in a dataset, you must specify a dataset ID for the instance.
In the try loop, the phoneInstance instance is created in the BMC Atrium CMDB. The currentUser and datasetId parameters are passed to the create method of the instance.
After the instance is created in the BMC Atrium CMDB, the instance ID of the new instance is retrieved using the getId method.
For more information about the parameters for the create method of the
CMDBInstance Java class, open index.html of the Java API Help, which is located in the sdk/javadoc/cmdbapi/ subdirectory of your CMDB installation directory.
Working with relationship classes and
instances
The BMC Atrium CMDB enables you to create relationships between CI classes. To relate two CI classes, you must create a relationship class that refers to the two CI classes.
After you create the relationship class, you create a relationship between the two CI instances using this relationship class.
Creating a relationship class
When defining the relationship class, you can specify several characteristics for the relationship, such as the cardinality of the relationship, for example one-to-many or one-to-one, or whether the class defines a weak relationship.
In the following example, a relationship class is created between the
phoneSystemClass class and the socketClass class.
Example: Creating a relationship class
//Create a variable that holds the relationship class name
String relationshipClassName = "phoneSystemToSocketRelationship"; CMDBClassNameKey relationshipClassKey = new
CMDBClassNameKey(relationshipClassName, acmeNamespace); //Create a variable that holds the two classes that will be related CMDBClassNameKey[] relationshipClasses = {phoneSystemClassKey, socketClassKey}; //create a role name for each instance in the relationship String[] roleNames = {"Source", "Destination"};
CMDBRelationship phoneSystemToSocketRelClass = new CMDBRelationship(relationshipClassKey, null, roleNames, relationshipClasses); //set the cardinality of the relationship
phoneSystemToSocketRelClass.setCardinality(
CMDBRelationship.CMDB_CLASS_RELATIONSHIP_CARDINALITY_1_MANY); try {
// create the relationship class in the BMC Atrium CMDB
phoneSystemToSocketRelClass.create(this.getARServerUser()); }
catch(ARException ex){
System.out.println(ex.toString());}
In the example, the relationshipClassName variable is created to hold the name of the relationship class. The relationshipClassKey variable, which is of type
CMDBClassNameKey, is created to define the class name and namespace details for the relationship class.
The class name and namespace information for the two classes that will be related in the relationship class is specified in the relationshipClasses variable. The role names for the two classes are specified in the roleNames variable.
Each of the two classes in a relationship must have its role defined. You can define role names for Class 1 and Class 2, known respectively as the source and
destination members of the relationship. The BMC Atrium CMDB prepends these role names to the attributes of a relationship class that pertain to its members. For example, on any CDM relationship class the attributes that hold the class IDs of its member CIs are named Source.ClassId and Destination.ClassId.
After the role name and class name key details are defined, the
phoneSystemToSocketRelClass Java instance of the relationship class is created, which of type CMDBRelationship.
The setCardinality method of the CMDBRelationship class sets the cardinality. In this example, the cardinality for the relationship class is set to to-many. A one-to-many cardinality means that for each instance of the phoneSystem class, there can be many relationships to instances of the socket class.
In the try loop, the phoneSystemToSocketRelationship relationship class is then created in the BMC Atrium CMDB.
For more information about the parameters for the create method of the
CMDBRelationship Java class, open index.html of the Java API Help, which is located in the sdk/javadoc/cmdbapi/ subdirectory of your CMDB installation directory.
Working with relationship classes and instances
Creating a relationship between two CI instances
To create a relationship between two CI instances, you create a relationship instance. An instance of a relationship class defines a specific relationship between two particular instances of two CI classes. The following code illustrates how to create a relationship between two CIs.
In the following example, it is assumed that the newPhoneSystem and newSocket
variables, representing existing CI instances, the phoneClassId and the
socketClassId variables are already created.
Example: Relating two CIs
//retrieve the instance IDs for the newPhoneSystem and newSocket instances
String phoneInstId = newPhoneSystem.getId(); String socketInstId = newSocket.getId();
//create the required attributes of the relationship instance CMDBAttributeValue srcInstId = new
CMDBAttributeValue("Source.InstanceId", new
Value(phoneInstId)); CMDBAttributeValue destInstId = new
CMDBAttributeValue("Destination.InstanceId", new
Value(socketInstId)); CMDBAttributeValue datasetId = new
CMDBAttributeValue("DatasetId", new Value(acmeDatasetId)); Map attrHashMap = new HashMap();
attrHashMap.put(srcInstId.getAttributeName(), srcInstId); attrHashMap.put(destInstId.getAttributeName(), destInstId); attrHashMap.put(datasetId.getAttributeName(), datasetId); // create a Java instance of the relationship class CMDBInstance relInstance = new
CMDBInstance(relationshipClassKey, attrHashMap); try {
//Create an instance of the class within the BMC Atrium CMDB relInstance.create(this.getARServerUser());
}
In the example, the phoneInstId and socketInstId variables are created to hold the instance IDs of the newPhoneSystem and newSocket instances. The srcInstId and
destInstId variables are created to hold the IDs of the source and destination classes, which are phoneInstId and socketInstId respectively.
The datasetId variable holds the dataset ID of the ACME dataset. These source, destination, and dataset ID variables are written to the attrHashMap array. The Java instance of the relationship class is then created using the constructor of the
CMDBInstance class.
In the try loop, the relationship instance is created in the BMC Atrium CMDB. The
getARServerUser method of the relInstance instance retrieves the user ID that is currently used to log in to the AR System server. The user ID parameter is required to create the instance in the BMC Atrium CMDB.
For more information about the parameters for the create method of the
CMDBInstance Java class, open index.html of the Java API Help, which is located in the sdk/javadoc/cmdbapi/ subdirectory of your CMDB installation directory.
Retrieving instance details
You can query CI and relationship instances that exist in the BMC Atrium CMDB. The following code illustrates how to query instances of the phoneSystemClass
class.
Example: Querying an instance //Set specific attributes to return String[] attributesToGet =
{"InstanceId",
"ReconciliationIdentity", "DatasetId"};
//Specify values for the query to retrieve all instances where DatasetId //is ACME.DATASET
String query = "'DatasetId' = \"ACME.DATASET\""; try {
CMDBInstance[] instanceList = CMDBInstance.findObjects( this.getARServerUser(),
phoneSystemClassKey, query,
attributesToGet, null, //do not sort
CMDB_START_WITH_FIRST_INSTANCE, CMDB_NO_MAX_LIST_RETRIEVE, Null); } catch(ARException ex){ System.out.println(ex.toString()); }
In the example, the attributes to retrieve in the query are specified in the
attributesToGet array of type String. The query in this example retrieves the
InstanceID, ReconciliationIdentity, and DatasetID attributes from all instances. If no attributes are specified to return in the query, all attributes of the instances will be returned by default.
The query variable specifies a qualification that will retrieve all instances where the dataset ID is ACME.DATASET. In the try loop, the findObjects method of the
CMDBInstance Java class is used to retrieve instances. The retrieved instances are placed in the instanceList array, which is of type CMDBInstance.
For more information about the parameters for the findObjects method of the
CMDBInstance Java class, open index.html of the Java API Help, which is located in the sdk/javadoc/cmdbapi/ subdirectory of your CMDB installation directory.
Chapter
4
BMC Atrium CMDB tools
This section describes how to use the various BMC Atrium CMDB tools. The following topics are provided:
Working with the cmdbdriver program (page 42)
Migrating data between BMC Atrium CMDB servers (page 45) Using the extension loader (page 53)
Integrating the CI Relationship Viewer with other applications (page 63) Configuring the CI Relationship Viewer (page 69)
Creating CMDB status alerts (page 75)
Importing data with Integration Engine (page 76) Working with SQL views (page 77)
Working with the cmdbdriver program
The cmdbdriver program, which prompts you one at a time for parameters to each command you type, enables you to execute various BMC Atrium CMDB API functions from a command line, such as class, instance, and attribute data
manipulation. Figure 4-1 on page 43 displays the list of tasks that you can perform with the cmdbdriver program.
The parameters that are required for cmdbdriver commands are the same as the parameters that are required for the equivalent C API functions. For more information about API functions and their parameters, see Chapter 5, “C API functions and data structures.”
From the command line
Once you compile the source code or locate the prebuilt program supplied with the API, you are ready to use the cmdbdriver program. When you execute the program, the system displays the list of cmdbdriver commands.
You must provide the necessary login information and perform initialization operations for connecting to the BMC Atrium CMDB. You can then use the
cmdbdriver commands to call any number of API functions. When you are working with the specific commands, see Chapter 5, “C API functions and data structures,” to enter the appropriate values for the function parameters. If you are working with specific entries, use leading zeros to see the entry ID of those entries.
To use the cmdbdriver program (Windows and UNIX)
1 Start the cmdbdriver program using the following steps based on your platform: Windows
Navigate to C:\Program Files\AR System Applications\<server_name>\BMC Atrium CMDB\sdk\bin.
Double-click cmdbdriver.exe. UNIX
Navigate to /usr/arsystem/<server_name>/cmdb/sdk/bin. Type the command cmdbdriver.
Working with the cmdbdriver program
Figure 4-1: Initial screen of cmdbdriver
2 Initialize an API session with the init command. 3 Specify the login parameters with the log command.
You are prompted to specify several parameters one at a time. You must enter the following parameters:
Type a valid user name and password. Type the name of your server.
You can skip the other parameters. After you specify the login parameters, the command prompt appears.
4 Type the abbreviation of the function and provide the appropriate input parameter values.
For example, for importing class definitions, type impdf at the prompt. Use the help command (h or ?) to display the cmdbdriver commands. When you are finished using the cmdbdriver, type e or q to exit the program.
Using a script
You can also use a script file that contains the cmdbdriver commands and execute it at the cmdbdriver prompt. You can create this script file using any text editor, such as Notepad or Wordpad.
Example 1: cmdbdriver script file—Import definitions command impdf 2 1 BMC.CORE BMC_ComputerSystem 1 BMC.CORE BMC_SystemComponent 1 C:\ImportClasses
This example uses a script to import the BMC_ComputerSystem and
BMC_SystemComponent classes from the BMC.CORE namespace. To accept a default value for a parameter in the cmdbdriver script, insert a blank line.
Example 2: cmdbdriver script file—Get List Class command glc BMC.CORE BMC.CORE BMC_System BMC.CORE BMC_Component T
This example uses a script to retrieve the destination CI for the BMC_System source class. BMC_Component is the relationship between these CIs and both these classes exist within the BMC.CORE namespace. To accept a default value for a parameter in the cmdbdriver script, insert a blank line. The blank line in this example accepts the default value for the Number of characteristics parameter. The default for this parameter is set to 0 (none).
You can use the rec and srec commands of the cmdbdriver program to record
cmdbdriver commands. The rec command starts recording the commands you use at the prompt and srec stops recording these commands.
When you type the rec command, you are prompted for the name of the file in which to store these commands. After you record the commands in a file, you can execute it at the cmdbdriver program using the execute command.
Migrating data between BMC Atrium CMDB servers
Using cmdbdriver on UNIX
The cmdbdriver program requires specific shared libraries in the bin subdirectory of the BMC Atrium CMDB installation directory. By default, this subdirectory is located at /usr/arsystem/<server_name>/cmdb/sdk/bin.
These shared libraries are not added in the library path when you install BMC Atrium CMDB. To add them to the library path, you need to set the appropriate library path variable using setenv or export command.
The variable that you need to set varies for each UNIX platform. Table 4-1 lists the various UNIX platforms and their corresponding variables.
Table 4-1: UNIX platforms and corresponding Library Path variables
Migrating data between BMC Atrium CMDB
servers
This section explains how to migrate data from one BMC Atrium CMDB server to another using the cmdbdriver program. The most common reason to migrate data from one BMC Atrium CMDB to another is to move your BMC Atrium CMDB into production. The following procedure explains the steps to migrate from a BMC Atrium CMDB development server to a BMC Atrium CMDB production server. Before migrating your BMC Atrium CMDB data, make sure both your BMC Atrium CMDB servers are configured and running.
NOTE
The procedure explained in this section covers the steps for migrating only BMC Atrium CMDB definitions and data. If you have other BMC Software applications installed on your development server that access the BMC Atrium CMDB, such as BMC Remedy Asset Management, you need to migrate that data separately. Migrating your BMC Atrium CMDB from a development server to a production server requires the following high-level steps:
Step 1 Export class data with cmdbdriver (see page 47). Step 2 Export instance data with cmdbdriver (see page 48). Step 3 Import class data with cmdbdriver (see page 49). Step 4 Import instance data with cmdbdriver (see page 50).
UNIX platform Variable name
Solaris and Linux LD_LIBRARY_PATH
HPUX SHLIB_PATH
Step 5 Export reconciliation information with BMC® Remedy® User (see page 50). Step 6 Import reconciliation information with BMC® Remedy® Import (see page 52).
For information about known issues regarding the procedure explained in this section, see “Known issues” on page 52.
You can use cmdbdriver scripts to perform some of these steps.
Logging in to the cmdbdriver program
The cmdbdriver program is the command-line interface to the BMC Atrium CMDB C API. Prior to BMC Atrium CMDB 1.1 Patch 002, the driver program was named
osdriver.The following steps describe the procedure to start the cmdbdriver
program.
To log in to the cmdbdriver program
1 Start the cmdbdriver program using the following steps based on your platform: Windows
Navigate to C:\Program Files\AR System Applications\<server_name>\BMC Atrium CMDB\sdk\bin.
Double-click cmdbdriver.exe. UNIX
Navigate to /usr/arsystem/<server_name>/cmdb/sdk/bin. Type the command cmdbdriver.
2 Type the command init to initialize the driver.
3 Type the command log to log into your development server.
You are prompted to specify several parameters one at a time. You must enter the following parameters:
Type a valid user name and password. Type the name of your server.
You can leave the other parameters blank. After you specify the login parameters the command prompt appears.
4 Type the abbreviation of the function and provide the appropriate input parameter values.
For example, for importing class definitions, type impdf at the prompt. Use the help command (h or ?) to display the cmdbdriver commands. When you are finished using the cmdbdriver, type e or q to exit the program.
Migrating data between BMC Atrium CMDB servers
Step 1—Exporting class data with cmdbdriver
If you have added or changed any CI or relationship classes on your development server, you need to export them. This class data is also called metadata because it describes the instance data in the BMC Atrium CMDB. You need to export only those classes that you have added or changed, and their subclasses.
When you export a superclass that you modified, all the subclasses for the superclass will also be exported with it. If you have not made any additions or changes, you can skip Step 1 and import the class definitions using the steps explained in “Step 3—Import class definitions with cmdbdriver” on page 49.
To export definitions for a class and its subclasses
1 Log in to your development server.2 Start the cmdbdriver program and specify your user credentials.
For more information about logging in to the cmdbdriver program, see “Logging in to the cmdbdriver program” on page 46.
3 Type the xexpdf command.
4 At the Export all class? (F): prompt, type T to export all class definitions from the BMC Atrium CMDB.
If you press Enter to accept the default value of F, you need to specify the namespace, class, and attribute details for which you want to export the class definitions.
5 At the Export all attributes with classes? (T): prompt, press Enter to accept the default value of True.
6 At the Filename for exported data: prompt, specify the file name in which to save the exported definitions.
Make sure you specify the exact path for the file name, for example,
c:\ExportedClassDefinitions\CoreClassDefinitions.xml. If you specify a file name that already exists, the contents of the file is overwritten.