Yet another way to monitor Oracle GoldenGate with OEM12c
In a recent post on monitoring Oracle GoldenGate, I talked about how to configure the JAGENT to use Oracle Enterprise Manager 12c to monitor Oracle GoldenGate. If you would like to review that post, you can find it here. For this post, I’ll show you how you can use Metric Extensions within Oracle Enterprise Manager 12c to monitor Oracle GoldenGate.
Note: Another good post on this topic can be found from my friend Maaz. Here is his post.
As Maaz and I were talking about the finer aspects of the JAGENT, we started to talk about Metric Extensions to monitor Oracle GoldenGate. This got me to thinking how this could be accomplished.
One of the first things that is needed before you can set up a Metric Extension is how you are going to monitor the processes. Being that most of the Oracle GoldenGate instances that I monitor are on Unix/Linux, I decided to use a Perl script to grab the basic info associated with Oracle GoldenGate. This basically means, I just wanted to see what the current status of the processes was. This is achieved from GGSCI using the INFO ALL command (Figure 1).
As you can tell, all of the Oracle GoldenGate processes are running. In order to monitor these processes, they need to be put into a format that Oracle Enterprise Manager 12c can understand. In order to do this, I used a Perl script to get the output in Figure 1 into a pipe delimited string. The Perl script that I used to do this is located in Listing 1.
Listing 1: Perl Script
#!/usr/bin/perl -w
#
#
use strict;
use warnings;
#Static Variables
my $gghome = “/oracle/app/product/12.1.2/ggate”;
#Program
my @buf = `$gghome/ggsci << EOF
info all
EOF`;
foreach (@buf)
{
if(/EXTRACT/||/REPLICAT/)
{
s/\s+/\|/g;
print $_.”\n”;
}
}
The Perl script provided (Listing 1) basically reads the output from the INFO ALL command into a buffer. For everything in the buffer, look for any lines that have EXTRACT or REPLICAT in it. Then replace all the spaces with a pipe (|) . Lastly print out the output I want. When the script is ran, you should get output similar to Figure 2.
Figure 2: Output from Perl script
Now that the output is in a pipe (|) format, I can use this in the Metric Extension.
Before we take a look at Metric Extensions, if you have never used them they are a great way to extend Oracle Enterprise Manager 12c to be more efficient in monitoring granular things. The documentation associated with Metric Extensions in Oracle docs are great and they are also covered in the Expert Oracle Enterprise Manager 12c book out by Apress.
To begin setting up a Metric Extension for monitoring Oracle GoldenGate, you need to go to the Metric Extensions page within Oracle Enterprise Manager 12c (Enterprise –> Monitoring –> Metric Extensions). Once on the page, you are presented with a Create button about half way down the page (Figure 3). The Create option can also be accessed from the Actions drop down.
Figure3: Metric Extensions Page
Once you click on the Create button, you will be taken to a wizard to begin developing the Metric Extension. On the General Properties page, you need to fill out the required fields. Since you are going to monitor this with a Perl script, the Target Type will be Host. Then you need to name the Metric Extension (ME$). Next provide the display name; this is the name that will show up in the All Metrics later. Finally, the Adaptor drop down, select OS Command – Multiple Columns. This way the metric will read the pipe (|) sign and break the string up. Figure 4 provides you a screen shot.
On the next screen, you need to provide the command that will run the script and the script that you want ran. The delimiter field is a pipe (|) by default. Fill in the required information (Figure 5).
The Columns screen is next. This screen is where you will setup the names of the columns and map what will go where. Also, you can set the Alert Threshold for the the column that will be monitored. One key think to point out here, you will need a PK for the data. This basically means a unique way of identify an Oracle GoldenGate process. For this configuration, the PK is the uniqueness between Program and Object. Figure 6 illustrates how I have the columns configured for this setup.
Once you have the columns established, Oracle Enterprise Manager 12c will ask you what Credentials you want to use with this metric. The default monitoring credentials are fine (Figure 7).
Finally, you can test the Metric Extension and see how it is going to look. This is your chance to make sure that all the values from the script return and appear how you expect them to be. Figure 8, shows a successful test run. If you have everything configured as expected, your output should come up in the Test Results without the pipe (|) signs. If an error message is returned then investigate why you received it.
In my testing, the errors I received were due to the PK issue with the columns when defined for the metric.
Lastly, when you make it to the review screen, just check everything and click Finish. Once you click Finish, you will be taken back to the Metric Extension landing page. From the landing page, you can now deploy the metric to target the Metric Extension is to be associated with.
To deploy the Metric Extension, use the Action menu and select Deploy to Target. Select the target which is should be deployed to (Figure 9).
Once you Metric Extension has been deployed to the selected target, you can then go to that target and check in All Metrics to see how it looks. For a host, you can do this by going to Targets –> Hosts. Then select the host that you wanted. From the Host menu, select Monitoring –> All Metrics. Once on the All Metrics landing page, look for the name of the metric in the drop down tree then click on it. You will be presented with the current status of the metric in the right-hand pane (Figure 10).
Figure 10: Metric Extension status in All Metrics
At this point, the Metric Extension for monitoring Oracle GoldenGate processes has been successfully developed, tested and deployed to a target. The next step you need to accomplish is to ensure that you are notified when something happens to a process. This is done with Notification Rules (not covered here). Once the notification rules are established, monitoring Oracle GoldenGate using Metric Extensions is a great way to work around any JAGENT issues you may have.
Enjoy!
twitter: @dbasolved
blog: http://dbasolved.com
Current Oracle Certs
Bobby Curtis
I’m Bobby Curtis and I’m just your normal average guy who has been working in the technology field for awhile (started when I was 18 with the US Army). The goal of this blog has changed a bit over the years. Initially, it was a general blog where I wrote thoughts down. Then it changed to focus on the Oracle Database, Oracle Enterprise Manager, and eventually Oracle GoldenGate.
If you want to follow me on a more timely manner, I can be followed on twitter at @dbasolved or on LinkedIn under “Bobby Curtis MBA”.
When you undress me with your eyesWhere are you from?
You’re beautifully and incredibly inspiringChorusSo sharp, so real, so goodSomething new I’m experiencing
And I like how you elevate me into your sphere
79, and there were no significant associations of pCR rates between patients with different HR status using AP Doc treatment 42 priligy kaufen
You’re beautifully and incredibly inspiringChorusSo sharp, so real, so goodSomething new I’m experiencing
Something NewVerse 1I’m liking your div chicCasually cool and mysteriously captivating
Thanks for sharing. I read many of your blog posts, cool, your blog is very good.
Why are you here?Verse 2You’re confidently aware of who you are
Something NewVerse 1I’m liking your div chicCasually cool and mysteriously captivating
Where are you from?Why are you here?
A rush of senses collideAnd burst into our cores
I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.
When you’re sleepingWhen you’re sleepingWritten by B. (Saturday, June 14, 2014)Copyright 2014
I’ve never experienced your ways of being
Where are you from?Why are you here?