Searching the Help
To search for information in the Help, type a word or phrase in the Search box. When you enter a group of words, OR is inferred. You can use Boolean operators to refine your search.
Results returned are case insensitive. However, results ranking takes case into account and assigns higher scores to case matches. Therefore, a search for "cats" followed by a search for "Cats" would return the same number of Help topics, but the order in which the topics are listed would be different.

Search for | Example | Results |
---|---|---|
A single word | cat
|
Topics that contain the word "cat". You will also find its grammatical variations, such as "cats". |
A phrase. You can specify that the search results contain a specific phrase. |
"cat food" (quotation marks) |
Topics that contain the literal phrase "cat food" and all its grammatical variations. Without the quotation marks, the query is equivalent to specifying an OR operator, which finds topics with one of the individual words instead of the phrase. |

Search for | Operator | Example |
---|---|---|
Two or more words in the same topic |
|
|
Either word in a topic |
|
|
Topics that do not contain a specific word or phrase |
|
|
Topics that contain one string and do not contain another | ^ (caret) |
cat ^ mouse
|
A combination of search types | ( ) parentheses |
|
Scripting
Scripting enables you to perform additional processing and customizing during the synchronization process:
-
Pre-mapping scripts are executed before the mapping rules are applied.
-
Pre-upload scripts are executed after mapping, but before the upload of data to the
RTSM (Run-time Service Model).
-
Post-upload scripts are executed after the upload of data to the RTSM.
One script of each type can be associated with each synchronization package. These optional script files are located in the associated synchronization package directory. For details of synchronization package locations, see Synchronization package locations.
Associating script files with synchronization packages simplifies the distribution of scripts and enables script development to be handled independently of the working environment. The execution of synchronization scripts follows the settings of the synchronization packages:
-
Only scripts in active synchronization packages are executed.
-
Scripts are executed in the order of the priority of the synchronization packages.
Caution Script execution is potentially insecure. In particular, the use of scriptInterface.exec(...)
commands can cause damage to an installation. To enhance security, script access for editing is allowed on the file system level only. This makes sure that only users with log-on credentials to the OMi host can edit scripts. This protects the scripts by the log-on security of the OMi host.
Learn more

Groovy scripting is supported. Groovy is a high level, object-oriented scripting language for the Java platform, which complies down to Java bytecode.
Groovy is aimed at Java developers, and is tightly integrated with the Java platform. It provides you with a similarly powerful and concise coding syntax to that provided by languages such as Python or Ruby, while enabling you to stay on the Java Virtual Machine (JVM). Java beans are supported, and Java and Groovy classes are interchangeable inside the JVM. As Groovy integrates well with Java code and libraries, and enables you to reuse the semantics of Java, and all J2SE and J2EE APIs, you do not have to learn, implement and maintain new semantics and APIs.
For more information about developing and deploying Groovy scripts, see Groovy scripts.
There are three Groovy scripts that can be placed into a topology synchronization package, and these are identified using fixed names within synchronization package directories. Each script runs at a defined point in the synchronization process:
-
preEnrichment.groovy
— script to be executed before mappingThe
preEnrichment.groovy
script is executed before starting the topology synchronization’s mapping process. -
preUpload.groovy
— script to be executed before uploadThe
preUpload.groovy
script is executed after the mapping process but before writing any data to theRTSM (Run-time Service Model) (for example, to create additional CIs or add extra details to existing CI instances).
-
postUpload.groovy
— script to be executed after uploadThe
postUpload.groovy
script is executed after saving the uploaded data in the RTSM, to modify data saved during the upload process (for example, for logging or auditing purposes).
The upload is performed between execution of the preUpload.groovy
scripts and the postUpload.groovy
scripts.

