IT Operations Management (ITOM)

Meet the OMi Management Pack DevKit, Part 2

Meet the OMi Management Pack DevKit, Part 2


Guest post by Norbert Andres, Ops Bridge, Software Architect


HP recently released a development kit for creating Management Packs for Operations Manager i (OMi) operations management software.

In this blog post, I will demonstrate how the DevKit can be used to send events and create graph mappings for the example that got explained in the first blog here. If you haven’t read the first part yet, please consider doing that now.


In the first part we created a script to parse an Apache access.log file and store the metric in the agent performance store.

Now we want to optionally send an event in case the log file doesn’t exist, and that is what I will focus on in this post.

To achieve this we first introduce a setting in the ApacheAccessLogCollector.yml file.


application: ApacheLogReader
domain: WebServer
description: Reads metrics from apache log files
generate_availability: false
generate_discovery: false
logfile: /var/log/apache2/access.log
send_event: yes
# logfile: string, Path to access.log, Enter the complete path to the apache access.log file.
# send_event: yes|no, Send event, Send an event in case the log file doesn't exist

In the comment we set the values that Monitoring Automation (MA) will display for this parameter. ‘send_event’ is the key, ‘yes|no’ means that only these two values can be entered for this parameter. Next comes the display label and then the description. You can make this parameter optional by appending [optional] at the end of the comment. Here we leave it as a mandatory parameter with the default set to “yes”.


From the code we can access this new parameter like this:

my $sendEvent = $config->[1]->{send_event};

Now we can add the (overdue) check whether the log file provided as a parameter actually exists:

if (!-e $logFile)
    if ($sendEvent eq "yes")
      my %event = ('severity' => 'Warning', 
'text' => 'The logfile "'.$logFile.'" doesn\'t exist');
    $self->log($self->INFO, "The log file '$logFile' doesn't exist");


If the log file doesn’t exist, the minimum to do is write a log statement for troubleshooting purposes. If the parameter “Send Event” is set to “yes”, we create an event. Severity is set to warning.


Now with this code change we can quickly run a test on the command line.


After manipulating the log file name I get this result:

Running ApacheAccessLogCollector for metric/event collection.
    Severity:    Warning
    Text:        The logfile "access.loglog" doesn't exist
    Time:        2015-3-27 14:21
    Application: ApacheLogReader
    LogOnly:     false
    State:       open
The log file 'access.loglog' doesn't exist

So the logic seems to work. Let’s compile a Management Pack and try on a real agent using OMi 10.

Since we already created a previous version (remember you got to keep the content of the “config” directory), we create a version 1.2 using this command:

ContentCreator[.bat|.sh] –yml ApacheAccessLogCollector.yml –major 1 –minor 2

We now upload the Management Pack using the Content Manager of OMi and then deploy the MP as seen on the screenshot:


Shortly after deployment (and again after some manipulations to the log file name) the event shows up in Omi in a single pane of glass:

The event has successfully arrived.

If we now remember a state that we just sent an event we could send a “normal” event in case the log file suddenly appears. Since the message key is already set, the only thing we need to do is to send an event with the severity “Normal” (plus a different message text) to close the previous event.

In our case this is sufficient because we have only one event we would send.

If you send different type of events, you need to specify a specific message key. You can do this in the event data, by adding “option_msgkey” => ”ApacheLogReader:ApacheLogReader:filemissing’”.

my %event = ('severity' => 'Warning', 
‘option_msgkey’ => ‘ApacheLogReader:ApacheLogReader:filemissing’
'text' => 'The logfile "'.$logFile.'" doesn\'t exist');

If you have instance based monitoring, e.g. you want to monitor more than one instance of a log file or disk drives, URLs… you can add an instance identifier to the event:

my %event = ('severity' => 'Major', 
‘text' => Redis on port 6379 is no longer running', 
'category' => ‘Redis’, 
'instance' => ‘redis_ 6379’);

The event will then show up at redis_6369@@<node> if such a CI exists.


To send a closed event in case an error doesn’t occur anymore, you can simply at “state” => “closed”:

my %event = ('severity' => ‘Normal', 
		‘state’ => ‘closed’,
'text'  => 'The logfile "'.$logFile.'" now exists');

