OpenPegasus 2.6 README

Abstract: Installation, build, and operation information on the OpenPegasus Version 2.8.0 Release. Note that if this readme conflicts with the documentation in the release notes or interface definition documents for a particular release, those documents should be considered authoritative. This is a simplified overview to act as an introduction to OpenPegasus.

OpenPegasus - A Manageability Services Broker for the DMTF CIM/WBEM Standards

Tagline: OpenPegasus is an object manager for DMTF CIM objects written in C++ and hosted by The Open Group

OpenPegasus Overview

> Availability
> Supported Platforms
> Dependencies
> Commands
> Documentation
> How to Participate

Installing OpenPegasus

> Download or Checkout
> Verify Dependencies
> Set the Environment Variables
> Build the Executables
> Populate the Repository
> Register Providers
> Notes about Building on Linux
> Notes about Building on Windows

> > The MU Utility

> Notes about Building with SSL

Testing an OpenPegasus installation

> Testing with ICU enabled

# OpenPegasus Overview

OpenPegasus (also referred to as Pegasus) is an open-source CIM Server for DMTF CIM objects. It is written in C++ and includes the Object manager (CIMOM), a set of defined interfaces, an implementation of the CIM Operations over HTTP operations and their cimxml HTTP encodings, and Interface libraries for both clients and providers. It is maintained to be compliant with the DMTF CIM and WBEM specifications with exceptions noted in the documentation.
OpenPegasus includes components for:

> 1. A DMTF compliant CIM Server that processes CIM operations, CIM Indications, and includes class and instance repositories and interfaces for creating CIM Providers and CIM Clients.
> 2. Provider interfaces so that providers may be build in multiple languages (i.e. C++, C, Java).
> 3. A number of CIM Providers.
> 4. A MOF compiler.
> 5. A number of CIM Clients to provide usage examples, CIM Server test functions, and administrative functions.
> 6. More complete information on the exact functions and their functional state is available from the Release Notes (pegasus/ReleaseNotes.htm) and the OpenPegasus Feature Status Page.

OpenPegasus is open source and is covered under the MIT open-source license.

OpenPegasus is being developed and maintained under the auspices of The Open Group. OpenPegasus is maintained under the license defined in the doc directory of this release. The specific file is: pegasus/doc/license.txt. This licensing is intended to support as wide a distribution as possible with minimal demands on the users.

More information on this project, access to the CVS, and documentation is available from the OpenPegasus web site.

http://www.openpegasus.org

Note that all references in this readme to files in the OpenPegasus source tree are of the form pegasus/..., where "pegasus" is the top-level directory and also the name of the OpenPegasus module in the Pegasus CVS repository. There are also other CVS modules for the OpenPegasus Java client (pegasus-JavaCIMClient) and for unsupported components and utilities for Pegasus that may be checked out separately. You can use viewCVS to view the Pegasus CVS tree

## Availability

OpenPegasus is distributed as open source under the MIT open-source license. The distribution is available via CVS, and as snapshot images in tar, zip, and (self-extracting) exe file formats on the OpenPegasus web site.

OpenPegasus can be obtained via any of the following:

1. Released tarballs (see ZIP/GZ/EXE link for this release)
2. CVS (See CVS code repository for more information)
3. Linux RPMs (see RPM link for this release)

CVS write accounts are managed by Martin Kirk of The Open Group (m.kirk@opengroup.org)

## Supported Platforms

OpenPegasus is regularly tested against a variety of platforms by the development group. The results of the nightly tests can be found here on our Nightly Build and Test Status page. The Release Notes for each release (pegasus/ReleaseNotes.htm) provide additional details regarding the platforms, compilers, etc. for the current release.

## Dependencies

We have worked to minimize the dependence of OpenPegasus on other software packages and tools. Currently OpenPegasus has the following dependencies. Note that all of the dependencis listed below are required only if selected options are enabled except for GNUMAKE which is the required make tool:

