Monday Jun 10, 2013

Operational Plans - Running plans against multiple targets using Oracle Enterprise Manager Ops Center 12c

Oracle Enterprise Manager Ops Center - Operational Plans - Tricks and Tips #2

In this blog, I will be showing you how to run your Operational Plans against either a single target (host) or many targets at once. When you have created your Operational Plan and loaded it into Ops Center, the next thing you will want to do is to run it. If you want to run it against a single host, just select the target from the asset tree under the "Assets" menu.

Select the "Execute Operation" action near the top of the "Actions" panel.

 And select the Operational Plan you want to run.

You can also use predefined groups based on an Operating System version like "Solaris 10" by changing the pull-down in the "Assets" menu and selecting "Operating Systems". Of course, I expect that you will have more than one Solaris 10 host. When you execute the Operational Plan, it will run against all the targets that are part of that group.

With the group highlighted, select the "Execute Operation" action, which for OS groups is a little lower down the "Actions" panel.

It is worth noting here that as of Ops Center 12.1.3 (12C Update 3) the predefined Operating System group for Solaris 11 does not have the "Execute Operation" action enabled. While we are working on fixing that, it just means you have to create a User Defined Group based on Solaris 11 OS's. Creating a User Defined Group, both static and dynamic (smart groups), will be a topic for a later blog, but until then, if you don't know how to create a User Defined Group, please refer to the Ops Center documentation at

Or, as a third method of selecting Operational Plan targets, you can change the pull-down in the "Assets" menu and select "All User Defined Groups". Then, choose the group you would like to run your Operational Plan against. These groups can be created to hold whatever assets you require and the use of groupings is an extremely powerful feature of Ops Center. 

And once again look for and select the "Execute Operation" action.

And you will see your Operational Plan run against multiple targets. In this case, it is 2 targets but it could be as easily 2,000 targets that you have just updated, configured or controlled with just a few mouse clicks.

So we have covered how to run Operational Plans against a single target or a group of many targets, but what if you wanted to run your Operational Plan against a number of single hosts that you have not put into a group or a number of groups or a mixture of both? This can easily be done. We just start the selection from the Operational Plan perspective instead of the target perspective. The first step is to select "Plan Management" from the "Navigation" panel, then "Operational Plans" from within the "Plan Management" panel. Highlighting the Operational Plan you want to run will enable the icons in the middle panel.

Selecting the icon with the green tick will launch the "Select Target Assets" wizard.

Here it is just a matter of selecting any individual targets or groups of targets that you want to run your Operational Plan against, by clicking "Add to Target List", and then clicking "Next".

And fill in the Operational Plan variables as you usually would.

I hope this has given you more ways to launch your Operational Plans, whether it be for a single target, 2,000 targets or even more.



Monday Jun 03, 2013

Operational Plans - Recording user input to a log file using Oracle Enterprise Manager Ops Center 12c

Oracle Enterprise Manager Ops Center - Operational Plans - Tricks and Tips #1

This is the first of a series of blogs pointing out some tricks and tips in the use of Operational Plans in Oracle Enterprise Manager Ops Center.

Ops Center Operational Plans, as you may or may not know, allow you to run scripts and prompt the user for values for variables at run time.

In the above case, with one value, you may think this is a trivial thing, but unless your script outputs the variable to standard out or standard error, so that it get captured in the Ops Center job log, you have no historical record of what the user entered. You should log the user input, whether it is just for the record or as an audit trail or to use as a debugging tool. You could always echo each variable you request out to the log file, but what is the chance that you will forget one? The easiest way to display every variable is to include the "env" command into your script.

This has the advantage that you log, not only the user entered variables, but shell environments of the target server that you are running on, as I am sure that on the 1000 servers you administer, no one has ever change the PATH variable without you knowing it.

While adding "env " is enough, I have included a slightly nicer formatted module:

Log_Env () 
# Log shell environment for the record
# Usage: Log_Env
# This is really useful if you need to check the values entered as run-time into the operational plan.
echo "INFO: Dumping the shell environment for the record..... [****Start****]"
echo "INFO: Dumping the shell environment for the record..... [**** End ****]"

Command ()
echo "INFO: Doing nothing as this is a test"

## Main ##
Command   # Do the rest of your script here

I log the shell environment to standard out as it works for me, but as it has been pointed out to me that you could keep the script output logging to standard out and log diagnostic information like the "env" command, output could be logged to standard error. It is a simple change to the above script and I am still of two minds as to which is best, so choose whichever option (STDERR/STDOUT) suits you best.

So to see the script working:

First, load the Op Plan into your EC. Give it a name and select a target type (Operating Systems in this case).

Load or cut and paste the script in.

Define some variables (These are examples, just for testing).

Review the summary page and click finish in the wizard.

So we have our Operational Plan - Sample_Env_Script.

Then, let's run it on a couple of hosts:

I have chosen a group called "ProxyControllers" which has two hosts in it. 

Fill in some values in the Additional Environment Variables fields.

Schedule the job.

Review the summary and apply.

 Looking at the job output:

We see it has been successful on both hosts.

Clicking on a host, we can go into the job detail for each host. And there for all to see, recorded as part of the job log, is the values that the user inputted at run-time and the shell environment the script ran in. Both are great things to have if you ever have to debug one of your Op Plans.

If you click the export button and select full job log, you can see the job output for all the hosts that were part of the job. This is sometimes easier than clicking into each host.

Of course the full log can be saved to do with what you will.

I hope that this little tip helps you get more use out of Ops Center Operational Plans.




Latest information on Oracle Enterprise Manager and Oracle Management Cloud.

Related Blogs


« June 2013 »