In this case, this event would close events with the same message key and move directly to the closed events section


Custom CI Hint:

my %event = ('severity' => 'Major', 
‘text' => 'Failed to contact access point: '.$url.', 
‘related_ci_hint’ => ‘myapplicationsrv1@@’.$nodeFqdn,
'category' => “my category”);

While this requires a good understanding of the way CI hints work it gives you a very fine granular way of influencing for which CI this event will appear.

The default would be the node or <instance>@@<node>. “instance” can in this case also be a CI type. So when you have a software than can run only once on a system and you want the event to appear for this CI, you can specify hadoop_master@@<fqdn>. If the application is instance based the instance identifier would be preferred.


So, to sum it up: sending an event using the DevKit is a matter of a few lines.

For more information check out the guide on the HP Live Network here.


In the next blog, we will look into graphs and checking thresholds based on metrics.




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. Register early to avoid disappointment. Here is a list of our HP OpsBridge related sessions that you won’t want to miss:


Session #


Date / Time



Vivit Opsbridge Deep Dive Session

Monday 1st June
1.00 – 3.00 PM

Carol Park
Ken Herold

Ian Bromehead


IT Transformation best practices, how evolving to the OpsBridge brings value

Tuesday, June 02, 2015

12:30 PM-01:30 PM

Mike Davies

Andy Wilkes

Miron Mizrahi

Ian Bromehead



Identifying the power and differentiation of a business value dashboard

Wednesday 3rd June


Luke Bradley Andreas Grollich, Vodafone Group
Harald Burose, Miron Mizrahi, HP


See how the all new OpsBridge Business Value Dashboard turns IT data into business insight

Tuesday, June 02, 2015
04:30 PM-05:00 PM


Luke Bradley and Andreas Grollich of Vodafone Ireland

Harald Burose, HP


Announcing HP Operations Bridge v10, case studies of Vancity and Arizona Public Services

Wednesday, June 03, 2015

09:30 AM-10:30 AM


Jay Rooney, Vancity

Ben Clonts, Arizona Public Sector

Ian Bromehead, HP


How IT Event Management with analytics inside can help you dramatically improve efficiency

Thursday, June 04, 2015

01:30 PM-02:00 PM


Harald Burose, HP

Ian Bromehead, HP


Evolving from domain to service-driven operations to dramatically improve operational efficiency

Wednesday 3rd June

Luke Bradley | Andreas Grollich | of Vodafone Group
William Gillen | Richa Trivedi of Fidelity Investments


Innovations in the Operations Agent are helping customers improve operations efficiency


Sanjay Chaudhary, HP David Herbstman, Wells Fargo, Kevin Hoffman, Costco


Maximize cloud and application performance with hundreds of operations bridge integrations

Thursday 4th June

Idan Harel, DoitWise, Rene Soltis, Citrix, Stefan Bergstein, HP


Proving value to executive management, Verizon Wireless on IT Operations Monitoring and Automation

Thursday 4th June


Andy Wilkes, HP
Anthony Gibson, Verizon Wireless


Best practices for cloud monitoring with BSM

Thursday 4th June

9-10 AM

Idan Harel, Doitwise
Stefan Bergstein, HP


What’s new in BSM, innovation tour and demonstrations

Tuesday 2nd June 12.30-13.30 PM

Christoph Pfister

Jeff Scheaffer

Joe Fox, HP


Search on the tag OMiContent for more blogs similar to this one.


The OM2Opsbridge program including license exchange details is now live.

Search on the tag OM2OpsB to find blogs discussing this program and evolution to OpsBridge.


We are pleased to announce the HP BSM Integration for BMC Impact Manager by Comtrade, version 1.1. The HP BSM Integration for BMC Impact Manager by Comtrade enables you to establish a link between BMC Impact Manager and HP Operations Manager i 10 (OMi).  


The key features of this release are:    

  • Support of Operations Manager i 10 and BSM Connector 10    
  • Self-discovery  

The installation package and the integration guide are available at


We are also pleased to announce the availability of yet another extension to our fast growing catalogue of management tools, the lightweight OMi Management Pack for Docker has been released on HP-LN:


  • operations bridge
0 Kudos
About the Author