1. GNUMAKE - To simplify the building of OpenPegasus across multiple platforms we have standardized on a set of build tools including: GNUMAKE. We are using GNUMAKE 3.79.1 successfully both in Windows and Linux environments. It is available from http://www.gnu.org. The windows version of GNUMAKE is available on the Pegasus web site tools page.
2. FLEX and BISON - These tools were used to develop the MOF compiler and WQL and CQL parsers. These tools are required ONLY for development of the parsers, not for building OpenPegasus. Bison version 2.3 or later and flex version 2.5.4 or later are required.
3. Doxygen - The OpenPegasus documentation is taken from a combination of text files and header files themselves. This documentation is formatted with Doxygen and GAWK. This is required ONLY if you want to build documentation from the source tree. These tools are required to build the interface documentation set.
4. ICU Internationalization libraries - These libraries are used as the basis for message catalogs for message internationalization. See the ICU website (http://icu.sourceforge.net) for more information on these libraries. These libraries are used ONLY if you set the requisite environment variable ( PEGASUS_HAS_ICU) to use ICU
5. OpenSSL - If it is intended to use SSL on the communication protocol, the OpenSSL libraries are required (http://www.openssl.org).
6. OpenSLP - If you choose to use OpenSLP as your choice of SLP implementations, then it will need to be installed and available to OpenPegasus. Refer to the PEGASUS_USE_OPENSLP and PEGASUS_OPENSLP_HOME build variables in the doc/BuildAndReleaseOptions.html file, and the OpenSLP web site (http://www.openslp.org).
7. zlib - If you choose to enable the compressed repository feature with the PEGASUS_ENABLE_COMPRESSED_REPOSITORY build variable, you will need to install the gzip (GNU zip) compression utility. Refer to readme.compressed_repository in OpenPegasus source tree, and the gzip web site (http://www.gzip.org).
8. sqlite - If you choose to enable the use of sqlite for the repository, refer to the doc/BuildAndReleaseOptions.html file for the defintion of the build variables and the sqlite implementation which may be obtained either as part of a standard distribution or from http://www.sqlite.org.

NOTE: A set of the required tools for building on the Windows platform is available on the OpenPegasus Tools web page.

## Commands

Pegasus includes the server which can be controlled from the command line and a set of clients that provide adminstrative functions

The manpages for each of the commands are in the pegasus/rpm/manLinux/ directory (from CVS).

To see simple help for each command, invoke it with the "--help" option.

Some of the basic commands:

- cimserver (Start the server cimserver)
- cimserver -s (Shuts down the cimserver)
- cimserver traceLevel=4 traceComponents=ALL (Starts server with config flags)

- cimprovider -l -s (Lists providers and their status)
- cimprovider -e -m OperatingSystemModule (Enables the OperatingSystem provider)
- cimuser -a -u guest _w <ThePassword> (Adds the user guest with specified password)
- cimuser -l (Lists the users )
- cimconfig -l -c (Lists the current config options and their current values)

NOTES:

> 1. Refer to the admin guide in pegasus/doc/Admin_Guide_Release.pdf for more information about administering the OpenPegasus CIM Server.
> 2. There are differences between Windows and other platforms in starting the CIMserver as a daemon/service. Whereas most supported platforms use the OpenPegasus daemon configuration option to start the CIM Server as a daemon, on Windows it must be specifically installed as a service (ex. cimserver -install) and then started as a service (cimserver -start). The cimserver --help option explains the exact format of the start and stop options.
> 3. The cimuser command is used to manage OpenPegasus users only when the CIM Server is compiled without the PEGASUS_PAM_AUTHENTICATION environment variable defined. See PEP 308 for more information on these configuration options.

Documentation

Much of OpenPegasus is documented in the Pegasus Enhancement Process (PEPs) which are the basis for approval of OpenPegasus functionality, changes, plans, etc. The approved PEPs are publicly available on the OpenPegasus web site.

Other documentation available is an api document (creatable from the source tree, see pegasus/doc/apidoc) and other miscellaneous documentation in the CVS doc directory and the pegasus CVS root as readme files. Also, there is a set of Release Notes for each release in the OpenPegasus root source directory of CVS and as a Pegasus PEP.

## How to Participate

Contributors are welcome to participate in the OpenPegasus development effort. Join the mailing list by going to the Mailing Lists web page from the OpenPegasus site.

# Installing OpenPegasus

## Download or Checkout

Refer to the Availability section for instructions on obtaining source code.

If you want to install pre-built Pegasus executables instead of building from source code, then refer to the RPM installation instructions.

## Verify Dependencies

Before you build, install, or run OpenPegasus, be sure you have the proper set of software it depends on. Refer to the section Dependencies for the complete list.

## Set the Environment Variables

Before building, installing, or running OpenPegasus, some environment variables may have to be defined or updated. See PEP 292 for the full list of environment variables and configuration options for OpenPegasus. The minimum set is:

- PEGASUS_ROOT -- The directory containing the OpenPegasus root directory from CVS.
- PEGASUS_HOME -- The directory that will contain all output from building and running OpenPegasus, it can be the same as PEGASUS_ROOT if desired.
- PEGASUS_PLATFORM -- The platform on which OpenPegasus is being built.

There are a significant number of environment variables that control the compile and test of features in the OpenPegasus package in addition to the 3 variables described above. These variables are documented in the Pegasus documentation in CVS (see the pegasus/doc directory).

## Build the Executables

OpenPegasus is compiled and linked using a make structure that recurses through the OpenPegasus source tree.
Makefile commands
OpenPegasus includes several Makefiles that enable you to quickly build or refresh files for the server, clients, providers, test cases, and repository. To use these Makefiles, type "make" followed by one of the supplied targets.
For more information on the available make targets, enter "make usage" from the PEGASUS_ROOT directory. A recommended minimum set to know are:

- usage -- Explains the available make targets in some detail.
- new -- Clean out all objects, libs, executables, and the repository.
- build -- Builds dependencies, compiles, links, and installs the server. After this OpenPegasus is ready to run.
- alltests - Builds the repository entries and other resources required by the tests, and then executes all automated tests.
- world - Builds the complete environment and runs the test suite.

For a comprehensive list of the make targets, refer to pegasus/Makefile at the top of the OpenPegasus source directory.

## Populate the Repository

Before using OpenPegasus you must populate the repository. Typically, this is done during the build process by the 'make repository' target. However, you can also compile MOF (Managed Object Format) code manually with the cimmof compiler.

The 'make repository' target in the makefile pegasus/Makefile performs several functions including:

- Removes the existing repository (if one exists).
- Generates the default CIM Schema (defined in pegasus/mak/config.mak) in the repository (skeleton of CIM objects). Refer to PEGASUS_CIM_SCHEMA environment variable in Pegasus PEP 308 to set alternate schema versions.
- Loads schema for CIM Server functions (shutdown, add users, etc) and CIM indications (SNMP, Events, Alert, Threshold, etc) internal to Pegasus.
- Registers included CIM Providers (libOSProvider.so, libDNSProvider.so, … ) in OpenPegasus (which are located in src/Providers)

## Register Providers

OpenPegasus registers Providers using a set of provider registration classes encoded in MOF. This classes are proprietary to OpenPegasus today.

Registration is performed by creating instances of the registration classes that represent the provider module, providers, capabilities, etc. to be registered. The easiest way to create a new registration today is to copy from one of the existing registration MOFs. See the pegasus/src/Providers/sample/Load directory for examples of several registration instance implementations that do work with OpenPegasus today.

Registration may be performed by creating compiling the registration mof with either the on-line or off-line Pegasus mof compiler. It is recommended that providers be registered with the on-line compiler because this allows pegasus to validate the registration information.

## Notes about Building on Linux

To build OpenPegasus on Linux, ensure that you you have the necessary environment variables set (eg. PEGASUS_HOME, PEGASUS_ROOT, PEGASUS_PLATFORM). For 32 bit Linux, the definition of PEGASUS_PLATFORM is normally LINUX_IX86_GNU. For 64 bit IX86 Linux the definition of PEGASUS_PLATFORM is normally LINUX_IX86_64_GNU. Use the g++ compiler to compile and link the executables. All of the supported platform definitions are defined in pegasus/mak as make files with the definition:

platform_<operatingSystem>_<architecture>_<compiler>

The <operatingSystem>_<architecture>_<compiler> component is what forms the PEGASUS_PLATFORM environment variable so that the appropriate platform make file can be found during the build process.

## Notes about Building on Windows

Use of Windows 2000 SP3 or later is recommended. OpenPegasus is regularly tested on mulitple windows platforms.

We build OpenPegasus on Windows using a set of Makefiles contained in the source distribution, the Microsoft compilers (DevStudio 5.x is not supported, Visual Studio 6.0 (SP5) or later is supported) and the GNUMAKE make utility. Note that you MUST have the OpenPegasus mu.exe utility compiled and available before trying to compile OpenPegasus on the normal windows platform (This utility allows use of unix command line semantics for certain operations in windows). The following is the basic setup steps for the environment.

Setup the environment variables and path for the Micrososft Visual C compiler. Typically this can be done by running the VCVARS32.BAT file supplied with Microsoft Visual C++. (contained in the same directory as cl.exe).

For Windows, try the following for an example environment:

>     REM call the standard Microsoft .bat for VC 6 setup.
>     call 'C:/Program Files\Microsoft Visual Studio\VC98\Bin\Vcvars32.bat'
>     REM Set debug to something if you want to compile in debug mode
>     set PEGASUS_DEBUG=true
>     REM set PEGASUS_ROOT to top of source tree
>     set PEGASUS_ROOT=C:/cimom/pegasus
>     REM (Note: The '/' characters are intentional and required by the OpenPegasus build system).
>     REM     Also the disk designator (C:) is required for at least some newer versions of the Microsoft
>     REM     compilers to avoid confusion between options and paths
>     REM set PEGASUS_HOME to where you want repository and executables, it can be the same as PEGASUS_ROOT
>     set PEGASUS_HOME=%PEGASUS_ROOT%
>     REM set PEGASUS_PLATFORM for Windows
>     set PEGASUS_PLATFORM=WIN32_IX86_MSVC
>     REM setup the path to the runtime files.
>     set path=%path%;%PEGASUS_HOME%\bin

### The MU Utility

In order to provide a consistent build structure across multiple platforms, we developed a utility to provide a consistent set of functions across these platforms. The MU utility is a simple utility that contains many commands. For example:

C:\> mu rm myfile.cpp yourfile.cpp

You may type "mu" to get a list of valid commands. Here are some of them:

rm, rmdirhier, mkdirhier, echo, touch, pwd, copy, move, compare depend

The MU utility supports globing (expansion of wildcards) so you can do things like this:

C:\> mu rm *.obj *.exe

MU is required to build under the Windows environment. MU is available as part of the distribution of OpenPegasus.

NOTE: The binary for MU.EXE is not distributed in the OpenPegasus bin directory. You must build it separately. MU source code is part of the distribution in the directory src/utils/MU with its own make file. You must compile MU before you initiate the OpenPegasus make. A copy of the binary is made available as a zip file on the OpenPegasus Tools web page.

## Notes about Building with SSL

To build with SSL you need the OpenSSL libraries and header files. They are NOT distributed with OpenPegasus. Make sure you have them in a standard directory so OpenPegasus can find them. If that's not the case, set the environment variable OPENSSL_HOME= to point where your OpenSSL installation is (refer to PEP 292 for more details on build variables).

You must also have the PEGASUS_HAS_SSL environment variable defined. Then when you build OpenPegasus, it will include the SSL support.

Refer to the OpenPegasus SSL Guide (found in doc/PegasusSSLGuidelines.htm) for details on using OpenPegasus with SSL, creating SSL certificates, etc.

# Testing an OpenPegasus Installation

OpenPegasus includes an extensive set of test facilities as part of the CVS environment, including:

- Test Clients - There are several clients that have been built specifically to test OpenPegasus, or parts of OpenPegasus, including TestClient, Client, cimcli, ipinfo, osinfo, wbemexec, etc. See the src/Clients directory for more information. These programs require a running CIM Server with a complete repository. Note that some of these tests use classes and instances that are only installed with the "make testrepository" target including: test namespaces, extra classes and instances in those namespaces, and additional sample and test providers.

- Sample and Test Providers - Test providers exist for the major provider types in the src/Providers/sample and src/Providers/TestProviders directories.

- Unit Tests - Most OpenPegasus functions include unit tests for the functions. These are normally executed with the "make unittests" top-level target, or "make tests" which can be executed at many different levels of the source tree. Usually the unit test functions can be found in test directories immediately below their corresponding source code (i.e Common/tests contains the unit test functions for the Common directory). Unit tests are executed with the CIM Server shutdown and normally do not require the existence of class definitions in the repository.

- End-to-end Test Suite - the directory "test" contains a set of operation tests that cover the major CIM Operations. See TestMakefile in the PEGASUS_ROOT directory to execute these tests. This set of tests executes an extensive set of fixed tests and compares the results against predefined results.

Once OpenPegasus is successfully built, the tests can be executed through the root Makefile with targets such as:

> - make unittests - Execute the unit tests. These do not depend on having a running server or repository installed. They test components of the OpenPegasus code. These tests run to completion if successful but normally stop on the first error found by a test program.

> - make servertests - Executes the OpenPegasus end-to-end test suite against a running OpenPegasus server starting and stopping the server as required to modify configuration parameters. The repository must be installed for these tests to execute and they are tested against the default repository as part of regular OpenPegasus development and release testing. These tests will run to successful completion if there are not errors detected but will normally stop on the first error. There is a subset of these tests that can be run in an environment that does not have root privileges but root privileges are required to run the complete suite.

- make alltests - execute both the unit and end-to-end tests.

## Testing with ICU enabled

ICU (International Components for Unicode) refers to the set of libraries that OpenPegasus uses to run with globalization support. For example, these libraries are used to load messages in different languages, format currency and numbers according to a specific locale etc. In order to enable globalization, OpenPegasus must be built with ICU enabled, ie. the right environment variables must be set prior to running "make". Refer to the GlobalizationHOWTO.htm in the pegasus/docs directory for details.

When users run "make servertests" to verify the integrity of an OpenPegasus download, a series of tests are run that require the CIM Server to be running. These tests currently depend on specific messages returned from the CIM Server. When ICU is enabled, all messages come from the resource bundles and these usually do not match the hardcoded default messages within OpenPegasus. These hardcoded default messages are what the various test programs expect in order to complete successfully. If the ICU-enabled CIM Server is started without disabling message loading from the bundles, "make servertests" will fail. In order to run "make servertests" successfully with ICU enabled, an environment variable called PEGASUS_USE_DEFAULT_MESSAGES must be defined prior to starting OpenPegasus. Once this is defined, when OpenPegasus starts, all messages generated will be the default hardcoded messages. This will enable "make servertests" to complete successfully. Once "make servertests" is complete, you should stop OpenPegasus and then undefine PEGASUS_USE_DEFAULT_MESSAGES. If this variable is left defined, OpenPegasus will not be able to load messages using ICU resource bundles.

When running the "make unittests" command with ICU enabled, the PEGASUS_MSG_HOME environment variable must be set to the home directory where the ICU resource bundles are built. By default the resource bundles are built into directories below PEGASUS_HOME/msg, so that should be the setting for PEGASUS_MSG_HOME.

Licensed to The Open Group (TOG) under one or more contributor license agreements. Refer to the OpenPegasusNOTICE.txt file distributed with this work for additional information regarding copyright ownership. Each contributor licenses this file to you under the OpenPegasus Open Source License; you may not use this file except in compliance with the License.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.