0% found this document useful (0 votes)
12 views

netcool

netcool

Uploaded by

abhilash.hope
Copyright
© © All Rights Reserved
Available Formats
Download as PPS, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

netcool

netcool

Uploaded by

abhilash.hope
Copyright
© © All Rights Reserved
Available Formats
Download as PPS, PDF, TXT or read online on Scribd
You are on page 1/ 33

Unit 6: Tools and Automations

© 2010 IBM Corporation


IBM Software Group Tivoli software

Objectives

Upon completion of this unit, you will be able to:


• Describe the types of desktop tools
• Create a simple desktop tool and add it to a menu
• Create a journal entry every time the tool is used
• Describe how trigger groups are used
• Describe the types of triggers
• Describe the functional elements of a trigger
• Use the ObjectServer configuration utility to modify trigger
definitions
• Understand best practices regarding trigger configurations

2
IBM Software Group Tivoli software

Tools

A Tool is invoked by a user calling an item from a menu and can:

• execute SQL on the ObjectServer


• execute a command on the desktop of the user

3
IBM Software Group Tivoli software

Menus

4
IBM Software Group Tivoli software

A Simple Command Line Tool (1 of 2)

From the Configuration GUI:

• Open Menu
• Click on Menus
• Select Main Event List Menu
• Right-click and Select Add Item

From the Add Menu Item sub-GUI:


• Check that Menu Item Type
is set to Tools
• Click the Add New Tool button

5
IBM Software Group Tivoli software

A Simple Command Line Tool (2 of 2)


From the Add Tool GUI:

• Name your tool: Color

• Select the Executable tab

• Check: Enabled
Redirect Output
Redirect Errors

• In the Executable Commands window, type:


echo ORANGE (for a desktop running on UNIX)

echo ORANGE
pause (for a desktop running on Windows)

6
IBM Software Group Tivoli software

Testing the Tool

From the Main Event List (monitor box) GUI:

• Select: File > Resync > All

• Select: Tools > Color

• Observe the function of your


tool in the output window

7
IBM Software Group Tivoli software

SQL Tools
• SQL tools modify ObjectServer via SQL commands
• Tools on the Alerts menu can reference and modify selected
events.

8
IBM Software Group Tivoli software

Journal and Access Tabs


The Journal tab sets Journal text:

• Used only on alerts menu tools.


• Execute for each, adds journal
entry to all selected events.
• Force, allows user to add/modify
journal entry.

The Access tab sets permissions:


• For alerts menu tools, if the class of
the selected event is not checked
tool is grayed out.
• For all tools, if user does not belong
to a checked group, tool will not
appear.

9
IBM Software Group Tivoli software

Platform and Description Tabs


The Platform tab sets tool architecture:

• Tools will only appear in desktops


running on checked platforms

The Description tab documents:

• Description tab text is stored in


the table where the tool is
defined

10
IBM Software Group Tivoli software

Changes in multiple events


• same change: uncheck and use:
where Serial in ( $selected_rows.Serial ); flush iduc;

• Example: Change Class field multiple events:

update alerts.status set Grade = 1234 where


Serial in($selected_rows.Serial); flush iduc;

• different change: check and use:


via '@Identifier'

• Example: Copy Severity to Grade in each selected event:


update alerts.status via '@Identifier' set
Grade = @Severity; flush iduc;

11
IBM Software Group Tivoli software

Elements and Interactive tools


Elements available to tools:
Internal variables, internal to the ObjectServer
%server, %username, %password, …
Environment Variables, defined on platform
$OMNIHOME, $NCLICENSE, …
Field Values, fields from the event
@Node, @Summary, @Department

UNIX commands run from Tools display output in an output-only


window when redirect output is checked, but cannot accept
keyboard input. Use xterm -e to run commands in a Xterm
window:
xterm -e telnet $prompt.Hostname
• De-select Redirect Output/Errors options when using xterm.

12
IBM Software Group Tivoli software

Event Deletion Option


