API Toolkit for HP Operations Manager for Unix
The API Toolkit for HP Operations
Manager for UNIX (HP OM) provides access to the HP OM APIs beyond the native HP OM
capabilities by supporting various additional languages (HP OM supports
only ANSI C and limited Java) like C++, Perl and Java.
|
| Read more: |
|
|
|
Overview
|
|
The API Toolkit allows you to easily and rapidly create tools to implement typical OMU tasks like:
- reporting and housekeeping (for example: find all nodes with a certain IP address range, which have Heartbeat-Polling disabled, then enable it and send a completion message)
- operator utilities (for example, forced disown of messages for non-admin users while generating an corresponding annotation)
- complex or multi-step tasks (like adding a node, moving it to a layout group, assigning it to node groups, deploying policies, ...)
- integrating external products like HelpDesk/TroubleTicket/Notification systems (with much more flexibility and less maintenance effort - no TT/NS flag in policies needed) or generating reports or HTML viewsUsing the most popular Perl API all of that can be done without any compiler or platform-dependency hassles, even using the Perl runtime bundled with OMU. Plus, Perl provides an abundance of other modules seamlessly integrating with the OMU functions.
|
|
Language support
|
|
The HP OM API Toolkit product contains a set of application programming interfaces
(APIs) for HP Operations Manager for UNIX (HP OM). It extends all standard HP OM APIs by:
-
a true object-oriented C++ API
-
several script language APIs such as Perl, TCL, Python, ...
-
a Java API
With the current version, the following languages are supported:
Additional script languages will be added with future releases or on demand.
|
|
Installation
|
Supported API families and platforms
The following HP OM API families are part of HP OM /Unix and are fully supported by the HP OM API Toolkit product:
On HPOM Managed Nodes:
-
the Agent Message API – can be used to directly submit HP OM messages
-
the Agent Monitor API – can be used to directly submit HP OM monitor values
-
the Agent Message Stream Interface (MSI) – can be used to read or write (or both) messages directly in the HP OM message stream.
On the HP OM Management Server:
-
the Server Message API – supports all message- and annotation-related operations and application start.
-
the
Configuration API – allows the creation, modification and deletion of
all HP OM configuration elements (nodes, node groups, node hierarchies,
users, templates, ...).
-
the Server Message Stream
Interface (MSI) – can be used on the HP OM Management Server to read or
write (or both) messages directly in the HP OM message stream.
-
the
Message Event Interface (MEI) – supports the registration for Message
Change Events (MCEs) like message acknowledgment, own, ...
-
the
Application Response Interface (ARI) – needed after starting
applications using the Server Message API to listen for the result of
the application.
-
the Legacy Link Interface- can be used to integrate own agent platforms via external communication facilities.
-
the
Service API – can be used to browse the Service Navigator service model
and to register for service status change events (the native HP OM API is
already implemented in C++, the HP OM API Toolkit adds Perl and Java
support)
All of these APIs with their complete functionality are available through the HP OM API Toolkit for all supported languages.
Platforms
Currently
the OVO API Toolkit is supported on the following platforms (generally only the
OS sub-versions and platforms as supported by HP OM are available):
|
API Type
|
OS / Hardware
|
C++
|
Perl
|
Java
|
|
Agent APIs
|
Linux kernel 2.4 on X86 processors
|
x
|
x
|
x
|
|
|
HP-UX 11.x on PA-RISC and Itanium
|
x
|
x
|
x
|
|
|
Solaris 2.x on SPARC
|
x
|
x
|
x
|
|
|
Windows on X86 processors
|
x
|
x
|
x
|
|
Server APIs
|
HP-UX 11.x on PA-RISC and Itanium
|
x
|
x
|
x
|
|
|
Solaris 2.x on SPARC
|
x
|
x
|
x
|
|
Service APIs
|
HP-UX 11.x on PA-RISC and Itanium
|
|
x
|
x
|
|
|
Solaris 2.x on SPARC
|
|
x
|
x
|
The Perl and Java API modules have been generated using SWIG (http://www.swig.org).
HP Operations Manager 7.0 and later are supported. Certain API functions may
throw an exception (UNSUPPORTED) if used with HP OM versions that do not
support these functions (for example, Custom Message Attributes (CMA) have been
added with HP OM 7.0 and won't work with 6.x).
The minimum Perl version is 5.6.1 (as bundled with HP OM 7.x) and the minimum JRE version is 1.4.x.
Installation using swinstall on the HP OM Management Server.
|
|
HP OM Extension
|
HP OM API extensions
The main functionality of the HP OM API Toolkit is determined by the native HP OM API. However, the HP OM API Toolkit offers several usability enhancements:
-
Type enforcement during compile time. Type mismatches will be detected already during compilation.
-
Exceptions
yielding simplified error handling. Instead of checking every single
return code of an C API call a try/catch clause can surround a whole
set of calls.
-
Automatic destruction. When creating a
local stack variable representing an API object, it will automatically
destroyed (and all resources freed) when leaving the syntactical block.
-
Convenience classes and methods
-
Shared
connection. One program-global HP OM Server connection can be created and
be used implicitly in all subsequent API calls.
-
Special classes like OVMgmtServer (a simple node with default values already set) or OVUserAdmin.
-
C++ operators [], +=, -= dealing with containers, = and == as operators on objects as well as copy constructors
-
Smart default values. For example, all objects of class OVNode will have the NETWORK_TYPE by default set to IP.
-
Constructors taking most important member values as argument. E.g. an OVAgentMessage can be already constructed like
OVAgentMessage msg("app", "obj", "text");
-
Blocking application start (no need to deal with the Application Response API). Non-blocking mode is available as well.
- Encryption class (based on Bruce Schneier's blowfish algorithm), useful
for embedding encrypted passwords needed for connecting the HP OM server API
All these features apply to the C++ API and most scripting languages.
|
|
Example Programs
|
|
There
are numerous example programs covering all the API types (including
Makefiles which show how to build the programs, if needed) . The following example
shows an Perl program sending an HP OM Agent message:
# Send an OVO Agent message
use OV::OVO::Agent;
my $msg = new OV::OVO::Agent::OVAgentMessage();
$msg->setApplication("app");
$msg->setSeverity($OV::OVO::Agent::OPC_SEV_WARNING);
$msg->send();
The following Java example prints the name of all managed nodes using the Server Config API:
import com.bes.ovo.api.server.*;
[...]
try
{
OVSharedConnection con = new OVSharedConnection("opc_adm",
"OpC_adm");
OVNodeList nl = new OVNodeList();
OVNode.getList(nl);
for(int i = 0; i < nl.getNumElements(); i++)
{
OVNode n = nl.getElement(i);
System.out.println("**** tstapi: Node[" + i + "]: " +
n.getName());
[...]
}
}
catch(Exception e)
{
System.err.println("Exception: " + e);
}
[...]
|
|
Documentation
In order to gain full access to the Installation Packages
& Patches please login!
|
|