Automating OpsLogix Oracle MP Configuration

5 minute read

Introduction

One of the flagship management packs from OpsLogix is the Oracle Database MP. This MP provides several GUI driven wizard to help you creating your own monitoring solutions for Oracle by leveraging the OpsMgr management pack templates (https://technet.microsoft.com/en-au/library/hh457614.aspx). At this stage, the OpsLogix Oracle MP provides the following templates:

01. Oracle Alert Rule template

This template allows you to create a rule that checks a value from your oracle environment and generate alerts in the event that the value is detected or missing, depending on the configuration you have specified.

02. Oracle Performance Collection Rule template

This template allows you to create a rule that will collect performance data from your Oracle environment in order to visualize data on the performance view and reports.

03. Oracle Two-State Monitor Template

This template allows you to create a monitor that will check the health of an element according to the configuration that you have specified in the wizard. It will generate alerts when the monitor becomes unhealthy.

Like any other OpsMgr management pack templates, the above mentioned templates can be found in the Authoring pane of the OpsMgr console, under “Management Pack Templates”:

image

Some Background on Management Pack Templates

The MP templates provide great ways for users to create complex monitoring scenarios without having to use MP authoring tools such as VSAE or Silect MPAuthor. The MP templates are designed to satisfy specific monitoring needs (i.e. Windows service monitoring, TCP Port monitoring etc.). From an OpsMgr admin and operator point of view, they are great, because each template provides a user friendly GUI driven wizard for you to create your monitoring solutions.

From a MP developer point of view, these templates are not easy to create – not only because you need to define the templates in the MP, but most of time, you also need to design the UI pages to be used in the wizard, which is very time consuming (not to mention these UI pages are written in C#). I have done it several times, and believe me, they are not easy! So every time when I see a MP offers management pack templates, I really appreciate the effort put in by the developers.

Although I think the management pack templates provides a user friendly GUI driven wizard for users to create their monitoring solutions, in my opinion, the biggest drawback is also the GUI wizard. It means you HAVE TO use the GUI wizard – it may become an issue when you have a lot of stuff to configure.

Let me give you an example based on my own experience. A few months ago, I was away attending a conference overseas and a customer needed to create hundreds of instances for the Windows Service monitoring template. Because they didn’t want to wait for my return, I was told someone spent a few days clicking through the wizard many, many times.

So what other options do we have? Fortunately, the management pack template instances can be created via OpsMgr SDK.

Automating MP Template Instance Creation

If you have been following my blog series “Automating OpsMgr”, you may have already read Part 17 of this series: Creating Windows Service Management Pack Template Instance, where I demonstrated a runbook leveraging the OpsMgrExtended PowerShell module and enabled people to create a management pack template instance (in this case, the Windows Service template) using one line of PowerShell script. This was a great example on how to create the template instances in mass scales.

OK, let’s go back to the OpsLogix Oracle MP… Just to put it out there, my experience with Oracle DB is very limited. Throughout the years I spent in IT, I’ve only been dealing with Microsoft’s SQL servers. Based on my experience with SQL, I know that every DBA will have a set of queries they regularly use to monitor their SQL environments. I assume this is also the case for Oracle. So, one of the first concerns I had when I started playing with this MP is, creating user defined monitoring scenarios could be very time consuming when using the management pack template wizards. Therefore, I spent few hours today, and produced 3 separate PowerShell functions that people can use to create instances for the 3 templates mentioned above. These functions are:

  1. New-OpsLogixOracleAlertTemplateInstance
  2. New-OpsLogixOraclePerfTemplateInstance
  3. New-OpsLogixOracle2StateMonitorTemplateInstance

Pre-requisites:

These functions requires the OpsMgrExtended Module on the computer where you are running the script. Please follow the instruction and setup this module first.

Download Link:

I have uploaded the code for above mentioned PowerShell functions to Github. You can download them from https://github.com/tyconsulting/OpsMgr-SDK-Scripts/tree/master/OpsLogix%20Oracle%20MP%20Scripts

Now, let’s test them, I will use the –verbose switch when calling these functions so you can see the verbose messages.

01. Creating a test MP

Firstly, I’ll create a test MP using the New-OMManagementPack command from the OpsMgrExtended module:

New-OMManagementPack -SDK "OMMS01" -Name "TYANG.OpsLogix.Test" -DisplayName "TYANG OpsLogix Test MP" -Description "Custom MP for OpsLogix test MP" -Version 1.0.0.0 Verbose

image

02. Create an instance for the alert rule template (using PowerShell Splatting)

Calling the New-OpsLogixOracleAlertTemplateInstance function:

image

SNAGHTML7af883b

03. Create an instance for the performance collection template

Calling the New-OpsLogixOraclePerfTemplateInstance function:

image

SNAGHTML7b050da

04. Create an instance for the Two-State Monitor template

Calling the New-OpsLogixOracle2StateMonitorTemplateInstance function:

image

SNAGHTML7b1236d

Note: There is also a test.ps1 script in this Github repository. It contains the test parameters used as shown in the screenshots above.

Conclusion

As you may have noticed, these functions also have a parameter set to support the SMA / Azure Automation connection object (defined in the OpsMgrExtended Module). If you are planning to make this part of your automation solution, you can simply change this from a PowerShell function to a runbook and use the –SDKConnection parameter to establish connection to the management group. this should be very straightforward; you can refer to my previous post on the Automating OpsMgr blog series for more details.

I hope these functions will help customers who are deploying Oracle monitoring solutions using OpsLogix Oracle MP. For example, if you need to create a lot of these instances, you can create a CSV file with all the required parameters and values, and then create a very simple PowerShell script to read the CSV file and then call the appropriate functions. I’ve done the hard work for you, the rest should be pretty easy :smiley:.

Lastly, if anyone would like to evaluate the OpsLogix Oracle MP, they can be contacted via email sales@opslogix.com

Leave a comment