• Events deleted via the desktop are permanently removed
• There is no un-delete option
• Many users are uncomfortable with this feature
• Do not want events deleted inadvertently
• Do want users to have the capability to remove events as necessary
• A possible solution
• Place all normal users in a specific group
• Change the existing Delete tool
• Remove the new group from the access list
• Tool will no longer appear in the desktop for the normal users
• Use the Grade field in the ObjectServer to flag deleted events
• Add a restriction filter using this field to the new user group
• Create a new delete tool that updates this field
• Limit access to just the new group

13
IBM Software Group Tivoli software

Student Exercise: 6-1

14
IBM Software Group Tivoli software

Trigger Groups

Trigger Group membership


set in Trigger GUI

• Trigger Groups allow management of multiple Triggers

• Each Trigger must belong to only one Trigger Group


(but can be moved between Groups)

• A Trigger Group can only be deleted if empty

15
IBM Software Group Tivoli software

Triggers (Automations)

Triggers allow you to:

• Automatically manage
events
• Perform escalation
• Perform correlation
• Perform external
commands

In Configuration Manager select


Automations, then Triggers Tab

16
IBM Software Group Tivoli software

How Triggers Work


• Three types of triggers:
• Temporal – execute on a time interval
• Database – executes on a database condition
• Signal – executes on a System or User defined signal

• All triggers have these fields:


• Settings – sets condition under which trigger executes
(time interval, database action, receipt of signal)
• When – determines if the action should be executed now
• Evaluate – builds a read-only temporary table
(Signal and Temporal Triggers only)
• Action – determines what is actually done
• Comment – for documentation

17
IBM Software Group Tivoli software

Temporal Triggers

Define
Period

18
IBM Software Group Tivoli software

Example Temporal Trigger


delete_clears trigger
SETTINGS every 1 minute

WHEN [ not used ]

EVALUATE [ not used ]

ACTION begin
delete from alerts.status
where Severity = 0 and
StateChange < (getdate() - 120);
end

COMMENT Delete clear alerts over 2 minutes old in


ALERTS.STATUS every 60 seconds

19
IBM Software Group Tivoli software

Database Triggers

Database/
Table Name

Pre/Post
Action Database
Operation

Apply to
Row/
Statement

20
IBM Software Group Tivoli software

Example Database Trigger


deduplication trigger
SETTINGS before a reinsert action into alerts.status
WHEN [ not used ]

ACTION begin
set old.Tally = old.Tally + 1;
set old.LastOccurrence = new.LastOccurrence;
set old.StateChange = getdate();
set old.InternalLast = getdate();
set old.Summary = new.Summary;
set old.AlertKey = new.AlertKey;
if ((old.Severity = 0)and(new.Severity > 0))
then
setold.Severity = new.Severity;
end if;
end

COMMENT Deduplication processing for ALERTS.STATUS

21
IBM Software Group Tivoli software

Signal Triggers

Two Types of Signals:


System Signals
Indicate ObjectServer changes:
Startup, Connections, and others.

User Signals
User-created, raised via SQL.
Allow multiple Actions against one
Trigger

Define
Signal

22
IBM Software Group Tivoli software

Example Signal Trigger


connection_watch_connect trigger
SETTINGS Trigger on a connect signal
WHEN [ not used ]
EVALUATE [ not used ]
ACTION
begin
if( %signal.description = '' ) then
insert into alerts.status (Identifier, Summary, … OwnerUID)
values (%signal.process+'@'+%signal.node+' connected '+
to_char(%signal.at), … 65534);
else
insert into alerts.status (Identifier, Summary, … OwnerUID)
values (%signal.process+':'+%signal.description+'@'+%signal.node+
'connected '+to_char(%signal.at), … 65534);
end if;
end

COMMENT Create an alert when a new client connects

23
IBM Software Group Tivoli software

User Defined Signals

Unique
Name
Signal
Description

Define
Define Data Type
Parameters
(optional)

24
IBM Software Group Tivoli software

