Database Reference
In-Depth Information
[oracle ~]$ emcli @targets2.py
Target: oraoem1.example.com
Target: oraoem1.example.com:3872
Target: oms12c1_3_oraoem1
Task: Using Blackouts
Attempting to schedule blackouts to coincide with maintenance tasks on a target host can produce false-positive
alerts. This can happen when a blackout finishes prior to a maintenance activity or when a maintenance activity
starts prior to a blackout. Both of these scenarios can be avoided by having the maintenance job itself start and stop
the blackout.
Both EMCTL and EM CLI are capable of creating, deleting, starting, and stopping blackouts. However, EMCTL
is only capable of managing blackouts for the targets local to the agent host from which it is executed, and EMCTL
commands will only work if the agent is running. The limitations of setting blackouts with EMCTL are restrictive and
prone to error. It is recommended to use EM CLI to set blackouts from maintenance jobs.
It is usually not necessary to use scripting mode for blackout activities since most maintenance scripts run in
a shell script. The
create_blackout
verb requires four arguments:
name, add_targets, schedule
and
reason
. The
job is identified by the
name
parameter, which means it must be unique to all other jobs in EM. Listing 3-16 shows
an example of using EM CLI in command-line mode to set a blackout called “Blackout1” for the “
em12cr3.example.com
”
host. This blackout will not repeat and will last for three hours or until it is stopped. The reason the blackout has been
set is for “Testing.”
Listing 3-16.
Set a blackout called “Blackout1” for the “
em12cr3.example.com
” host
[oracle ~]$ emcli create_blackout -name='Blackout1' \
-add_targets='em12cr3.example.com:host' \
-schedule='frequency:once;duration:3' \
-reason='Testing'
The
get_blackouts
verb will show the details of all of the blackouts that are currently defined, as shown in
Listing 3-17.
Listing 3-17.
List all blackouts
[oracle ~]$ emcli get_blackouts
Name Created By Status Status ID Next Start Duration Reason Frequency
Blackout1 SYSMAN Scheduled 0 2435-07-24 17:17:56 03:00 Testing once
Repeat Start Time End Time Previous End TZ Region TZ Offset
none 2000-07-24 17:17:56 2000-07-24 20:17:56 none America/Chicago +00:00
The following example uses the
noheader
and
script
parameters to change the output of
get_blackouts
to be
easily parsed. Piping the output to the
cut
command displays only the first field, which is the blackout name field.
[oracle ~]$ emcli get_blackouts -noheader -script | cut -f1
Blackout1
Search WWH ::
Custom Search