Getting Started with Probe-SDK

Getting Started with Probe-SDK
The Probe SDK is a set of Java libraries, build and packaging tools, and project templates that accelerate the development of UIM compatible probes. Probe-SDK probes use the new “Probe Framework” Java APIs, which are built on top of the existing Nimsoft-API. The Probe-SDK and underlying Probe Framework API’s are geared towards the development of a ‘typical use case’ probe. The ‘typical use case’ probe is a probe that produces inventory, metrics, QoS data, and alarms.
The Probe-SDK and Probe Framework provide higher-level Java API's that free the probe developer from having to implement many of the standard components of a probe, assuming the probe follows the typical use case.
Who Should Use the Probe-SDK
The primary function of a monitoring probe is to identify devices and components and publish QoS metrics on the identified devices and components. The Probe SDK is available for probe developers who want to create a new probe designed to monitor elements of infrastructure and publish QoS data and alarms to the CA UIM message bus. A probe developer should be familiar with:
  • CA UIM and its architecture
  • How probes identify devices and components within an environment
  • How probes collect and publish metrics to the message bus
In addition, this guide assumes a working knowledge of:
  • Java
  • Maven (optional)
How to Obtain the Probe-SDK Zip Package
Obtain a copy of the probe-sdk-<version>.zip package from the Probe Archive.
 The probe-sdk-<
>.zip package is not a standard probe package. Do not attempt to load this file through the probe user interface.
Installing the Maven Artifacts
To use the Probe SDK, you must install the Probe-SDK artifacts from the archetypes and libs directories into your Maven repository. The artifacts include:
  • Java libraries
  • Project templates (Maven archetypes)
  • Build tools (Maven plugins)
The Probe SDK package includes the
 scripts that install the artifacts for you.
Follow these steps:
  1. Verify that Java SE SDK 7 is installed.
  2. Verify that Maven 3.0 or later is installed.
  3. Verify that you have Maven on your path by issuing the following command:
    mvn -version
  4. Obtain the probe-sdk-<version>.zip package from the Probe Archive.
  5. Extract the Zip package to a directory of your choice. You will want to return to this directory to periodically review the examples and documentation.
  6. From a command prompt, issue the following command to run the appropriate install script (
     for Windows and
     for Linux). The install scripts upload the artifacts to your local Maven repository.
    install -all
What is Included in the Probe-SDK
The probe-sdk-<version>.zip package contains the following components:
    archetypes directory
     – Probe templates that you can use to start a new probe development project. These templates are packaged as Maven Archetypes and are uploaded to your Maven repository when you run one of the provided install scripts. See the Hello World procedure for instructions on using the archetype templates.
    docs directory
     – This directory contains the javadocs, a list of standard metrics, and the readme file.
    examples directory
     - Several examples of probes built with the Probe-SDK. These probe examples demonstrate many of the design elements you should consider when creating a probe. Each example probe was built using one of the provided Maven Archetypes as a starting point.
    libs directory
     - This directory contains the probe-api jars and the required Maven plugins. This content is all that you need for development on your local system.
    Install scripts
     – Scripts to automate the process of installing the required libraries and archetypes into your Maven repository.
The Probe-SDK makes use of Apache Maven and follows the standard Maven conventions and patterns. The items in the archetypes and libs directory are packaged as Maven artifacts that must be installed in your local Maven repository.
Maven Archetype Templates Delivered with Probe SDK
The probe templates contained in the Probe SDK package are delivered as Maven archetypes. Using these templates reduces development time by having the project structure, build and packaging setup, as well as the probe skeleton code generated for you. The Probe-SDK delivers the following probe templates in the archetype directory:
     Use this template to build a probe that gathers availability and performance data for a resource running on the local robot on which the probe resides. For example, a local probe might monitor CPU usage.
     Use this template to build a probe to monitor devices external to the robot on which the probe resides, such as network switches, routers, or a remote web server.
     Use this template to build a 
    high scale
     remote probe to monitor a large inventory external to the robot on which the probe resides, such as a remote VMware environment. Create this type of probe when you need to configure monitoring in bulk using templates and filters. This type of remote probe supports probe-oriented bulk configuration (pobc).