By default, the use of Groovy scripts is enabled (in the OM Topology Synchronization settings, the Enable usage of Groovy scripts
value is set to true
).
To help identify the cause of synchronization failure, you can disable scripting. If there is an error in a script, disabling scripting should make successful synchronization more likely.
To disable topology synchronization package script execution, change the Enable usage of Groovy scripts
setting from true
to false
in the OM Topology Synchronization settings in the Infrastructure Settings manager:
Administration > Setup and Maintenance > Infrastructure Settings
Alternatively, click Infrastructure Settings.
Operations Management - HPOM Topology Synchronization > Enable usage of Groovy scripts

The Groovy scripts must be located in the same directory as the topology-synchronization mapping rules:
<OMi_HOME>/conf/opr/topology-sync/sync-packages/<SyncPackageName>

Each script has two predefined variables:
-
ScriptInterface
Object Type:
com.hp.opr.ts.scripting.ScriptInterface
Description: Enables access to CI information function calls to manipulate synchronization data and control the synchronization.
The object type implements the following interface:
com.hp.opr.ts.interfaces.scripting.IScriptingInterface
-
SyncData
Object Type:
com.hp.opr.ts.common.data.sync.SyncData
Description: Provides access to the data that is synchronized.
The object type implements the following interface:
com.hp.opr.ts.interfaces.data.sync.ISyncData
For more information about the interfaces and object types required for developing your own topology synchronization scripts, see the Java API Documentation document located in the following directory:
<OMi_HOME>/opr/api/doc/opr-ts-interfaces-javadoc.zip
Scripts within a synchronization package share the same variable scope. That means variables assigned in preEnrichment.groovy
can be later used in the corresponding preUpload.groovy
and postUpload.groovy
. Scripts from different synchronization packages do not share variables with the same name, which avoids name clashes and undesired side effects.

Errors in scripts result in the generation of exceptions. The error handling is around each script invocation. By default, an exception in a script aborts the synchronization. This behavior can be changed by calling the command:
scriptInterface.setAbortSyncOnError(boolean)
When set to false, you can enforce a script failure using the method abortSync(“...“)
. For example, your script checks conditions, and because of these forced failures, a synchronization cannot be completed.
The following table shows the relationship between synchronization status (successful or unsuccessful synchronization) and script behavior.
Status |
Script behavior |
---|---|
Synchronization OK |
Scripting completed without errors and without forced synchronization interruption within a script. Scripting completed without errors even if an exception is thrown, and |
Synchronization failed |
A script execution caused an exception or the script forced a failure because of a scripting condition using the |

The following script is an extract of a sample preUpload.groovy script:
import com.hp.opr.ts.interfaces.data.ci.* ; import com.hp.opr.ts.common.data.ci.* ; import java.util.*; import java.lang.String; List resourceGroups = new LinkedList (); List haMembers = new LinkedList (); // Get all OM services, hosts and node groups for (ICi ci : syncData.getConfigurationItems()) { if (ci.getOmTypeId() == "Class_RG") { // If type is "Class_RG", then create a CI of type IP for all entries // of the OM attribute ip address
scriptInterface.logInfo ("add resource group"); resourceGroups.add (ci); } } // Create ip-ci and relationship to the cluster package for (ICi ipCi : resourceGroups) { HashMap hm = new HashMap(); // Get OM service-specific attributes hm = ipCi.getOmAttributes(); // Create CI for ip-address attribute ICi newCi = scriptInterface.createCi(); newCi.setContext ("cluster"); newCi.setCmdbAttribute ("ip_address", hm.get("ipaddr")); newCi.setCmdbAttribute ("ip_domain", "\${DefaultDomain}"); newCi.setCmdbTypeId ("ip"); scriptInterface.logInfo ("create relationship between two ip-ci: "
+ hm.get("ipaddr") + " and cluster package " ); // Create the “contained” relationship between the cluster package // and ip
scriptInterface.createCmdbRelation(ipCi, newCi, "contained"); } }
We welcome your comments!
To open the configured email client on this computer, open an email window.
Otherwise, copy the information below to a web mail client, and send this email to ovdoc-asm@hpe.com.
Help Topic ID:
Product:
Topic Title:
Feedback: