IT Operations Management (ITOM)
Showing results for 
Search instead for 
Do you mean 

A closer look at the functionality of OMi Script Dev Kit

HaraldPfaender on ‎05-12-2015 03:50 AM

In today's world, changes occur quickly in almost all areas – but especially in IT. With the growth of the Internet and the new Internet of Things there is a proliferation of data to be managed. This is both a challenge and a change for IT companies.


Today all kind of services are available through the Internet and users demand high response time and without downtime or failure. Think of your preferred web shop where you normally buy or browse items. Failures of any Internet service means consumers may choose another one and move away. There is a high risk that these consumers will never come back. This is why providing a high quality of service is vital. The key to providing these services is pro-active monitoring.


In addition, changes in the new world of IT happen fast. As a result, IT environments need to be very flexible. Demands from consumers are high and changes need to be reflected in the service offering. This shift also has an impact to service monitoring.


Fortunately Operations Manager i 10 (OMi 10) can help. OMi10 provides lots of functionality out-of the box (like Content Packs for 100+ areas), but has also the ability to get highly customized. It is the tool of choice for your monitoring needs—and it is all available in a single pane of glass. It handles all of the monitoring – either directly or via smart integration of the corresponding element manager, too! It can do both standard and advanced monitoring and is highly customizable as well.


You can download Operations Manager i here to try the script dev kit for yourself.


Our customers like that the new version of Operations Manager i 10 offers great flexibility and supports all the work which needs to be done. This ability helps to successfully operate an IT monitoring environment and contributes to the success of the IT Business.


One good example for customization is the OMi event pipeline. It is highly customizable and events can be adapted at several stages. This feature is called the Event Processing Customizations - also known as Event Processing Interface (EPI).

 

 

With the EPI, incoming events can be easily modified and enriched with information from any other source—you name it. It is useful to automatically add any attributes to the event to help in problem isolation and problem resolution and at the end will save your day and will help off-load you from manual steps.


Operations Manager i 10 (OMi) includes a Script Dev Kit which makes working with the EPI very easy. In this blog I will show you how to install, configure and work with the Script Dev Kit.


Installation:


The Script Dev Kit is included in the Operations Manager i 10 installation media. Once OMi10 is installed, the Script Dev Kit can be found here:
/opt/HP/BSM/opr/support/script-devkit

 