Hello World with the Probe-SDK Package
Let's now walk through a simple example to demonstrate the mechanics of creating a probe with the Probe SDK. We call this the 'Hello World' example in keeping with the tradition of providing the simplest possible program to demonstrate new technology. This example introduces you to using components of the Probe-SDK package and shows you how to create and build a new probe project using a probe template. The probe you create is a skeleton probe that can be deployed to Admin Console but will not perform monitoring or alarming tasks. The three tasks involved in building a Hello World probe are:
  • Create a new probe development project using the probe template.
  • Build and package the new probe
  • Deploy the new probe and verify it is running.
After you create a new project, you can modify the project source code to develop your custom functionality. See the Probe SDK Cookbook for more details.
Creating a Probe Project From a Template
You create a probe project using a Maven Archetype template.
Follow these steps:
  1. Open a command prompt in the directory where you want to create your new probe development project.
  2. To begin to create a probe project, issuing the command:
    mvn archetype:generate -DarchetypeCatalog=local
  3. Creating a new project starts an interactive session that prompts you for the following information:
    1. archetype: Select 
      . This is the template your project is based on. See Maven Archetype Templates Delivered with Probe SDK for more details.
    2. groupId: Enter 
      . This is typically your organization domain name. This value is used as the groupid in the pom.xml file and used as the default vendor name for the probe.
    3. artifactId: Enter 
      . This is the probe name. This value is used for the Maven artifactId and the probe name.
      Probe names are comprised of all lowercase characters and can include underscores for spaces. Do not include numeric or special characters. Valid probe names are wasp, spooler, service_host, and graph_analyzer.
    4. version: Press 
       to accept the default. This is the version of your probe.
    5. Package: Enter 
      . The Java package where the probe source code will be placed.
  4. Enter 
     to confirm your configuration.
The new probe project is generated.
Compiling and Packaging the New Probe
You compile and package a probe to get it ready to be imported into the Archive in Admin Console. Any probe that resides in the Archive can be deployed to a hub robot in your domain.
Follow these steps:
  1. Open a command prompt in the probe project directory.
  2. Execute the command:
    mvn clean install
    This command builds and packages the probe. The final distribution will be found in the `target` directory.
mvn clean install
 command invokes the Maven build process. The standard Maven build configuration file, pom.xml, is in the probe project directory. This file is configured and put in place when you create a project using one of the Maven Archetype templates. You do not need to become a Maven expert to make use of the Probe SDK package, although you should have a basic understanding of Maven and the pom.xml file.
After you create a project using one of the Maven Archetype templates, you will have a stubbed out probe project with the following characteristics:
  • A Java project with a fully configured pom.xml for proper build and packaging of your probe.
  • A minimal, probe_schema.xml configuration that demonstrates one custom element containing one QoS metric and bulk configuration. You can find probe_schema.xml in the src\main\resources directory.
  • A primary probe Java class named, containing a typical implementation of addDefaultConfigurationToGraph() and a stubbed out getUpdatedInventory() demonstrating how to get started with producing an inventory and metrics. You can find in the src\main\java directory.
  • The probe project builds, is packaged, and can be deployed the moment it’s created. This provides a great starting point for your probe development.
Deploying the New Probe
When the probe is packaged, you can deploy it to hub robots using Admin Console.
 Probes built with the Probe SDK are compatible with CA UIM v8.1 and above.
Follow these steps:
  1. Click 
     at the top of the window.
  2. Import the <probe_name>.zip file. Your new probe resides in the probe project ‘target’ directory.
  3. Deploy the probe.
Viewing the Probe Configuration
To verify that the new probe has been deployed and is operational, view the probe configuration displayed in Admin Console. Select 
 from the probe menu.