Event Correlation
done via the generic_clear trigger
• Correlate problem (Type = 1) events with resolution (Type = 2) events

• Ensure that both events are from the same

• Node - using Node field


• Interface - using AlertKey field
• Category - using AlertGroup field
• Probe - using Manager field

• Correlation also must check in both events

• Problem or Resolution - using Type field


• Time Relationship - using LastOccurrence field
• Severity - using Severity field

25
IBM Software Group Tivoli software

Automation / Trigger Notes


• In a where clause, compare integers first, then characters.
Leave intensive comparisons - regular expressions - for last.
• Ensure Trigger does not catch events already managed.
(important for external scripts)
• Stagger Trigger priorities so they do not all run at once.
• Add a description for all Automations.
• OMNIbus ships with standard Triggers that can be changed to meet customer
needs.

CAUTION: Shipped Automations can be modified, but changes can affect the running
of the ObjectServer.

26
IBM Software Group Tivoli software

Procedure
• Executable code called to perform common operations
• SQL procedures manipulate data in an ObjectServer database
• External procedures run an executable on a remote system
• Procedures can be called from nco_sql, a trigger, or a tool.
• Syntax:
{EXECUTE|CALL} [ PROCEDURE ] procedure_name(expr,...);
• Example:
EXECUTE PROCEDURE myproc();
or with parameters:
EXECUTE PROCEDURE myproc(“text”,@Node);
IBM Software Group Tivoli software

Creating SQL Procedures

Procedure
Name

Parameters to
pass to procedure

Procedure
Action

28
IBM Software Group Tivoli software

SQL Procedures
• An SQL procedure is SQL commands, code, and procedural
constructs to perform complex tasks on database objects.
• The body of a procedure is enclosed by begin and end
• Each statement except the last must end with a semi-colon
• A body statement can contain SQL Commands:
• ALTER SYSTEM BACKUP, ALTER SYSTEM SET, ALTER SYSTEM DROP
CONNECTION
• ALTER TRIGGER, ALTER TRIGGER GROUP, ALTER USER
• UPDATE, INSERT, DELETE
• WRITE INTO, RAISE SIGNAL, {EXECUTE|CALL} PROCEDURE

• Programming constructs:
SET writes the value of an expression to a variable or parameter.
IF THEN ELSE - performs actions based on a specified condition.
CASE WHEN - tests conditions, performs actions based on tests.
FOR EACH ROW - loops a set of rows while a condition matches.
FOR - performs actions a number of times, based on a counter variable.
Break - statement in action command list will exit loop
Cancel - statement in action command list will stop procedure
CAUTION: Do not create circular constructs.
IBM Software Group Tivoli software

External Procedures

Procedure
Name Procedure
Parameters

Executable
Script (full path)

Host to
execute on
Script
Arguments
User/Group
details

30
IBM Software Group Tivoli software

Journal Entry by Automations


• Create a Journal entry in a Trigger using the Stored Procedure -
JINSERT
call jinsert( old.Serial, %user.user_id, getdate, 'This is my
journal entry');
• Must change old.Serial to whatever is appropriate

• Example using mail_on_critical trigger


begin
for each row critical in criticals
begin
execute send_email( critical.Node, critical.Severity,
'Netcool Email', 'root@localhost', critical.Summary,
'localhost');

update alerts.status via critical.Identifier set


Grade=2;
call jinsert( critical.Serial, %user.user_id, getdate,
'Email sent via mail_on_critical Automation');
end;
end

31
IBM Software Group Tivoli software

Student Exercise: 6-2

32
IBM Software Group Tivoli software

Summary

You should now be able to:


• Describe the types of desktop tools
• Create a simple desktop tool and add it to a menu
• Create a journal entry every time the tool is used
• Describe how trigger groups are used
• Describe the types of triggers
• Describe the functional elements of a trigger
• Use the ObjectServer configuration utility to modify trigger
definitions
• Understand best practices regarding trigger configurations

33

You might also like