There you can find detailed documentation and the Script Dev Kit itself. This script is a workspace that can be used with Eclipse IDE (http://www.eclipse.org/). Eclipse IDE is a powerful open source development studio. It makes programming easy by providing several benefits like code completion and syntax highlighting. Eclipse IDE itself is not included in the OMi10 installation and can be downloaded separately together with the groovy plugin. These download locations can be found inside the Script Dev Kit documentation.

 

Once you have downloaded the Eclipse IDE, simply start it by running the eclipse from the binary folder. The folder location depends on where you have unzipped the Eclipse IDE.

 

Afterward install the groovy plugin (simply click on Help -> Install New Software). For the groovy plugin also install and select the Groovy 2.2 compiler from the Extra Groovy compilers section. Afterward Eclipse IDE needs to be restarted to complete the installation.

 

Configuration:

 

The next step is to advise the groovy compiler to use version 2.2 (which is the compiler version used by OMi10). This can be done in Eclipse via Windows -> Preferences -> Groovy -> Groovy compiler.

 

Now it is time for the OMi Script Dev Kit. As mentioned before, it is a workspace for the Eclipse IDE. Therefore the only thing we need to is to import it. In Eclipse use File -> Import, select Use Project from Existing source and point to the location where you have unzipped the Script Dev Kit. That's it!

 

Now you should see a workspace like this:

 

 

 

The Script Dev Kit contains several folders: scripts, tests, lib and scriptkit.

 

Usage:

 

The most important folder is the scripts folder. This folder already contains two sample scripts which can be used within the Operations Manager i module: Event Processing Customization API:

  • EpiSampleScript
  • EpiAdvancedSampleScript

These two scripts show the basics of how an event can be enriched.

 

  • The EpiSampleScript modifies the event title and the severity of an incoming event.
  • The EpiAdvancedSampleScript performs more advanced queries in order to enrich the event with the related CI information.

Both are good samples and I would recommend not modifying these scripts. Then you can refer to it at any later time. Instead, I recommend creating a new script in this folder.

 

Remember: In case you are using functionality which requires the usage of external libraries (like jar files) they need be copied into the lib folder, too. This is important to make the Eclipse IDE recognize the new library functionality.

 

Now you can start developing your own scripts and benefit from all features of the Eclipse IDE like code completion, syntax highlighting and code formatting.

 

Uploading scripts into Operations Manager i.

 

Once a script is ready to be deployed in Operations Manager i 10 - you have developed and tested it successfully - you simply can copy and paste the contents into a new script inside the EPI.

 

Please determine the most suitable EPI steps location inside the pipeline. A script can be executed from different OMi locations (again this shows how flexible OMi10 can be customized):

 

  • Before CI/ETI Resolution
  • After CI/ETI Resolution
  • Before Storing Events
  • After Storing Events

 

Depending on what the script is doing, put the script in the corresponding EPI pipeline step. In order to refer to the related Configuration Item (CI) for an event it should be placed After CI/ETI Resolution. In case an event needs to be enriched to help CI/ETI Resolution working simply put it at location Before Storing Events.

 

EPI scripts that act as an external trigger can be placed After Storing Events. Hint: In case an EPI script is just used to trigger an external source and is not modifying the event itself on can also select Read-Only in the EPI script (Tab: Advanced) which results in higher performance, because other OMi events can be processed in parallel and do not wait until processing of this OMi event is finished.

 

 

 

The Script Dev Kit documentation explains in more detail how to create a new script and how to upload and download it into the Operations Manager i.

 

Testing

 

Another cool thing of the Script Dev Kit is that you can also test the developed script using existing events from your Operations Manager i installation.

 

There is a folder tests and also includes two sample script. These scripts are responsible for doing unit test and can give you a confirmation if the developed script works and how it behaves with the existing events:

 

 

 

Here you can copy the corresponding unit test samples and put it into your own test case. In the sample above, I have added my own script HaraldSampleScript and also the associated test case HaraldSampleScriptTest. The unit test also includes a skeleton how to connect to the Operations Manager i using a web service for even retrieval. Just fill in the correct username and password and you are ready to go.

 

To run the test case simply click on it and select Run As -> Junit Test.

 

Hint: Event debugging is also possible (Debug As -> Junit Test).

 

After the test case was run Eclipse IDE shows you a detailed summary where you can verify if your script works as expected.

 

 

 

Finally when the script is tested and uploaded (do not forget to enable it) you should see it working for your events:

 

 

Summary:

 

Customizing the Operations Manager i event pipeline using the Event Processing Interface (EPI) gives you a great flexibility to make most of your daily events. I am sure the Script Dev Kit will make your life much easier and will enable you to generate more powerful scripts much faster.

 

Interested in the Script Dev Kit? Then go for it and simply try it out your own

 

You can download Operations Manager i here to try the script dev kit for yourself.

 

For more information on HP Operations bridge solutions please go to www.hp.com/go/opsbridge

 

 

News:

HP Discover Las Vegas 2015 is just around the corner, starting June 2nd. We have many announcements, sessions, demonstration booths for you to see and learn about our new exciting innovations. Please register early to avoid disappointment, our HP OpsBridge related sessions are

0 Kudos
About the Author

HaraldPfaender

Comments
JJacques
on ‎06-18-2015 03:16 PM

Hello,

 

Thank you for the information about the OMi Script Dev Kit.  I was excited to learn about the kit as I have had a few struggles with EPI scripts.

 

I downloaded the kit from HPLN, but I have hit a snag getting everything installed.  It seems the site that provides the Groovy-Eclipse plugin no longer exists (springsource.org).  That site fowards over to spring.io, but I have not found the Groovy-Eclipse plug in download.  There are plenty of other Eclipse downloads, but not the one the OMi kit needs.

 

Do you know of any other site(s) that might have the plug in available?  I understand it is not an HP product, but is it on HPLN somewhere?

 

Thank you

HaraldPfaender
on ‎06-18-2015 11:22 PM

Hello JJacques,

 

thanks for your comment.

 

Regarding your question: The link from the script devkit description works for me:

http://dist.springsource.org/release/GRECLIPSE/2.9.1/e4.4/org.codehaus.groovy-2.9.1.xx-201411061335-e44-RELEASE-updatesite.zip

Can you try it again and let me know if it worked?

 

Kind regards,

Harald

Events
June 6 - 8, 2017
Las Vegas, Nevada
Discover 2017 Las Vegas
Join us for HPE Discover 2017 in Las Vegas. The event will be held at the Venetian | Palazzo from June 6-8, 2017.
Read more
Apr 18, 2017
Houston, TX
HPE Tech Days - 2017
Follow a group of tech bloggers for a new HPE Tech Day, a full day of sessions about how to create a hybrid IT, from hyperconverged to Composable Infr...
Read more
View all
//Add this to "OnDomLoad" event