Monday, March 18, 2013

Accessing OEM(Oracle Enterprise Manager) from Command Line using EMClient Kit

This post is all about the tool called Enterprise Manager Command Line Interface (EMCLI).
What is Enterprise Manager Command Line Interface (EM CLI) ?
The Enterprise Manager Command Line Interface (EM CLI) enables you to access Enterprise Manager Cloud Control functionality from text-based consoles (shells and command windows) for a variety of operating systems. You can call Enterprise Manager functionality using custom scripts, such as SQL*Plus, OS shell, Perl, or Tcl, thus easily integrating Enterprise Manager functionality with a company’s business process.
image
What are the things that we can do with the use of EM CLI ?

-> Monitoring and Managing Targets.
-> Monitoring and Managing Jobs.
-> Monitoring and Managing Groups.
-> Monitoring and Managing Blackouts.
Using this fourth option , we can creating a shell script which will create a blackout period for certain amount of time.
We can make a call to this shell script before doing any deployment.
First Script in EMCLI:
[thiru@localhost emclikit]$ cat create_blackout_period_dev.sh

#Program Name:create_blackout_period_dev.sh

#Purpose: Create Blackout period from Command Line

./emcli create_blackout 
-name=devblackout 
-add_targets="/dev/dev_bh_cluster:weblogic_cluster;/dev/dev_onl_cluster:weblogic_cluster" 
-propagate_targets -schedule="duration::120" 
-reason="Deployment"

Screenshot of OEM dev Status:

image
So the Command execute from command line worked as expected.
To know about it more refer the following documentation.

http://docs.oracle.com/cd/E24628_01/em.121/e27046/emcli.htm

No comments:

Post a Comment