Professional Documents
Culture Documents
Version 4.0
IBM
Solutions Guide
frontmatter.fm November 30, 2006
Note Before using this information and the product it supports, read the information in Appendix B. "Notices" on page 227.
First Edition (December 1, 2006) This edition applies to version 4.0 of Netcool/Impact and to all subsequent releases and modifications until otherwise indicated in new editions. Copyright International Business Machines Corporation, 2006. All rights reserved. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
About this guide . . . . . . . . . . . . . . . . . . . . . . . . . . . xi Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xii Typographical notation . . . . . . . . . . . . . . . . . . . . .xii Note, Tip, and Warning information . . . . . . xiii Syntax and Sample subheadings. . . . . . . . . . xiv Associated publications . . . . . . . . . . . . . . . . . . . . xiv Netcool/Impact Administration Guide . . . . .xv Netcool/Impact User Interface Guide . . . . . .xv Netcool/Impact Policy Reference Guide . . . .xv Netcool/Impact DSA Reference Guide . . . . .xv Netcool/Impact Online Help. . . . . . . . . . . . . .xv Netcool/Impact Release Notes . . . . . . . . . . . .xv Operating system considerations . . . . . . . . . . . . .xv How to send your comments . . . . . . . . . . . . . . . xvi Data Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Policies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Solution Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Event Enrichment . . . . . . . . . . . . . . . . . . . . . . . 13 X Events in Y Time . . . . . . . . . . . . . . . . . . . . . . 13 Event Notification . . . . . . . . . . . . . . . . . . . . . . . 14 Event Gateway . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Setting Up a Solution . . . . . . . . . . . . . . . . . . . . . . . 14 Creating a Data Model . . . . . . . . . . . . . . . . . . . 15 Setting Up Services . . . . . . . . . . . . . . . . . . . . . . 15 Creating Policies . . . . . . . . . . . . . . . . . . . . . . . . 15 Running a Solution . . . . . . . . . . . . . . . . . . . . . . . . . 15
Creating Data Sources . . . . . . . . . . . . . . . . . . . 25 Creating Data Types. . . . . . . . . . . . . . . . . . . . . 25 Creating Data Items . . . . . . . . . . . . . . . . . . . . . 26 Creating Links . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Creating Event Sources . . . . . . . . . . . . . . . . . . 26
Display Name . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Data Type Keys. . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Setting Up Data Types. . . . . . . . . . . . . . . . . . . . . . 38 Getting the Name of the Structural Element 38 Creating an Internal Data Type . . . . . . . . . . . 39 Creating an SQL Database Data Type . . . . . . 41 Creating an LDAP Data Type . . . . . . . . . . . . . 46 Creating a Mediator Data Type . . . . . . . . . . . 48 Data Type Caching. . . . . . . . . . . . . . . . . . . . . . . . . 48 Data Caching . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Query Caching . . . . . . . . . . . . . . . . . . . . . . . . . 50 Count Caching. . . . . . . . . . . . . . . . . . . . . . . . . . 51
iv
Event Source Architecture . . . . . . . . . . . . . . . . . . . 66 Setting Up Event Sources. . . . . . . . . . . . . . . . . . . . 66 Setting Up ObjectServer Event Sources . . . . . 67 Setting Up Non-ObjectServer Event Sources 69
Startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 Event Polling . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 Event Querying . . . . . . . . . . . . . . . . . . . . . . . . .80 Delete Notification. . . . . . . . . . . . . . . . . . . . . . . 80 Event Queuing . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Event Reader Configuration . . . . . . . . . . . . . . . . . 81 Event Reader Name. . . . . . . . . . . . . . . . . . . . . . 81 ObjectServer Event Source . . . . . . . . . . . . . . . . 81 Polling Interval. . . . . . . . . . . . . . . . . . . . . . . . . . 81 Event Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 Event Mapping. . . . . . . . . . . . . . . . . . . . . . . . . . 82 Event Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Setting Up Event Readers . . . . . . . . . . . . . . . . . . . 83
Chapter 8. Services . . . . . . . . . . . . . . . . . . 71
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 How Do I Use This Part of the Guide? . . . . . . . . 71 About Services. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 What Are Services? . . . . . . . . . . . . . . . . . . . . . . 72 What Are the Service Types? . . . . . . . . . . . . . . 72 What Do I Do with Services? . . . . . . . . . . . . . . 73 How Do I Set Up Services?. . . . . . . . . . . . . . . . 73 Service Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 Event Readers. . . . . . . . . . . . . . . . . . . . . . . . . . . 73 Event Listeners. . . . . . . . . . . . . . . . . . . . . . . . . . 74 E-Mail Sender. . . . . . . . . . . . . . . . . . . . . . . . . . . 74 Policy Activators . . . . . . . . . . . . . . . . . . . . . . . . 74 Hibernating Policy Activator. . . . . . . . . . . . . . 74 Event Processor . . . . . . . . . . . . . . . . . . . . . . . . . 74 Policy Logger . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 Command Line Manager Service . . . . . . . . . . 74 CORBA Name Service . . . . . . . . . . . . . . . . . . . 75 Setting Up Services . . . . . . . . . . . . . . . . . . . . . . . . . 75 Configuring Pre-Defined Services . . . . . . . . . 75 Creating and Configuring User-Defined Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
What Is the Database Listener?. . . . . . . . . . . . 95 What Is the Database Client? . . . . . . . . . . . . . 96 What Are Database Events? . . . . . . . . . . . . . . 96 How Do I Set Up the Database Server? . . . . . 96 How Do I Set Up the Database Listener? . . . 96 How Do I Write Database Listener Policies? 96 Setting Up the Database Server . . . . . . . . . . . . . . 96 Copying the Client Tar File to the Oracle System 97 Editing the Nameserver Properties File . . . . 97 Editing the Listener Properties File . . . . . . . . 98 Installing the Client Files Into Oracle . . . . . . 99 Granting Database Permissions . . . . . . . . . . 100 Setting Up the Database Listener. . . . . . . . . . . . 100 Sending Database Events . . . . . . . . . . . . . . . . . . 101 Creating the Call Spec . . . . . . . . . . . . . . . . . . 101 Creating Triggers . . . . . . . . . . . . . . . . . . . . . . 102 DDL Events . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 System Events . . . . . . . . . . . . . . . . . . . . . . . . . 106 User Events . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 Writing Database Event Policies . . . . . . . . . . . . 108 Handling Incoming Database Events . . . . . 108 Returning Events to the Database . . . . . . . . 109 Example Triggers . . . . . . . . . . . . . . . . . . . . . . . . . 111 Insert Event . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 Update Event. . . . . . . . . . . . . . . . . . . . . . . . . . 112 Delete Event. . . . . . . . . . . . . . . . . . . . . . . . . . . 113 Before Create Event . . . . . . . . . . . . . . . . . . . . 114 After Create Event . . . . . . . . . . . . . . . . . . . . . 115 Before Alter Event. . . . . . . . . . . . . . . . . . . . . . 115 After Alter Event. . . . . . . . . . . . . . . . . . . . . . . 116 Before Drop Event . . . . . . . . . . . . . . . . . . . . . 116 After Drop Event. . . . . . . . . . . . . . . . . . . . . . . 117 Server Startup Event. . . . . . . . . . . . . . . . . . . . 117 Server Shutdown Event . . . . . . . . . . . . . . . . . 118 Server Error Event . . . . . . . . . . . . . . . . . . . . . 118 Logon Event. . . . . . . . . . . . . . . . . . . . . . . . . . . 119 Logoff Event . . . . . . . . . . . . . . . . . . . . . . . . . . 119
About Policy Activators . . . . . . . . . . . . . . . . . . . 121 What Are Policy Activators? . . . . . . . . . . . . . 121 How Do Policy Activators Work? . . . . . . . . 121 How Do I Use Policy Activators? . . . . . . . . . 121 How Do I Set Up Policy Activators? . . . . . . 121 How Do I Manage Policy Activators? . . . . . 122 Policy Activator Configuration . . . . . . . . . . . . . 122 Policy Activator Name . . . . . . . . . . . . . . . . . . 122 Activation Interval . . . . . . . . . . . . . . . . . . . . . 122 Policy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 Startup and Logging Options . . . . . . . . . . . . 122 Setting Up Policy Activators. . . . . . . . . . . . . . . . 123
Before You Begin. . . . . . . . . . . . . . . . . . . . . . . . . . 135 Policy Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 Policy Context . . . . . . . . . . . . . . . . . . . . . . . . . 136 Policy Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 Printing to the Policy Log. . . . . . . . . . . . . . . . 137 User-Defined Variables. . . . . . . . . . . . . . . . . . 138 Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 Contexts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 If Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 While Statements . . . . . . . . . . . . . . . . . . . . . . . 141 Action Functions . . . . . . . . . . . . . . . . . . . . . . . 143 Parser Functions . . . . . . . . . . . . . . . . . . . . . . . 144 User-Defined Functions . . . . . . . . . . . . . . . . . 144
Populating the Event Fields . . . . . . . . . . . . . .152 Adding a Journal Entry. . . . . . . . . . . . . . . . . .152 Sending the Event to the Event Source. . . . .152 Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .153 Deleting Events . . . . . . . . . . . . . . . . . . . . . . . . . . .153 Setting the DeleteEvent Variable. . . . . . . . . .153 Sending the Event to the Event Source. . . . .153 Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .154
Adding the Data Item. . . . . . . . . . . . . . . . . . . 167 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 Updating Data . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 Updating Single Data Items . . . . . . . . . . . . . 168 Updating Multiple Data Items . . . . . . . . . . . 169 Deleting Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 Deleting Single Data Items . . . . . . . . . . . . . . 170 Deleting Multiple Data Items . . . . . . . . . . . . 171 Calling Database Functions . . . . . . . . . . . . . . . . 173 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
What Is Netcool/Impact IM? . . . . . . . . . . . . 183 What Are the Netcool/Impact IM Components? 184 How Does Netcool/Impact IM Work? . . . . 184 How Do I Set Up Netcool/Impact IM? . . . . 184 Writing Instant Messaging Policies . . . . . . . . . . 184 Handling Incoming Messages. . . . . . . . . . . . 185 Sending Messages . . . . . . . . . . . . . . . . . . . . . . 185 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
viii
Finding the Length of an Array. . . . . . . . . . . 197 Finding the Distinct Values in an Array . . . 197
Reviewing the Data Model. . . . . . . . . . . . . . .212 Setting Up Services . . . . . . . . . . . . . . . . . . . . . . . .212 Creating the Event Reader . . . . . . . . . . . . . . .212 Reviewing the Services . . . . . . . . . . . . . . . . . .214 Writing the Policy . . . . . . . . . . . . . . . . . . . . . . . . .214 Looking Up Device Information . . . . . . . . . .215 Adding Device Information to the Journal .215 Looking Up Business Departments . . . . . . .216 Increasing the Alert Severity . . . . . . . . . . . . .217 Reviewing the Policy. . . . . . . . . . . . . . . . . . . .218 Running the Solution . . . . . . . . . . . . . . . . . . . . . .219
ix
Preface
This preface contains the following sections: "Audience" on page xviii "About this guide" on page xvii "Associated publications" on page xx "Typographical notation" on page xviii "Operating system considerations" on page xxi
Preface xvii
Chapter 21. "Handling Strings and Arrays" on page 199 Chapter 22. "Event Enrichment Tutorial" on page 205
Audience
This guide contains information on implementing Netcool/Impact in your environment. It contains information on setting up a data model, working with services and developing policies. This guide is intended for Netcool/Impact administrators and for other users who are responsible for implementing Netcool/Impact.
Typographical notation
Table 1 shows the typographical notation and conventions used to describe commands, SQL syntax, and graphical user interface (GUI) features. This notation is used throughout this book and other Netcool publications.
Table 1. Typographical Notation and Conventions (1 of 2) Example Monospac e Description The following are described in a monospace font: Commands and command line options Screen representations Source code Object names Program names SQL syntax elements File, path, and directory names Values Italicized monospace text indicates a variable that the user must populate. For example, -password password. Bold The following application characteristics are described in a bold font style: Buttons Note: Text in the pop-up tooltips is used to name buttons with icons. These button names are described in plain text. Frames Text fields Menu entries A bold arrow symbol indicates a menu entry selection. For example, FileSave.
Table 1. Typographical Notation and Conventions (2 of 2) Example Italic Description The following are described in an italic font style: An application window name; for example, the Login window Information that the user must enter The introduction of a new term or definition Emphasized text References to external documents [1] Code or command examples are occasionally prefixed with a line number in square brackets. For example: [1] First command... [2] Second command... [3] Third command... { a | b } [ ] | ... ,... In SQL syntax notation, curly brackets enclose two or more required alternative choices, separated by vertical bars. In SQL syntax notation, square brackets indicate an optional element or clause. Multiple elements or clauses are separated by vertical bars. In SQL syntax notation, vertical bars separate two or more alternative syntax elements. In SQL syntax notation, ellipses indicate that the preceding element can be repeated. The repetition is unlimited unless otherwise indicated. In SQL syntax notation, ellipses preceded by a comma indicate that the preceding element can be repeated, with each repeated element separated from the last by a comma. The repetition is unlimited unless otherwise indicated. In SQL syntax notation, an underlined element indicates a default option. In SQL syntax notation, parentheses appearing within the statement syntax are part of the syntax and should be typed as shown unless otherwise indicated.
a ( )
Many Netcool commands have one or more command line options that can be specified following a hyphen (-). Command line options can be string, integer, or BOOLEAN types: A string can contain alphanumeric characters. If the string has spaces in it, enclose it in quotation (") marks. An integer must contain a positive whole number or zero (0). A BOOLEAN must be set to TRUE or FALSE.
SQL keywords are not case-sensitive, and may appear in uppercase, lowercase, or mixed case. Names of ObjectServer objects and identifiers are case-sensitive.
Note: Note is used for extra information about the feature or operation that is being described. Essentially, this is for extra data that is important but not vital to the user. Tip: Tip is used for additional information that might be useful for the user. For example, when describing an installation process, there might be a shortcut that could be used instead of following the standard installation instructions.
Attention: Attention is used for highlighting vital instructions, cautions, or critical information. Pay close attention to this information, as it is vital to the successful use of IBMs products.
Syntax:
Syntax subheadings contain examples of ObjectServer SQL syntax commands and their usage. For example:
CREATE DATABASE database_name;
Sample:
Sample subheadings describe typical or generic scenarios, or samples of code. For example:
[1] [2] [3] [4] [5] [6] <body> <img src="ChartView?template=barchart&format=PNG &request=image&chart=quote&width=800&height=400" border="0" height="400" width="800" alt="Events by Severity" > </body>
Associated publications
Netcool/Impact 4.0 provides the following additional documentation: Netcool/Impact Administration Guide Netcool/Impact User Interface Guide Netcool/Impact Policy Reference Guide Netcool/Impact DSA Reference Guide Netcool/Impact Online Help Netcool/Impact Release Notes
xx
Preface
xxi
What Is Netcool/Impact?
Netcool/Impact is a set of runnable server components that work together to provide event management and integration functionality for the Netcool suite of products.
Modeling Data
Modeling data is the task in which you create an abstract representation of the business data and metadata that you want to use with Netcool/Impact. This task requires you to be able to identify and locate physical sources of data in your environment and to create a representation of this data.
Configuring Services
Configuring services is the development task in which you set up the runnable sub-components of the Netcool/Impact Server to perform such operations as monitoring an ObjectServer for events, or triggering the execution of a policy at timed intervals.
Writing Policies
Writing policies is the task in which you define the operations that you want to automate with Netcool/Impact. You write policies using the Netcool/Impact policy scripting language and then configure Netcool/Impact to run them when certain conditions occur in your environment.
Automation
In a general sense, automation is Netcool/Impacts most important feature. The essence of Netcool/Impact is its ability to automate event management tasks that you would otherwise have to accomplish manually, or would not be able to accomplish at all. These tasks, which include event monitoring, event enrichment and event notification, are discussed in the next section of this chapter. Automation, however, is really the foundation of what Netcool/Impact does. Automation is the act of setting up a task so that it is performed automatically at certain times or when certain conditions are met. For example, you can set a wristwatch to beep once per hour, or once per day at a certain hour. You might also be able to set a more advanced wristwatch to monitor your calendar and beep at different times of the day to notify you when meetings or other appointments are about to occur. In this case, the benefit
of automation is that it saves you the time and effort involved in performing a routine task over and over. In the wristwatch example, you are saved the time and effort of constantly looking at your watch to check the time, or having to continually refer to a calendar to see when your next meeting begins. A more complicated example of automation is the factory assembly line. As items move down the assembly line, operations must be performed on them in order for the products to be finished. In some situations, these operations are performed by human workers, who each complete a designated action and pass the items down the line to the next person. This might be effective for a small factory making simple objects with a small number of users. However, the larger the number of workers you have and the more complicated the operations, the higher the risk of error is. In addition, the more items you need to produce, the faster the operations must be accomplished. At some point, the human workers cannot work fast or well enough. In the assembly line, automation comes in where you want to take some of the routine, repeatable parts of the process and set up them up so that they are performed automatically with a minimum of human intervention. For example, you might add various clocks, machines and monitors to the process, or even intelligent robots that can perform some operations previously accomplished by human workers. A Netcool operations environment is, in some ways, like a factory assembly line. Instead of items moving down a conveyer belt, however, you have Netcool alerts. In a purely manual environment, network operators process each alert by hand. As they appear in the event list, the operators must acknowledge them, investigate them, notify other personnel that they have occurred and perform a variety of other tasks like creating new trouble tickets or work orders in other applications. Finally, when the alert condition is resolved, the operator must delete the alerts out of the event list. For a small network of a few devices and one or two operators, manual processing of events might be satisfactory. As with the assembly line, however, the more alerts you have and the more complicated the operator response, the more difficult and costly it is to manage the operation on a manual basis. Like the assembly line, the network operations environment can benefit from automating certain processes. For example, tasks like notifying technicians or system administrators when an alert reaches a certain severity, or updating an event to include related business data can require time and effort on the part of one or more network operators. If you automate these processes, the operators can spend time on higher-priority tasks or be redeployed to other roles in the business. This translates into an event management environment that is less costly than a manual one and less prone to human error. The framework that Netcool/Impact provides for automations consists of the policy engine, the policy scripting language and various triggers that you can use to "program" Netcool/Impact to start the policies under different conditions. The policy engine is the feature of Netcool/Impact that performs the tasks you want to automate. These tasks are specified the policy scripting language, which is a programming language similar in syntax to C/C++ and Java.
Event Access
After automation, event access is the next most important feature of Netcool/Impact. Event access is the feature that allows Netcool/Impact to tap into the event stream that flows from Netcool probes and monitors into the Netcool/OMNIbus ObjectServer. This feature is an essential part of most implementations of the product. In order to see how and why event access is important, you must first understand the Netcool event stream and how it is generated. The Netcool event stream is the flow of alerts from Netcool probes and monitors into the ObjectServer. Each alert represents some sort of status or activity on the network and can originate from any of hundreds of different kinds of systems, devices or applications. Typically, alerts are designed to inform network operators that a fault condition has occurred somewhere in the environment, but they can be used to communicate other types of status or event information as well. Alerts themselves are generated by software components called probes and monitors, which watch the systems, devices or applications and generate the alerts when various conditions occur. After the probes and monitors generate the alerts, they are sent to the ObjectServer, where they can be viewed by network operators via the Netcool/OMNIbus event list. As noted in the previous section, the network management environment benefits from automated event management tasks. This automation relies on Netcool/Impacts ability to tap into the Netcool event stream. The framework that Netcool/Impact provides for event access consists of three features: the event reader, the event listener and the event processor. These are runnable services that you control from within Netcool/Impact. The event reader works by monitoring an instance of the ObjectServer. When it discovers new and/or updated events, or discovers that an event has been deleted, it takes the event and pulls it back into Netcool/Impact for processing. Similarly, the event listener monitors other, non-ObjectServer sources of events, such as SQL databases. As with the event reader, it takes new and/or updated events when it discovers them and pulls them back to Netcool/Impact. The event processor is responsible for what happens after the events have been retrieved. When you set up an event reader or event listener, you define one or more policies that are to be executed when an event matches a specified criteria. As noted in the previous section, a policy is a set of instructions for Netcool/Impact that specifies the tasks that you want to automate. When coupled with the event reader or event listener, you can use a policy to specify a set of tasks that you want Netcool/Impact to perform automatically when certain kinds of alerts appear in the ObjectServer or other events appear in other event sources. This combination of event access and automation functionality allows you to create a wide variety of event management solutions. These solutions include event enrichment, X events in Y time, event notification and event gateways, as described later in this chapter.
Data Access
Like automation and event access, data access is also an important feature of Netcool/Impact. Data access is the feature that allows Netcool/Impact to connect to external data sources, such as SQL databases and LDAP servers. To understand how this feature is important, you can think about all of the ways you use data that is external to Netcool/OMNIbus in your network management environment. You might have one database that contains network inventory information and another database that contains information on billing and customer service. In addition, you might have an LDAP directory that you use to store information on the company personnel. In an environment without Netcool/Impact, it is possible for network operators to be responsible for manually retrieving data from one or more of these data sources and using that information to deduce the importance of events or to decide how events must be handled. With Netcool/Impact, you can integrate this type of data directly into alerts at the ObjectServer level or use this data to perform various types of analysis on the severity or relevance of individual alerts. The mechanism for accessing data used by Netcool/Impact consists of data source adaptors (DSAs) and Netcool/Impact data models. At the software component level, DSAs provide the means for Netcool/Impact to connect to a wide variety of SQL databases, LDAP servers and other data sources. At the solution level, the data model is an abstract representation of the data in your environment. Netcool/Impact uses the data model within policies when it retrieves, adds, updates and deletes data from the data sources.
Third-Party Integration
The ability to integrate with third-party applications is another important feature of Netcool/Impact. In many network operations environments, you have systems in place that have been created by more than one software provider. For example, in addition to the Netcool suite of products, you might have a separate third-party applications for network inventory management, billing, problem tracking, customer service and the help desk. You might also have messaging systems and other infrastructure software that is not provided by Micromuse. Netcool/Impact provides interfaces to a wide array of such third-party applications, including GE Smallworld, Portal Infranet, TIBCO TIB/Rendezvous and Cramer Dimension. Netcool/Impact can interface with a wide variety of other applications by interfacing directly with their underlying databases.
Pre-Defined Actions
In addition to the features described above, Netcool/Impact allows provides a built-in set of pre-defined actions that you can include among your automated tasks. One of the most important of these is the embedded e-mail client software that you can use to send e-mail notifications to administrators and end-users when faults or other conditions on your network occur. Another important pre-defined action is the ability of Netcool/Impact to execute shell commands, scripts and applications on local and/or remote systems.
Event Enrichment
Event enrichment is the process in which Netcool/Impact monitors an event source for new events, looks up information related to them in an external data source and then adds the information to them. Event enrichment is the one of the most common and valuable things that users do with Netcool/Impact. To understand the value of event enrichment, you must first understand how Netcool probes work and some of their intrinsic limitations. Netcool probes are runnable software components that you install on the devices that they monitor. Of probes and monitors, probes are the most common means for generating alerts in the Netcool event stream. Each probe has a rules file that specifies how the alert data is formatted and sent to the ObjectServer when certain activities or status levels on the device occur. One characteristic of the probe rules file is that it is essentially static. This means that, once you install and configure the probe, the contents of the rules file rarely change. Not only is change rare, but changing the rules file on the fly to adjust to the constantly changing parameters of a network environment would be impossible. As a result, it is difficult to include dynamic information about the network in the contents of alerts generated by probes. Another characteristic of the probes rules file is that, generally, it is best to use an identical copy of the file on every instance of a device that you have in your inventory. For example, if you have dozens of routers in your network, it is most likely that you will want to use the same rules file for each device. This ensures that every probe reports activity or status information to the ObjectServer in the exact same way and eliminates any complications that might occur if each probe was configured differently. Because of this, however, the probes are not able to send alerts to the ObjectServer that contain information specific to the individual device, beyond a few basic parameters like the hostname and IP address. In addition to the limitations given above, the scope of alert data provided by a probe is generally restricted to information that directly describes the alert condition. The probe cannot provide additional information about how the condition affects the network as a whole, or perform any sort of analysis or correlation regarding the alert.
Chapter 1. Getting Started 7
Although these limitations are primarily associated with probes, they exist to some degree with other Netcool components that generate alert data. Event enrichment allows you to bypass these and other limitations by combining the event and data access features of Netcool/Impact. In an event enrichment scenario, Netcool/Impact "catches" new and updated alerts as they are sent to the ObjectServer and then goes to one or more external data sources to correlate information in the alerts with business data. The Netcool/Impact policy language provides the means to intelligently determine which data in your environment is related to the alert and then to add that information to the alert on the fly. The process of event enrichment can be configured to run completely in the background, so that the intervention of Netcool/Impact in the event flow is not noticeable to a network operator. One simple example of event enrichment is an environment where you are managing a network of servers, each of which is used by a different department in the business. In this environment, you use the ping probe to monitor the uptime of the server systems. If a ping does not reach the target system, the probe sends an alert to the ObjectServer that says that the server is not reachable. In an environment without Netcool/Impact, network operators would have to manually look up the business department associated with the server in order to deduce the priority of any incoming alert. They might also have to use a separate calendar or scheduling program to find the on-call administrator responsible for maintaining the system. With Netcool/Impact, you can "catch" each alert as it comes into the ObjectServer, look up the affected business department and automatically adjust the severity of the alert accordingly. In environments with a higher level of complexity and a large number of network devices, systems and applications, the need for event enrichment becomes more critical. This automated process can then be used to supplement Netcool alerts with a wide variety of topological, technical, contact and other information.
X Events in Y Time
X events in Y time is the process in which Netcool/Impact monitors an event source for groups of events that occur together and takes the appropriate action based on the event information. X events in Y time solutions acknowledge the fact that few fault conditions in a network environment occur in a vacuum. When one device fails, for example, it is often possible that other parts of the system will also fail, or that the probe that monitors it will continue to report faults from the device until the problem is resolved. X events in Y time solutions allow you to "program" Netcool/Impact to take action when a group of related events occurs within the same time window. An example of an X events in Y time solution is an environment where you are monitoring a set of telecommunication switches. A potential fault condition exists in the environment where a device will cause an alert to appear multiple times in the same time window as a particular link goes up and down. Taken alone, the fault is a low priority, but if it occurs more than a dozen or so times within the same 5 second period, it indicates a continuing problem that needs to be addressed.
8 Impact Version 4.0 Solutions Guide
Without Netcool/Impact, a network operator might not be able to detect this fault condition by simply monitoring the ObjectServer event list, especially if there are a large number of other devices in the network reporting other status and fault conditions. With Netcool/Impact, you can define a set of operations that you want to take place automatically every time this happens, including increasing the severity of the alert in order to make sure it is detected by network operators.
Event Notification
Event notification is the process in which Netcool/Impact monitors an event source for new events and then notifies an administrator or end users when a certain event or combination of events occurs. Event notification is often part of a more complicated event management automation that includes aspects of Netcool/Impact functionality discussed elsewhere in this section. Netcool/Impact provides a built-in e-mail client that allows you to send mail via any SMTP server. You can use this feature to send mail notifications to administrators and other users, or you can use the remote execution feature provided by the JRExec server to launch an external e-mail program from the command line. You can also use the JRExec server to send notifications via a paging system that provides a command line interface.
Event Gateways
An event gateway is an implementation of Netcool/Impact in which you send event information from the ObjectServer to a third-party application for processing. Because Netcool/Impact can interface with so many different types of databases and other software, you can use Netcool/Impact to build event gateways where that do not otherwise exist as part of the Netcool suite.
10
11
Solution Components
The following are the components of a Netcool/Impact solution: Data model Services Policies
Data Models
A data model is model of the business and meta-data used in a Netcool/Impact solution. A data model consists of the following components: Data sources Data types Data items Links Event sources
Services
Services are runnable subcomponents that you control from within Netcool/Impact. Netcool/Impact provides the following services: Event readers Event listeners E-Mail sender E-Mail readers Policy activators Hibernating policy activator Event processor Policy logger Command line manager service CORBA name service
The most important Netcool/Impact service is the event reader, which you can use to monitor an ObjectServer for new, updated and/or deleted events. The event processor, which processes the events retrieved from the ObjectServer is also important to the function of Netcool/Impact.
12
Policies
A policy is a set of operations that you want Netcool/Impact to perform. These operations are specified using a programming language called the Netcool/Impact policy language, or IPL. The IPL is a scripting language similar in syntax to programming languages like C/C++ and Java. It provides a set of data types, built-in variables, control structures and functions that you can use to perform a wide variety of event management tasks. It also allows you to create your own variables and functions, just as in other programming languages.
Solution Types
You can use Netcool/Impact in a very wide variety ways, depending on the needs of your environment. The following are typical types of Netcool/Impact solutions: Event enrichment X events in Y time Event notification Event gateway
Event Enrichment
Event enrichment is a process in which Netcool/Impact monitors an event source for new events, looks up information related to them in an external data source and then adds the information to them. Event enrichment is the one of the most common and valuable things that users do with Netcool/Impact. An event enrichment solution consists of the following components: A data model that represents the data you want to add to events An event reader service that monitors the event source One or more event enrichment policies that look up information related to the events and add the information to them
For a sample event enrichment solution, see Chapter 22. "Event Enrichment Tutorial" on page 199.
X Events in Y Time
X events in Y time is a process in which Netcool/Impact monitors an event source for groups of events that occur together and takes the appropriate action based on the event information.
13
An X events in Y time solution consists of the following components: A data model that contains internal data types used to store meta-data for the solution An event reader service that monitors the event source The hibernation activator service, which wakes hibernating policies at timed intervals One or more policies that check the event source to see if a specified group of events is occurring and then take the appropriate action
Event Notification
Event notification is a process in which Netcool/Impact monitors an event source for new events and then notifies an administrator or end users when a certain event or combination of events occurs. Event notification is often part of a more complicated event management automation that includes aspects of Netcool/Impact functionality discussed elsewhere in this section. An event notification solution has the following components: An event reader service that monitors the event source An e-mail sender service that sends e-mail to administrators or end users, or the JRExec server used to launch an external notification program One or more policies that perform the event notification
Event Gateway
An event gateway is an implementation of Netcool/Impact in which you send event information from the ObjectServer to a third-party application for processing. Because Netcool/Impact can interface with so many different types of databases and other software, you can use Netcool/Impact to build event gateways where that do not otherwise exist as part of the Netcool suite. An event gateway solution has the following components A data model that includes a data source and data type representing the third-party application An event reader service that monitors the event source One or more policies that send event information to the third-party application
Setting Up a Solution
To set up a Netcool/Impact solution, you do the following: Create a data model Set up services Create policies
14
Setting Up Services
The next step is to set up services. Different types of solutions require different sets of services. Most solutions require an event reader. Solutions that use hibernations also require the hibernating policy activator. Solutions that receive or send e-mail require an e-mail reader and the e-mail sender service. Netcool/Impact has two categories of services. The first category are built-in services like the event processor and the command line service manager. Netcool/Impact only allows you to have single instances of this type of service. The second category are services like the event reader and policy activator. You can create and configure multiple instances of this type of service. For more information, see Chapter 8. "Services" on page 71.
Creating Policies
After you have created a data model and set up the services you need, you can start creating the policies required by your solution. You create policies using the Netcool/Impact GUI, which contains a policy editor, a syntax checker and other tools you need to write, run, test and debug your policies. For more information, see Chapter 14. "Policy Fundamentals" on page 133.
Running a Solution
To start a solution, you start each of the service components. You should start the components in the following order: Hibernating policy activator, e-mail sender, command execution manager and/or CORBA name service Event processor Event reader, event listener, e-mail reader or policy activator
15
You can configure services to run automatically at startup, or you can start them manually using the Netcool/Impact GUI and CLI. By default, services that run automatically at startup run in the proper order. If all other services are already running, starting services like the event processor that trigger policies effectively starts the solution. To stop a solution, you stop any services, like the event processor, that trigger your policies.
16
Introduction
This is the beginning of Part Two of this guide. Part Two provides information about Netcool/Impact data models. This part of the guide contains the following chapters: Chapter 3. "Data Models" on page 17. This chapter contains general information on Netcool/Impact data models. Chapter 4. "Working with Data Sources" on page 27. This chapter contains information on how to work with Netcool/Impact data sources. Chapter 5. "Working with Data Types" on page 33. This chapter contains information on how to work with Netcool/Impact data types. Chapter 6. "Working with Links" on page 53. This chapter contains information on how to work with Netcool/Impact links. Chapter 7. "Working with Event Sources" on page 63. This chapter contains information on how to work with Netcool/Impact event sources.
17
18
Data Sources
Data sources are elements of the data model that represent real-world sources of data in your environment. Netcool/Impact supports SQL databases, LDAP servers and a variety of other external third-party data sources. Netcool/Impact also allows you to use its own internal data repository as a data source. For more information on data sources, see Chapter 4. "Working with Data Sources" on page 27.
19
Data Types
Data types are elements of the data model that represent sets of data stored in a data source. The structure of this depends on the category of data source where it is stored. For example, if the data source is an SQL database, each data type corresponds to a database table. If the data source is an LDAP server, each data type corresponds to a type of node in the LDAP hierarchy. For more information on data types, see Chapter 5. "Working with Data Types" on page 33.
Data Items
Data items are elements of the data model that represent actual units of data stored in a data source. The structure of this unit of data depends on the category of the associated data source. For example, if the data source is an SQL database data type, each data item corresponds to a row in a database table. If the data source is an LDAP server, each data item corresponds to a node in the LDAP hierarchy.
Links
Links are elements of the data model the define relationships between data types and data items. Dynamic links define relationships between data type. Static links define relationships between data items. Link are an optional component of a Netcool/Impact data model. For more information on links, see Chapter 6. "Working with Links" on page 53.
20
Netcool/Impact
Data Items
Data Items
Data Items
Data Items
Data Items
Data Items
Data Items
21
22
Data Sources
Because all of the data needed is stored in a single MySQL database, this data model only requires one data source. For the purposes of this example, the data source is named MYSQL_01.
Data Types
Each table in the MYSQL database is represented by a single SQL database data type. For the purposes of this example, the data types are named User, Admin, Department, Location, Fileserver and Emailserver. In this case, the names of the data types are the same as the table names.
Data Items
Because the data is stored in an SQL database, the data items in the model are rows in the corresponding database tables.
Links
The relationship between the data types in this data model can be described as a set of dynamic links. This data model has the following linking relationships: User -> Department User -> Location Location -> Emailserver Department -> Fileserver Emailserver -> Location. Fileserver -> Departments Administrator -> Location
Event Sources
This data model has a single event source, which represents the Netcool/OMNIbus ObjectServer that stores events related to activity in their environment.
23
The goal of the data model in this example is to provide the means to access a set of device inventory and service management data that is generated and updated in real time by a set of third-party application. This data contains information about the server hardware located in racks in the hosting facility and a variety of other data that describes how instances of HTTP and e-mail server software is installed and configured on the hardware. As with the previous example, policies developed for use with this information would tap into this data model whenever they needed to access this data. The web services hosting model in this example consists of ten HTTP server clusters and three e-mail servers clusters, spread over 20 machines. Each HTTP cluster and each e-mail cluster consist of one primary and one backup server. This environment serves 15 customers whose use is distributed across one or more clusters depending on their service agreement. The solution that manages this environment is designed to monitor the uptime of the HTTP and e-mail services. When a problem occurs with one of these services, it determines the identity of the cluster that is causing the problem and the hardware where the component server instances are installed. It then modifies the original alert data in Netcool/OMNIbus to reflect this information. This solution also determines the customer that is associated with the service failure and sets the priority of the alert to reflect the customers service agreement. The data in this model is stored in two separate Oracle databases. The first database has five tables named Node, HTTPInstance, HTTPCluster, EmailInstance and EmailCluster. The second database is a customer service database that has, among other tables, one named Customer.
Data Sources
Because this model has two real-world sources of data, it requires two data sources. For the purpose of this example, these are called ORACLE_01 and ORACLE_02.
Data Types
Each table in the MySQL database is represented by a single SQL database data type. For the purposes of this example, the data types are named Node, HTTPInstance, HTTPCluster, EmailInstance, EmailCluster and Customer.
Data Items
Because the data is stored in an SQL database, the data items in the model are rows in the corresponding database tables.
24
Links
The relationship between the data types in this data model can be described as a set of dynamic links. This data model has the following linking relationships: HTTPServer -> Node EmailServer -> Node HTTPServer -> HTTPCluster EmailServer -> EmailCluster Customer -> HTTPCluster Customer -> HTTPServer
25
Creating Links
After you have created data types, you can define linking relationships between them using dynamic links. You can also define linking relationships between internal data items using static links. Use of links in Netcool/Impact is optional. For more information, see "Setting Up Links" on page 56.
26
In addition, Netcool/Impacts internal data repository can also be used as a data source. For more information on data source categories, see "Data Source Categories" on page 28.
27
28
Netcool/Impact SQL Database Data Source SQL Database Data Source Mediator Data Source LDAP Data Source
DSA
DSA
DSA
SQL Database
LDAP Server
29
30
To create the data source: 1. 2. Log into the Netcool/Impact GUI. Select a project from the Projects list.
3.
Open the Data Sources tab and select the category of data source from the Sources list. The Data Source Editor window appears.
4. 5.
31
32
33
34
You use Schedule and TimeRangeGroup data types to manage Netcool/Impact scheduling. You can use the Doc data type to store information about URLs located on your intranet.
35
ID
The ID attribute specifies the internal name used by Netcool/Impact to refer to the field. By default, the field ID is the same as the name of the data element that corresponds to the field in the underlying data source. For example, if the data type is an SQL database data type, the underlying field corresponds to a column in the table. By default, the field ID is the same as the column name in the database. You can change the field ID to any other unique name. For example, if the underlying column names in the data source are not human-readable, or are difficult to type and remember, you can use the ID field to provide a more easy-to-use alias for the field. The field ID overrides the actual name and display name attributes for the field in all cases.
36
Actual Name
The actual name attribute is the name of the corresponding data element in the underlying data source as described in the section above. Although the Netcool/Impact GUI allows you to freely edit this field, it must be identical to how it appears in the data source in order to work. Otherwise, Netcool/Impact will report an error when trying to access the data type.
Display Name
The display name attribute allows you to specify a label for the field that is displayed only when you browse data items using the Netcool/Impact GUI. This attribute does not otherwise have an effect on the functionality of the data type.
Description
The description attribute allows you to specify a short description for the field. This description is only visible when you edit the data type using the Netcool/Impact GUI. Like the display name, it does not otherwise have an effect on the functionality of the data type.
Format
The format is the data format of the field. For SQL database data types, Netcool/Impact auto-discovers the columns in the underlying table and automatically deduces the data format for each field when you set up the data type. For other data types, you must manually specify the format for each field that you create. The following table shows the Netcool/Impact data formats:
Table 3. Netcool/Impact Data Formats (1 of 2) Format String Integer Long Float Double Date Boolean Clob Description Represents text strings up to 4 KB in length. Represents whole numbers. Represents long whole numbers. Represents floating point decimal numbers. Represents double-precision floating point decimal numbers. Represents formatted date/time strings. Represents boolean values of true and false. Represents large-format binary data.
37
Table 3. Netcool/Impact Data Formats (2 of 2) Format Long_String Password String Description Represents text strings up to 16 KB in length (internal data types only). Represents password strings (internal data types only). The password appears in the Netcool/Impact GUI as a string of asterisks, rather than the actual password text.
38
The display name is the name of the data type field that is displayed when you browse data items in the data type using the Netcool/Impact GUI. To create a user-defined internal data type: 1. 2. In the Netcool/Impact GUI, open the Data Types task pane in the Navigation panel. Select Internal from the Data Sources list and click the New Data Type button. A new Data Type Editor tab appears in the Main Work panel.
3. 4.
Enter a unique name for the data type in the Data Type Name field. Click the Browse button and select an icon for the data type from the dialog that opens.
39
5.
For each field you want to create in the data type, do the following: Click the New Field button. The New Field window opens. You use this window to define the attributes for the data type fields.
Enter a unique ID in the ID field. Select the data format for the field from the Format list. The other fields in this dialog box are optional. For fields in internal data types, the actual name and display name should always be the same as the field ID. If you leave these fields empty, Netcool/Impact populates them automatically with the ID value. Click OK. 6. 7. Specify a key field in the list of fields located in the Table Description area of the Data Type Editor. You must specify at least one key field. In the Data Type Editor, select a display name from the Display Name field. This display name appears when you browse data items in the data type using the Netcool/Impact GUI. It does not otherwise effect the behavior of the data type.
40
8.
The new name of the data type appears in the Data Type Editor tab.
9.
After you create the internal data type, you must manually populate it with data you need using the Netcool/Impact GUI. For more information, see the Netcool/Impact User Interface Guide. You can also use static and dynamic links to create relationships between the internal data type and other data types in the data model. For more information, see Chapter 6. "Working with Links" on page 53.
41
Getting Started
To start creating an SQL database data type: 1. 2. In the Netcool/Impact GUI, open the Data Types task pane in the Navigation panel. Select the underlying data source from the Data Sources list and click the New Data Type button. A new Data Type Editor tab appears in the Main Work panel. The Data Type Editor displays the name of the data source as a temporary name for the data type.
3. 4. 5.
Enter a unique name for the data type in the Data Type Name field. Enter the name of the underlying data source in the Data Source Name field. Click the Browse button and select an icon for the data type from the dialog that opens.
42
To specify the database and table: 1. In the Data Type Editor, scroll down so that the Table Description area is visible.
2.
Enter the name of the database and the table in the Base Table lists. The first list contains the databases in the data source. The second list contains the tables in the selected database.
43
Netcool/Impact retrieves the table description from the data source and populates the fields. The fields are displayed in the Table Description area.
After you auto-populate the data type fields, you can manually change the attributes of any field definition. Do not change the value of the actual name attribute. If you change this value, Netcool/Impact will report errors when you try to retrieve data from the data type.
44
If you want to specify that only rows where the Location is either New York or New Jersey, you can use the following:
Location = New York OR Location = New Jersey
Make sure that you enclose any strings in single quotation marks. To specify the data item filter, enter the filter string in the Filter text box in the Data Item Filter and Ordering area of the Data Type Editor.
Figure 12. Data Type Editor = Data Item Filtering and Ordering
45
The data type name appears in the Data Type Editor tab after when you save.
After you have saved the data type, you can close the Data Type Editor or you can continue on to configuring caching and dynamic links for the data type. For more information on caching see "Data Type Caching" on page 48. For more information on dynamic links, see Chapter 6. "Working with Links" on page 53.
46
To create an LDAP data type: 1. 2. In the Netcool/Impact GUI, open the Data Types task pane in the Navigation panel. Select the underlying data source from the Data Sources list and click the New Data Type button. A new Data Type Editor tab appears in the Main Work panel. The Data Type Editor displays the name of the data source as a temporary name for the data type.
3. 4. 5. 6.
Enter a unique name for the data type in the Data Type Name field. Enter the name of the underlying data source in the Data Source Name field. Click the Browse button and select an icon for the data type from the dialog that opens. Enter the base context for the data type in the Base Context field in the General Settings area of the Data Type Editor. An example of a base context is the following: ou=people, o=micromuse.com. Enter the display name field for the data type in the Display Name Field text field. The display name is the name of the data type field that is displayed when you browse data items in the data type using the Netcool/Impact GUI. Optionally, enter a restriction clause in the Restriction Clause field. The restriction clause is an LDAP search filter as defined in Internet RFC 2254. For a description of LDAP search filter syntax, see the Netcool/Impact Policy Reference Guide.
7.
8.
47
9.
The new name of the data type appears in the Data Type Editor tab.
48
Data Caching
Data caching is when Netcool/Impact temporarily stores individual data items retrieved from a data source. You can configure the following data caching properties using the Netcool/Impact GUI: Maximum number of data items to cache Expiration time for data items in the cache
Netcool/Impact calculates the expiration time for separately each data item in the cache. You must enable data caching for any other type of caching to work. To configure data caching: 1. 2. In the Netcool/Impact GUI, open the Data Type Editor for the data type whose caching you want to configure. Select the Cache Settings tab in the Data Type Editor. The Cache Settings area appears in the Data Type Editor.
3. 4. 5.
Select the Enable Data Caching checkbox. Enter a number in the Maximum Number of Data Items field. Enter the amount of time to cache each data item in the Invalidate Cached Items After fields.
49
6.
7.
Query Caching
Query caching is when Netcool/Impact temporarily stores sets of data items retrieved during individual queries to a data source. You can configure the following query caching properties using the Netcool/Impact GUI: Maximum number of queries to cache Expiration time for query results in the cache
Netcool/Impact calculates the expiration time separately for each query in the cache. You must also enable data caching for query caching to work. To configure query caching: 1. 2. 3. In the Netcool/Impact GUI, open the Data Type Editor for the data type whose caching you want to configure. Select the Cache Settings tab in the Data Type Editor. The Cache Settings area appears in the Data Type Editor. Scroll down until the Enable Query Caching area is visible.
4. 5.
Select the Enable Query Caching checkbox. Enter a number in the Maximum Number of Queries field.
50
6. 7.
Enter the amount of time to cache each data item in the Invalidate Cached Queries After fields. Click the Save button in the Data Type Editor tab.
8.
Count Caching
Count caching is when Netcool/Impact temporarily stores the count values obtained in a policy using the GetByFilter function with the CountOnly parameter set to True. You can configure the expiration time for items counted using this feature. To configure count caching: 1. 2. 3. In the Netcool/Impact GUI, open the Data Type Editor for the data type whose caching you want to configure. Select the Cache Settings tab in the Data Type Editor. The Cache Settings area appears in the Data Type Editor. Scroll down until the Enable Count Caching area is visible.
4. 5.
Select the Enable Count Caching checkbox. Enter the amount of time to cache query counts in the Invalidate Cached Count After fields.
51
6.
7.
52
About Links
This section contains overview information about links. It contains the following topics: What Are Links? What Are the Links Categories? How Do Links Work? What Do I Do With Links? How Do I Set Up Links?
53
Link Categories
Netcool/Impact provides the following categories of links: Static links Dynamic links
Static Links
Static links define a relationship between data items in internal data types. Static links are not supported for other categories of data types, such as SQL database and LDAP types, because there is no way for Netcool/Impact to ensure the persistence of data items that are stored externally.
Dynamic Links
Dynamic links define a relationship between data types. This relationship is specified when you create the link and is evaluated in real time when Netcool/Impact encounters a call to the GetByLinks function in a policy. Dynamic links are supported for internal, SQL database and LDAP data types. Netcool/Impact supports the following types of dynamic links: Link by Filter Link by Key Link By Policy
54
Link By Filter
A link by filter is a type of dynamic link where the relationship between two data types is specified using the link filter syntax. The link filter syntax is as follows:
target_field = %source_field% [AND (target_field = %source_field%) ...]
where target_field is the name of a field in the target data type and source_field is the name of the field in the source data type. When you call the GetByLinks function in a policy, Netcool/Impact evaluates the data items in the target data type and returns those items whose target_field value is equal to the specified source_field. If the value of source_field is a string, you must enclose it in single quotation marks. The following are examples of valid link filters:
Location = %Name% (NodeID = %ID%) AND (Location = %Name%)
Link By Key
A link by key is a type of dynamic link where the relationship between two data types is specified by a foreign key expression. The foreign key expression is the value that the key field in data items in the target data type must have in order to be considered linked to the source. The syntax of the foreign key expression is the name or names of fields in the source data type whose value must equal the key field in the target. You can concatenate fields using the addition (+) operator. When you call the GetByLinks function in a policy, Netcool/Impact evaluates the data items in the target data type and returns those whose key field values match the specified key expression. The following are examples of valid key expressions:
LastName FirstName + " " + LastName LastName + ", " + FirstName
Link By Policy
A link by policy is a type of dynamic link where the relationship between two data types is specified by a policy. The policy contains the logic that Netcool/Impact uses to retrieve data items from the target data type. The linking policy specifies which data items to return by setting the value of the DataItems variable.
55
Setting Up Links
This section describes how to set up static and dynamic links.
3. 4. 5.
Click the Links button for the data item you want to link. In the Static Links window that opens, select the data type that contains the data items you want to link to. Select the data item to link to from the list of data items that appears.
56
A Data Type Editor tab appears in the Main Work panel. 3. Select the Dynamic Links tab in the Data Type Editor.
57
4.
Click the New Link By Filter button. The Link By Filter window appears.
5. 6. 7.
Select the target data type from the Target Data Types list. Enter the filter syntax for the link in the Filter into Target Data Type field. Click OK.
58
A Data Type Editor tab appears in the Main Work panel. 3. Select the Dynamic Links tab in the Data Type Editor.
59
4.
Click the New Link By Key button. The Link By Key window appears.
5. 6. 7.
Select the target data type from the Target Data Type field. Enter the key expression in the Foreign Key Expression field. Click OK.
3. 4.
Select the Dynamic Links tab in the Data Type Editor. Scroll down so that the Link By Policy area is visible.
5.
Click the New Link By Policy button. The Link By Policy window appears.
6. 7. 8.
Select the target data type from the Target Data Type list. Select the linking policy from the Policy To Execute to Find Links list. Click OK.
61
62
63
64
65
Netcool/Impact
Event Reader
Event Listener
ObjectServer
Figure 35. Event Source Architecture
66
It contains the following topics: Setting Up ObjectServer Event Sources Setting Up Non-ObjectServer Event Sources
67
To create the event source: 1. 2. Log into the Netcool/Impact GUI. Select a project from the Projects list.
3.
Open the Data Sources tab and select the category of data source from the Sources list. The Data Source Editor window appears.
4. 5.
After you have created the event source, you can then create and configure an associated event reader service. For more information, see "Setting Up Event Readers" on page 83.
68
69
70
Chapter 8. Services
This chapter contains overview information about Netcool/Impact services. It contains the following sections: "Introduction" on page 71 "How Do I Use This Part of the Guide?" on page 71 "About Services" on page 72 "Service Types" on page 73 "Setting Up Services" on page 75
Introduction
This is the beginning of Part Three of this guide. Part Three provides information about Netcool/Impact services. This part of the guide contains the following chapters: Chapter 8. "Services" on page 71. This chapter contains general information on Netcool/Impact services. Chapter 9. "Working with Event Readers" on page 77. This chapter contains instructions on setting up event readers. Chapter 10. "Working with Event Listeners" on page 89. This chapter contains instructions on setting up event listeners. Chapter 12. "Working with Policy Activators" on page 121. This chapter contains instructions on setting up policy activators. Chapter 13. "Working with Other Services" on page 125. This chapter contains instructions on setting up the e-mail sender, policy logger and other basic services.
Chapter 8. Services
71
If you are an experienced Netcool/Impact user, or you are upgrading an installation from a previous version of Netcool/Impact for the first time, you should first read Chapter 9. "Working with Event Readers" on page 77. Then you can read any of the following chapters as needed in order to review information that you already know, or learn how to upgrade your existing services so that they are compatible with this version of the product. Once you have a firm understanding of Netcool/Impact services, you can go on to Chapter 14. "Policy Fundamentals" on page 133 of this guide, which contains instructions on writing Netcool/Impact policies.
About Services
This section contains overview information about Netcool/Impact services. It contains the following topics: What Are Services? What Are the Service Types? How Do Services Work? What Do I Do With Services? How Do I Set Up Services? How Do I Manage Services?
72
Service Types
Netcool/Impact provides the following services: Event readers Event listeners E-mail readers E-mail sender Policy activators Hibernating policy activator Event processor Policy logger Command line manager service CORBA name service
Event Readers
Event readers are services that monitor a Netcool/OMNIbus ObjectServer event source. When an event reader discovers a new, updated and/or deleted alerts in the ObjectServer, it retrieves the alert and sends it to an event queue, where it waits to be handled by the event processor. Event readers are the most important Netcool/Impact service. For more information, see Chapter 9. "Working with Event Readers" on page 77.
Chapter 8. Services
73
Event Listeners
Event listeners are services that monitor a non-ObjectServer event source. As with event readers, when they discover a new, updated and/or deleted event in the event source, they retrieve the event and send it in the event queue, where it waits to be handled by the event processor. Event listeners typically work with specially-configured DSAs, such as the JMS DSA, that allow bi-directional access to a source of data. For more information, see Chapter 10. "Working with Event Listeners" on page 89.
E-Mail Sender
The e-mail sender is a service that sends e-mail via an external SMTP service. For more information, see Chapter 13. "Working with Other Services" on page 125.
Policy Activators
Policy activators are services that run policies at timed intervals. For more information, see Chapter 12. "Working with Policy Activators" on page 121.
Event Processor
The event processor is the service responsible for managing events coming into Netcool/Impact via event reader, event listener and e-mail reader services. The event processor manages the incoming event queue and is responsible for sending queued events to the policy engine for processing.
Policy Logger
The policy logger is the service responsible for managing the policy log. The policy log is a text stream used by Netcool/Impact to record messages during the runtime of a policy. The policy log contains both system messages issued by Netcool/Impact and messages that you define in a policy. For more information, see Chapter 13. "Working with Other Services" on page 125.
74
Setting Up Services
To set up services, you do the following: Configure pre-defined services like the event processor, e-mail sender and/or CORBA name service Create and configure user-defined services like event readers, event listeners and e-mail readers
Chapter 8. Services
75
76
77
78
Probe
Netcool/ Impact
Probe
Figure 38. Event Reader Architecture
Startup
If the event reader is configured to get all unprocessed events at startup, it queries the ObjectServer during this phase for new and/or updated events that have occurred since the last query. If the event reader is not configured to get all unprocessed events, it proceeds to the event polling phase without querying the ObjectServer.
Event Polling
During the event polling phase, the event reader queries the ObjectServer at intervals for all new and/or unprocessed events. You set the polling interval when you configure the event reader.
Chapter 9. Working with Event Readers 79
Event Querying
When the event reader queries the ObjectServer, either at startup or when polling for events at intervals, it does the following: Reads the state file to find the Serial or StateChange value of the last read event Connects to the ObjectServer and retrieves new and/or updated events that have occurred since the last read event
Delete Notification
If the event reader is configured to run a policy when an event is deleted from the ObjectServer, it listens to the ObjectServer via the IDUC interface for notification of deleted alerts. The IDUC delete notification includes the event field data for the deleted alert.
Event Queuing
After it retrieves new and/or updated events, or has received events through delete notification, the event reader compares the field data in the events to its set of filters. If the event matches one or more of its filters, the event reader places the event in the event queue with a pointer to the corresponding policy. Once the events are in the event queue, they can be picked up by the event processor service. The event processor passes the events and pointers to the corresponding policies to the policy engine for processing.
80
Polling Interval
The polling interval is the interval in milliseconds at which the event reader polls the ObjectServer for new and/or updated events. The default polling interval is 3000 milliseconds.
Event Fields
Netcool/Impact allows you to specify which event fields you want to retrieve from the ObjectServer. By default, Netcool/Impact retrieves all fields in the alerts. However, you can improve the event reader performance and reduce the performance impact on the ObjectServer if you configure the event reader to retrieve only those fields that are used in the corresponding policies.
81
Event Mapping
Event mapping allows you to map incoming events to one or more specific policies. You can configure the following aspects of event mapping: Mappings Event matching Actions Event locking
Mappings
Event mappings allow you to specify which policies you want Netcool/Impact to run when certain events are retrieved. Each mapping consists of a filter that specifies the type of event and a policy name. You must specify at least one event mapping for the event reader to work. The syntax for the filter is the same as the WHERE clause in an SQL SELECT statement. This clause consists of one or more comparisons that must be true in order for the specified policy to be executed. For more information on the SQL filter syntax, see the Netcool/Impact Policy Reference Guide. The following are examples of event mapping filters.
AlertKey = Node not responding AlertKey = Node not reachable by network ping AND Node = ORA_Host_01
Event Matching
You can specify whether to run only the first matching policy in the event mappings or to run every policy that matches. If you choose to run every policy that matches, the event reader will place a duplicate of the event in the event queue for every matching policy. The event will be processed as many times as their are matching filters in the event reader.
Actions
By default, the event broker monitors the ObjectServer for new alerts. However, you can also configure it to monitor for updated alerts and/or to be notified when an alert is deleted. In addition, you can configure it to get all of the unprocessed alerts from the ObjectServer at startup.
Event Locking
Event locking is a feature that allows a multi-threaded event broker to categorize incoming alerts based on the values of specified alert fields and then to process them within a category one at a time in the order that they were sent to the ObjectServer. Event locking locks the order in which the event broker processes alerts within each category.
82
You use event locking in situations where you want to preserve the order in which incoming alerts are processed, or in situations where you want to prevent a multi-threaded event processor from attempting to access a single resource from more than one instance of a policy running simultaneously. You specify the way the event broker categorizes incoming alerts using an expression called a locking expression. The locking expression consists of one or more alert field names concatenated with a plus sign (+) as follows:
field[+field...]
where field is the name of an alert field in the ObjectServers alerts.status table. When an event broker retrieves alerts from the ObjectServer, it evaluates the locking expression for each incoming alert and categorizes it according to the contents of the alert fields in the expression. For example, when using the following locking expression Node, the event broker categorizes all incoming alerts based on the value of the Node alert field and then processes them within a category one at a time in the order that they were sent to the ObjectServer. In the following example:
Node+AlertKey
the event broker categorizes all incoming alerts based on the concatenated values of the Node and AlertKey fields. In this example, an alert whose Node value is Node1 and AlertKey value is 123456 is categorized separately
Event Order
You can specify an alert field that you want the event reader to use to order alerts retrieved from the ObjectServer. When you specify a field, the event reader sorts the incoming alerts by the field value in ascending order.
83
2.
Select Event Reader from the Types list and click the New Service button. The Event Reader Configuration window appears.
3. 4. 5.
Enter a unique name for the event reader in the Service Name field. Select the ObjectServer event source that you want to monitor from the ObjectServer Data Sources list. Enter a polling interval in milliseconds in the Polling Interval field. If you leave this field empty, the event reader will poll the ObjectServer every three seconds.
84
6.
7. 8.
Select the fields that you want to retrieve from the ObjectServer in the Available list and click Add. Select the fields that you do not want to retrieve in the Selected list and click Remove.
85
9.
Select the Event Mapping tab that is located at the top of the Event Reader Configuration window. The Event Mapping area of the window appears.
10. Select an Event Matching option. You can choose to test events with all filters and run any matching policies or to stop testing after the first matching policy. 11. If you want to get updated events as well as new events from the ObjectServer, select Get Updated Events in the Actions area. Optional. 12. If you want to get unprocessed events at startup, select Get Unprocessed Events in the Actions area. Optional. 13. If you want the event reader to receive notification when alerts are deleted from the ObjectServer, select Run Policy on Deletes in the Actions area. Then, select the policy you want to run when notification occurs from the Policy list. Optional. 14. If you want to use event order locking, select Event Locking and enter the locking expression in the Expression field. Optional.
86
15. For each event type that you want to associate with a policy, do the following: Click the New Mapping button. The Create Event Filter window appears.
Enter a filter string in the Filter Expression field. This filter specifies the type of event that maps to the policy. Select the policy you want to run for the event type from the Policy to Run list. Select the Active checkbox. Click OK. 16. If you want to order incoming events, enter the name of an alert field in the Order text box. The event reader will sort incoming events in ascending order by the contents of this field. 17. Click OK.
87
88
89
Event Listening
During the event listening phase, the event listener connects to the event source and waits passively for the event source to send events. When the event listener receives an event from an event source, it converts it into the Netcool/Impact event format.
Event Queuing
After the event listener has converted the event into Netcool/Impact format, it places the event on the event queue with a pointer to the policy specified in the event listener configuration. Once the event is in the event queue, it can be picked up by the event processor service. The event processor passes the event and the pointer to the corresponding policies to the policy engine for processing.
90
Listener Filter
The listener filter allows you to specify which incoming events the event listener passes to the event processor for handling. The syntax for the listener filter varies, depending on the DSA that provides the connection to the event source. If the DSA does not specify a listener syntax, you can specify an empty string ( ) as the filter.
91
92
2.
Select Event Listener from the Types list and click the New Service button. The Create New Event Listener window appears.
3. 4. 5.
Enter a unique name for the e-mail reader in the Service Name field. Enter a listener filter, if any, in the Listener Filter field. Optional. Select the policy you want to run when new events are received by the event listener from the Action Tree To Execute list.
93
6.
If the DSA that works with the event listener is running in CORBA mode, do the following: Enter the hostname or IP address of the system where the CORBA name service is running in the NSHost field Enter the port where the CORBA name service is running in the NSPort field. Enter the CORBA name service context in the NSContext field. Enter the CORBA name server object name in the NSObjectName field.
7.
If the DSA that works with the event listener is running in direct mode, do the following: Enter the name of the direct mode interface class in the Direct Mode Class Name field. Enter the name of the direct mode source in the Direct Mode Source field.
8.
Click OK.
94
96
To set up the database server, you do the following: Copy the client tar file to the system where Oracle is running and extract its contents Edit the nameserver properties file Edit the listener properties file (optional) Install the client files into the database server using the Oracle loadjava utility Grant database permissions
nameserver.n.port
nameserver.n.location
nameserver.userid
97
Table 5. Database Client Nameserver Properties File (2 of 2) Property nameserver.password nameserver.count Description Do not change the value of this property. Number of nameserver instances in the namserver cluster. The default value for this property is 1.
The following example shows a properties file that the database client can use to connect to a single-server configuration of the nameserver. In this example, the nameserver is located on a system named NCI_GUI_01 and is running on the default port.
nameserver.0.host=NCI_GUI_01 nameserver.0.port=8080 nameserver.0.location=/nameserver/services nameserver.userid=admin nameserver.password=netcool nameserver.count=1
The following example shows a properties file that the database client can use to connect to a cluster that consists of two nameserver instances. In this example, the nameservers are located on systems named NCI_GUI_01 and NCI_GUI_02 and are running on the default port.
nameserver.0.host=NCI_GUI_01 nameserver.0.port=8080 nameserver.0.location=/nameserver/services nameserver.1.host=NCI_GUI_02 nameserver.1.port=8080 nameserver.1.location=/nameserver/services nameserver.userid=admin nameserver.password=netcool nameserver.count=2
98
impact.dblistener.debug
impact.dblistener.delim
If you do not install the files in this order, loadjava will not be able to resolve external references between files and will report errors during installation. To install the client files, change the current directory to ORACLE_HOME/bin and enter the following commands at a command prompt:
loadjava loadjava loadjava loadjava loadjava -U -U -U -U -U username/password username/password username/password username/password username/password -resolve -resolve -resolve -resolve -resolve cryptix32.jar nameserver.jar impactdblistener.jar nameserver.props impactdblistener.props
where username and password are a valid username and password for a user whose schema contains the database resources where the Java stored procedures will be run.
99
Oracle might also require you to grant socket permissions to additional ports (for example, the next two port numbers in the allocation sequence) for use in connecting to the database listener service.
100
3. 4.
Select an Event Matching option. You can choose to test events with all filters and run any matching policies or to stop testing after the first matching policy. For each type of event that you want to associate with a policy, do the following: Click the New Mapping button. Enter a filter string in the Filter Expression field. This filter specifies the type of event that maps to the policy. For information on the filter syntax, see "Event Mapping" on page 82. Select the policy you want to run for the event type from the Policy to Run list. Select the Active checkbox. Click OK.
5. 6. 7.
Select Startup to start the service automatically when you start the Netcool/Impact server. Select Write to File to print the service log to a file. Click OK.
Before you create these objects in the database, you must understand what kind of database events you want to send and what conditions should cause them to be sent. For example, if you want to send an event to Netcool/Impact every time a row is inserted into a table, you should know the identity of the table, the subset of row information to send as part of the event and the name of the condition (for example, after insert) that triggers the operation. For more information on Java stored procedures, call specs and triggers, see the Oracle Java Stored Procedure Developers Guide.
where each element in array x is a string that contains a name/value pair in the event. The sendEvent() function is located in the class com.micromuse.response.service.listener.database. DatabaseListenerClient, which you compiled and loaded when you installed the client into the database server.
Chapter 11. Working with the Database Listener 101
In order for Oracle objects to call this function, you must create a call spec that publishes it to the database as a stored procedure. The following example shows a call spec that publishes sendEvent() as a procedure named test_varray_proc:
CREATE OR REPLACE PROCEDURE test_varray_proc(v_array_inp db_varray_type) AS LANGUAGE JAVA NAME 'com.micromuse.response.service.listener.database.DatabaseListenerClie nt. sendEvent(java.sql.Array)'; /
In this example, db_varray_type is a user-defined VARRAY that can be described using the following statement:
CREATE TYPE db_varray_type AS VARRAY(30) OF VARCHAR2(100);
The above call spec and VARRAY type are used in examples elsewhere in this chapter. When you call the procedure published with this call spec, you pass it an Oracle VARRAY in which each element is a string that contains a name/value pair in the event. The name and value in the string are separated using the pipe character (|) or another character as specified when you configured the database client.
Creating Triggers
You can create triggers for the following types of database events: DML events DDL events System events User events
DML Events
DML events are sent to Netcool/Impact when the database performs operations that change rows in a table. These include the standard SQL INSERT, UPDATE and DELETE commands. You configure the database to send DML events by creating triggers that are associated with these operations. Most often, these triggers take field data from the rows under current change and pass it to the database client using the call spec you previously created. In this way, the database reports the inserts, updates and deletes to Netcool/Impact for processing as events. When the database client receives the field data from the trigger, it performs a SELECT operation on the table to determine the underlying data type of each field. Because the corresponding row is currently under change, Oracle is likely to report a mutating table error (ORA-04091) when the database client performs the SELECT. To avoid receiving this error, your DML triggers should create a copy of the row data first and then use this copy when sending the event.
102 Impact Version 4.0 Solutions Guide
The following example contains table type declarations, variable declarations and trigger definitions that create a temporary copy of row data. You can modify this example for your own use. This example uses the type db_varray_type described in the previous section. The triggers in the example run in response to changes made to a table named dept. This example contains the following: Type declaration for deptTable, which is a nested table of db_varray_type. Variable declaration for dept1, which is a table of type deptTable. This table stores the copy of the row data. Variable declaration for emptyDept, which is a second table of type deptTable. This table is empty and is used to reset dept1. Trigger definition for dept_reset, which is used to reset dept1. Trigger definition for dept_after_row, which populates dept1 with field data from the changed row(s). Trigger definition for dept_after_stmt, which loops through the copied rows and sends the field data to the database client using the call spec defined in the previous section.
The trigger definition for dept_after_row is intentionally left incomplete in this example, because it will vary depending on whether you are handling INSERT, UPDATE or DELETE operations. Examples in the following sections contain possible definitions for this trigger.
CREATE OR REPLACE PACKAGE dept_pkg AS /* deptTable is a nested table of VARRAYs that will be sent to the database client */ TYPE deptTable IS TABLE OF db_varray_type INDEX BY BINARY_INTEGER; /* dept1 will store the actual VARRAYs dept1 deptTable; /* emptyDept is used for initializing dept1 */ emptyDept deptTable; end; / CREATE OR REPLACE TRIGGER dept_reset BEFORE INSERT OR UPDATE OR DELETE ON dept BEGIN /* Initialize dept1 */ dept_pkg.dept1 := dept_pkg.emptyDept; end; /
103
/* /* /* /*
CREATE OR REPLACE TRIGGER dept_after_row AFTER INSERT OR UPDATE OR DELETE ON dept FOR EACH ROW BEGIN
/* This trigger intentionally left incomplete. */ /* See examples in following sections of this chapter. */ end; / CREATE OR REPLACE TRIGGER dept_after_stmt AFTER INSERT OR UPDATE OR DELETE ON dept BEGIN /* Loop through rows in dept1 and send field data to database client */ /* using call proc defined in previous section of this chapter */ for i in 1 .. dept_pkg.dept1.count loop test_varray_proc(dept_pkg.dept1(i)); end loop; end; /
Insert Events
To send an event to Netcool/Impact when Oracle performs an INSERT operation, you must first create a trigger that copies the inserted row data to a temporary table. You then use another trigger as shown in the example above to loop through the temporary table and send the row data to the database client for processing. A typical insert trigger contains a statement that populates a VARRAY with the desired field data and then assigns the VARRAY as a row in the temporary table. Each element in the VARRAY must contain a character-delimited set of name/value pairs that the database client converts to event format before sending it to Netcool/Impact. The default delimiter character is the pipe symbol (|). The VARRAY must contain an element for a field named EVENTSOURCE. This field is used by the database client to determine the table where the database event originated. The following example shows a typical VARRAY for insert events:
db_varray_type(EVENTSOURCE | SCOTT.DEPT, DEPTNO | ||:NEW.DEPTNO, LOC | ||:NEW.LOC, DNAME | ||:NEW.DNAME, IMPACTED | ||:NEW.IMPACTED);
In this example, the VARRAY contains an EVENTSOURCE field and fields that contain values derived from the inserted row, as contained in the NEW pseudo-record passed to the trigger. The value of the EVENTSOURCE field in this example is the dept table in the Oracle SCOTT schema.
104
The following example shows a complete trigger that copies new row data to the temporary table dept1 in packpage dept_pkg.
CREATE OR REPLACE TRIGGER dept_after_row AFTER INSERT ON dept FOR EACH ROW BEGIN dept_pkg.dept1(dept_pkg.dept1.count + 1) := db_varray_type(EVENTSOURCE | SCOTT.DEPT, DEPTNO | ||:NEW.DEPTNO, LOC | ||:NEW.LOC, DNAME | || :NEW.DNAME, IMPACTED | ||:NEW.IMPACTED); end; /
For a complete example that shows how to send an insert event, see "Example Triggers" on page 111.
The following example shows a trigger that copies deleted row data to the temporary table dept1.
CREATE OR REPLACE TRIGGER dept_after_row AFTER DELETE ON dept FOR EACH ROW BEGIN dept_pkg.dept1(dept_pkg.dept1.count + 1) := db_varray_type(EVENTSOURCE | SCOTT.DEPT, DEPTNO | ||:OLD.DEPTNO, LOC | ||:OLD.LOC, DNAME | || :OLD.DNAME, IMPACTED | ||:OLD.IMPACTED); end; /
105
DDL Events
DDL events are sent to Netcool/Impact when the database performs an action that makes a change to a schema object. These include the SQL CREATE, ALTER and DROP commands. To send DDL events, you create a trigger that populates a VARRAY with data that describes the DDL action and the database object that is changed by the operation. Then, you pass the VARRAY element to the database client for processing. As with DML events, the VARRAY contains a character-delimited set of name/value pairs that the database client converts to event format before sending to Netcool/Impact. DDL events require two VARRAY elements: EVENTSOURCE, as described in the previous section, and TRIGGEREVENT. Typically, you populate the TRIGGEREVENT element with the current value of Sys.sysevent. The following example shows a typical VARRAY for DDL events.
db_varray_type(TRIGGEREVENT | ||Sys.sysevent, EVENTSOURCE | || Sys.database_name, USERNAME | ||Sys.login_user, INSTANCENUM | || Sys.instancenum, OBJECTTYPE | ||Sys.dictionary_obj_type, OBJECTOWNER | | |Sys.dictionary_obj_owner);
The following example shows a complete trigger that sends an event to Netcool/Impact before Oracle executes a CREATE command.
CREATE OR REPLACE TRIGGER ddl_before_create BEFORE CREATE ON SCOTT.schema DECLARE my_before_create_varray db_varray_type; BEGIN my_before_create_varray := db_varray_type(TRIGGEREVENT | ||Sys.sysevent, EVENTSOURCE | ||Sys.database_name, USERNAME | ||Sys.login_user, INSTANCENUM | ||Sys.instancenum, OBJECTTYPE | || Sys.dictionary_obj_type, OBJECTOWNER | ||Sys.dictionary_obj_owner); test_varray_proc(my_before_create_varray); end; /
For more examples that show how to create triggers that send DDL events, see "Example Triggers" on page 111.
System Events
System events are sent to Netcool/Impact when the Oracle server starts up, shuts down or reports a system-level error. System events only work if the user who owns the corresponding triggers has SYSDBA privileges (for example, the SYS user).
106
To send DDL events, you create a trigger that populates a VARRAY with data that describes the system action. Then, you pass the VARRAY element to the database client for processing. As with DDL events, system events require the TRIGGEREVENT element to be populated, typically with the value of Sys.sysevent. The following example shows a typical VARRAY for system events.
db_varray_type(TRIGGEREVENT | ||Sys.sysevent, OBJECTNAME | || Sys.database_name, USER_NAME | ||Sys.login_user, INSTANCE_NUM | || Sys.instance_num);
The following example shows a complete trigger that sends an event to Netcool/Impact at Oracle startup.
CREATE OR REPLACE TRIGGER databasestartuptrigger AFTER STARTUP ON database BEGIN v_array_inp := db_varray_type(TRIGGEREVENT | ||Sys.sysevent, OBJECTNAME | ||Sys.database_name, USER_NAME | ||Sys.login_user, INSTANCE_NUM | | |Sys.instance_num); test_varray_proc(v_array_inp);
For more examples that show how to create triggers that send system events, see "Example Triggers" on page 111.
User Events
User events are sent to Netcool/Impact when a user logs into or out of Oracle. To send user events, you create a trigger that populates a VARRAY with data that describes the user action. Then, you pass the VARRAY element to the database client for processing. As with system events, user events require the TRIGGEREVENT element to be populated, typically with the value of Sys.sysevent. If you do not specify a value for the EVENTSOURCE element, the database client uses the name of the database, The following example shows a typical VARRAY for user events.
db_varray_type(TRIGGEREVENT | ||Sys.sysevent, EVENTSOURCE ||| Sys.database_name, LOGINUSER | ||Sys.login_user, INSTANCENUM | || Sys.instance_num, TRIGGERNAME | USER_LOGIN);
107
The following example shows a complete trigger that sends an event to Netcool/Impact at when a user logs in.
CREATE OR REPLACE TRIGGER user_login AFTER logon on schema DECLARE my_login_varray db_varray_type; BEGIN my_login_varray := db_varray_type(TRIGGEREVENT | ||Sys.sysevent, EVENTSOURCE |||Sys.database_name, LOGINUSER | ||Sys.login_user, INSTANCENUM | ||Sys.instance_num, TRIGGERNAME | USER_LOGIN); test_varray_proc(my_login_varray); end; /
For more examples that show how to create triggers that send user events, see "Example Triggers" on page 111.
108
When the database client sends the event to Netcool/Impact, it encrypts the connection information (including the database username and password) specified in the event fields. The connection information is then unencrypted when it is received by Netcool/Impact.
109
The following example shows a trigger that sends an event to Netcool/Impact when a new row is inserted into the dept table. In this example, you populate the connection event fields by specifying elements in the Oracle VARRAY that you pass to the database.
CREATE OR REPLACE TRIGGER dept_after_row AFTER INSERT ON dept FOR EACH ROW BEGIN dept_pkg.dept1(dept_pkg.dept1.count + 1) := db_varray_type(EVENTSOURCE | SCOTT.DEPT, DEPTNO | ||:NEW.DEPTNO, LOC | ||:NEW.LOC, DNAME | || :NEW.DNAME, IMPACTED | ||:NEW.IMPACTED, RETURNEVENT | TRUE, USERNAME | ora_user, PASSWORD | ora_passwd, HOST | ora_host, PORT | 4100, SID | ora_01, KEYFIELD | DEPTNO); end; /
The following example shows how to delete an event from the database.
// Set the value of the DeleteEvent variable to true @DeleteEvent = true; // @DeleteEvent name is case-sensitive
110
// Set the event field variables required by the database listener // in order to connect to Netcool/Impact // Return the event to the database ReturnEvent(EventContainer);
Example Triggers
The following examples show how to create Oracle triggers that send the following types of events: Insert Update Delete Server startup Server shutdown Server error User logon User logoff
In these examples, test_varray_proc is a call spec that publishes the sendEvent() function exposed by the database client. The type db_varray_type is a user-defined data type that represents an Oracle VARRAY. The examples use the Oracle SCOTT sample schema. The examples for insert, update and delete events use the package and triggers described in "DML Events" on page 102 to create a copy of row data before performing operations on it.
Insert Event
The following example shows how to create a set of Oracle triggers that send an insert event to Netcool/Impact.
CREATE OR REPLACE PACKAGE dept_pkg AS TYPE deptTable IS TABLE OF db_varray_type INDEX BY BINARY_INTEGER; dept1 deptTable; emptyDept deptTable; end; /
111
CREATE OR REPLACE TRIGGER dept_reset BEFORE INSERT OR UPDATE OR DELETE ON dept BEGIN dept_pkg.dept1 := dept_pkg.emptyDept; end; / CREATE OR REPLACE TRIGGER dept_after_row AFTER INSERT ON dept FOR EACH ROW BEGIN dept_pkg.dept1(dept_pkg.dept1.count + 1) := db_varray_type(EVENTSOURCE | SCOTT.DEPT, DEPTNO | ||:NEW.DEPTNO, LOC | ||:NEW.LOC, DNAME | || :NEW.DNAME, IMPACTED | ||:NEW.IMPACTED); end; / CREATE OR REPLACE TRIGGER dept_after_stmt AFTER INSERT OR UPDATE OR DELETE ON dept BEGIN for i in 1 .. dept_pkg.dept1.count loop test_varray_proc(dept_pkg.dept1(i)); end loop; end; /
Update Event
The following example shows how to create a set of Oracle triggers that send an update event to Netcool/Impact.
CREATE OR REPLACE PACKAGE dept_pkg AS TYPE deptTable IS TABLE OF db_varray_type INDEX BY BINARY_INTEGER; dept1 deptTable; emptyDept deptTable; end; /
112
CREATE OR REPLACE TRIGGER dept_reset BEFORE INSERT OR UPDATE OR DELETE ON dept BEGIN dept_pkg.dept1 := dept_pkg.emptyDept; end; / CREATE OR REPLACE TRIGGER dept_after_row AFTER UPDATE ON dept FOR EACH ROW BEGIN dept_pkg.dept1(dept_pkg.dept1.count + 1) := db_varray_type(EVENTSOURCE | SCOTT.DEPT, DEPTNO | ||:OLD.DEPTNO, LOC | ||:OLD.LOC, DNAME | || :OLD.DNAME, IMPACTED | ||:OLD.IMPACTED); end; / CREATE OR REPLACE TRIGGER dept_after_stmt AFTER INSERT OR UPDATE OR DELETE ON dept BEGIN for i in 1 .. dept_pkg.dept1.count loop test_varray_proc(dept_pkg.dept1(i)); end loop; end; /
Delete Event
The following example shows how to create a set of Oracle triggers that send a delete event to Netcool/Impact.
CREATE OR REPLACE PACKAGE dept_pkg AS TYPE deptTable IS TABLE OF db_varray_type INDEX BY BINARY_INTEGER; dept1 deptTable; emptyDept deptTable; end; /
113
CREATE OR REPLACE TRIGGER dept_reset BEFORE INSERT OR UPDATE OR DELETE ON dept BEGIN dept_pkg.dept1 := dept_pkg.emptyDept; end; / CREATE OR REPLACE TRIGGER dept_after_row AFTER DELETE ON dept FOR EACH ROW BEGIN dept_pkg.dept1(dept_pkg.dept1.count + 1) := db_varray_type(EVENTSOURCE | SCOTT.DEPT, DEPTNO | ||:OLD.DEPTNO, LOC | ||:OLD.LOC, DNAME | || :OLD.DNAME, IMPACTED | ||:OLD.IMPACTED); end; / CREATE OR REPLACE TRIGGER dept_after_stmt AFTER INSERT OR UPDATE OR DELETE ON dept BEGIN for i in 1 .. dept_pkg.dept1.count loop test_varray_proc(dept_pkg.dept1(i)); end loop; end; /
114
115
116
117
118
Logon Event
The following example shows how to create a trigger that sends an event to Netcool/Impact when a user logs into the database.
CREATE OR REPLACE TRIGGER user_login AFTER logon on schema DECLARE my_login_varray db_varray_type; BEGIN my_login_varray := db_varray_type(TRIGGEREVENT | ||Sys.sysevent, EVENTSOURCE |||Sys.database_name, LOGINUSER | ||Sys.login_user, INSTANCENUM | ||Sys.instance_num, TRIGGERNAME | USER_LOGIN); test_varray_proc(my_login_varray); end; /
Logoff Event
The following example shows how to create a trigger that sends an event to Netcool/Impact when a user logs out of the database.
CREATE OR REPLACE TRIGGER user_logoff BEFORE logoff on schema DECLARE my_logoff_varray db_varray_type; BEGIN my_logoff_varray := db_varray_type(TRIGGEREVENT | ||Sys.sysevent, EVENTSOURCE |||Sys.database_name, LOGINUSER | ||Sys.login_user, INSTANCENUM | ||Sys.instance_num, TRIGGERNAME | USER_LOGOFF); test_varray_proc(my_logoff_varray); end; /
119
120
121
Activation Interval
The activation interval is the interval in seconds at which the policy activator runs the policy.
Policy
You must specify the name of the policy that you want the policy activator to run.
122
2.
Select Policy Activator from the Types list and click the New Service button. The Create New Policy Activator window appears.
3. 4. 5. 6.
Enter a unique name for the policy activator in the Service Name field. Enter the interval in seconds at which you want the policy activator to run the policy in the Activation Interval field. Select the policy that you want the policy activator to run from the Policy list. Click OK.
123
124
Policy Logger
The policy logger is the service responsible for managing the policy log. The policy log is a text stream used by Netcool/Impact to record messages generated during the runtime of a policy. The policy log contains both system messages issued by Netcool/Impact and messages that you create when you write a policy.
Error-Handling Policy
The error-handling policy is the policy that is executed by default, in the situation where an error is not handled by an error handler within the policy where the error occurred.
Policy Profiling
Policy profiling is a feature of Netcool/Impact that calculates the total time that it takes to run a policy and prints this time to the policy log. You can enable policy profiling when you configure the policy logger.
126
2. 3. 4. 5. 6. 7. 8.
Select a policy from the Error-Handling Policy list. Select a log level from the Highest Log Level list. Optional. Select the types of message you want to see in the policy log from the Log area. To enable policy profiling, select the Policy Profiling checkbox. Optional. To print the contents of the policy log to file, select the Service Log Write To File checkbox. Optional. To enable reporting, select the Collect Reports checkbox. Optional. Click OK.
Wakeup Interval
The wakeup interval is the interval in seconds at which the hibernating policy activator checks hibernating policies in the internal data repository to see if they are ready to be woken.
2. 3.
Enter the wakeup interval in seconds in the Polling Interval field. To enable the service to start automatically when you start Netcool/Impact, select the Startup checkbox. Optional.
128
4. 5.
To print the contents of the service log to file, select the Service Log Print to File checkbox. Optional. Click OK.
2. 3.
To print the service log to file, select the Service Log Print to File checkbox. Click OK.
129
2. 3. 4. 5.
Enter the port where you want to run the service in the Port field. You telnet to this port when you use the Netcool/Impact CLI. To enable the service to start automatically when you start Netcool/Impact, select the Startup checkbox. Optional. To print the contents of the service log to file, select the Service Log Print to File checkbox. Optional. Click OK.
130
2. 3. 4.
Enter the port number where you want to run the CORBA name service in the NSPort field. The default is 4500. To enable the service to start automatically when you start Netcool/Impact, select the Startup checkbox. Optional. Click OK.
131
132
Introduction
This is the beginning of Part Four of this guide. Part Four provides information about Netcool/Impact policies. This information includes general concepts and instructions for working with the Netcool/Impact policy language (IPL). This part of the guide contains the following chapters: Chapter 14. "Policy Fundamentals" on page 133. This chapter contains information on creating basic policies using the Netcool/Impact policy language. Chapter 15. "Handling Events" on page 147. This chapter contains information on handling events from with a policy. This includes working with incoming events, updating existing events, and sending and deleting events. Chapter 16. "Handling Data" on page 155. This chapter contains information on working with data located in data sources. This includes retrieving data, and adding, updating and deleting data. Chapter 17. "Handling Hibernations" on page 175. This chapter contains information on causing policies to hibernate, waking hibernations and removing existing hibernations from the internal data repository. Chapter 18. "Sending E-Mail" on page 181. This chapter contains information on sending e-mail from within a policy. Chapter 19. "Instant Messaging" on page 183. This chapter contains information on sending and receiving instant messages from within a policy.
133
Chapter 20. "Executing External Commands" on page 187. This chapter contains information on executing external commands, scripts and applications from within a policy. Chapter 21. "Handling Strings and Arrays" on page 193. This chapter contains information on handling strings and arrays in a policy. This includes finding the length of strings and arrays, finding unique objects in an array and using regular expressions to manipulate string data.
What Is a Policy?
A policy is a set of operations that you want Netcool/Impact to perform. These operations are specified using a programming language called the Netcool/Impact policy language, or IPL.
134
Policy Log
The policy log is a text stream that records messages created by Netcool/Impact during the runtime of a policy. The messages in the policy log provide information about the system status and about any exceptions that might occur. You can write custom messages to the log from within a policy using the Log function. You can view the contents of the policy log using the Netcool/Impact GUI.
135
To view the contents of the policy log: 1. In the Netcool/Impact GUI, click view log button for the Policy Logger service in the Service Status panel.
A new Policy Log tab opens in the Main Work panel and displays the policy log.
Policy Context
The policy context is the set of all the variables whose values are assigned in the current policy. The policy context includes built-in variables such as EventContainer as well as the variables that you define. You can access the value of this context from within a policy using the CurrentContext function. This function returns a string that contains the names and current value of all of the variables in the policy.
136
Policy Scope
The scope of all variables in a policy is global. This means that everywhere you use a function, it will reference the same value, regardless of whether you use it in the main program body or within a user-defined function.
Getting Started
This section contains sample policies that can help you get started developing your own policies. It contains the following examples: Printing to the Policy Log User-Defined Variables Arrays Contexts If Statements While Statements Action Functions Parser Functions User-Defined Functions
Here, you simply call the Log function and pass the string Hello, World! as an input parameter. As in programming languages like C/C+ and Java, you enclose string literals in double quotation marks.
137
When you run the policy, it prints the following to the policy log:
Hello, World!
User-Defined Variables
In the example in this section, you create a set of variables and assign values to them. Then, you use the Log function in two different ways to print the value of the variables to the policy log. The first way you use Log is to print out each of the values as a separate call to the function. The second way is the print out all of the variables in the policy context at once, using the CurrentContext function. As discussed in the previous section of this chapter, the CurrentContext function returns a string that contains the names and values of all of the variables currently defined in the policy.
VarOne = "One"; VarTwo = 2; VarThree = 3.0; VarFour = VarOne + ", " + VarTwo + ", " + VarThree; Log(VarOne); Log(VarTwo); Log(VarThree); Log(VarFour); Log(CurrentContext());
When you run this policy, it prints the following to the policy log:
One 2 3.0 One, Two, Three "Prepared with user supplied parameters "=(Escalation=5, EventContainer=(), VarTwo=Two, VarOne=One, ActionNodeName=TEMP, VarFour=One, Two, Three, VarThree=Three, ActionType=1)
As shown above, you do not have to declare variables before assigning their values in the way that you do in languages like C/C++ and Java. Arrays and scalar variables like integers or strings are created automatically the first time you assign a value to them. Contexts and event containers, however, must be explicitly created using the NewObject and NewEvent functions, as described later in this guide.
Arrays
The array is a native Netcool/Impact data type that you can use to store sets of related values. Unlike arrays in C/C++ or Java, a Netcool/Impact array can store elements of any combination of data types, including other arrays and contexts. You assign values to arrays using the curly braces notation. This notation requires you to enclose a comma separated list of the values to assign in curly braces. The values can specified as literals or as variables whose values you have previously defined in the policy.
138 Impact Version 4.0 Solutions Guide
You access the value of arrays using the square bracket notation, just as in C/C++ or Java. This notation requires you to specify the name of the array followed by the index number of the element enclosed in square brackets. Arrays in Netcool/Impact are zero-based, which means that the first element in the array has an index value of 0. In the following policy, you assign a set of values to arrays and then print the values of their elements to the policy log.
Array1 = {"One", "Two", "Three", "Four", "Five"}; Array2 = {1, 2, 3, 4, 5}; Array3 = {"One", 2, "Three", 4, "Five"}; String1 = "One"; String2 = "Two"; Array4 = {String1, String2}; Log(Array1[0]); Log(Array2[2]); Log(Array3[4]); Log(Array4[1]); Log(CurrentContext());
Here, you assign sets of values to four different arrays. In the first three arrays, you assign a variety of string and integer literals. In the fourth array, you assign variables as the array elements. When you run the policy, it prints the following to the policy log:
One 3 4 Two "Prepared with user supplied parameters "=(String2=Two, ActionType=1, String1=One, EventContainer=(), ActionNodeName=TEMP, Escalation=6, Array4={One, Two}, Array3={One, 2, Three, 4, Five}, Array2={1, 2, 3, 4, 5}, Array1={One, Two, Three, Four, Five})
Contexts
Contexts are another native Netcool/Impact data type that you can use to store sets of data. Contexts are similar to the struct data type in C/C++. Like arrays, contexts can be used to store elements of any combinations of data types, including other contexts and arrays. The data elements in a context are a set of named variables called member variables. You access member variables using the dot notation. In this notation, you specify the name of the context and the name of the member variable separated by a period (.). You use this notation when you assign values to member variables and when you reference the variables elsewhere in a policy.
139
Unlike arrays and scalar variables, you must explicitly create a new context using the NewObject function before you can use it in a policy. You do not need to create the member variables in the context. These are created automatically the first time you assign their value. The following policy shows how to create a context called MyContext and assign a set of values to its member variables.
MyContext = NewContext(); MyContext.One = "One"; MyContext.Two = 2; MyContext.Three = 3.0; String1 = MyContext.One + ", " + MyContext.Two + ", " + MyContext.Three; Log(String1)
When you run this policy, it prints the following to the policy log:
One, 2, 3.0
If Statements
The If statement allows you to control which statements in a policy are executed by testing the value of an expression to see if it is true. The If statement in the Netcool/Impact policy language is the same as that used in programming languages like C/C++ and Java. The syntax for an If statement is the If keyword followed by a boolean expression enclosed in parentheses. This expression is followed by a block of statements enclosed in curly braces. Optionally, the If statement can be followed by the Else or ElseIf keywords, which are also followed by a block of statements. When Netcool/Impact encounters the If keyword in a policy, it evaluates the boolean expression to see if it is true. If the expression is true, the statement block that follows is executed. If it is not, true Netcool/Impact skips the statements in the block. If an Else statement follows in the policy, Netcool/Impact executes the corresponding Else statement block. The following policy shows how to use the If statement.
Integer1 = 0; If (Integer1 == 0) { Log("The value of Integer1 is zero."); }
Here, you use the If statement to test the value of the Integer1 variable. If the value of Integer1 is 0, the policy will execute the statements in the statement block.
140
When you run this policy, it prints the following to the policy log:
The value of Integer1 is zero.
Here, you set the value of the Integer1 variable to 2. Since the first test in the If statement fails, the statement block that follows the Else statement is executed. When you run this example, it prints the following to the policy log:
The value of Integer1 is not one.
While Statements
The While statement allows you to repeat a set of operations until a specified condition is true. The While statement in the Netcool/Impact policy language is the same as that used in programming languages like C/C++ and Java. The syntax for the While statement is the While keyword followed by a boolean expression enclosed in parentheses. This expression is followed by a block of statements enclosed in curly braces. When Netcool/Impact encounters the While keyword in a policy, it evaluates the boolean expression to see if it is true. If the expression is true, the statements in the following block are executed. After the statements are executed, Netcool/Impact again tests the expression and continues executing the statement block repeatedly until the condition is false. The most common way to use the While statement is to construct a loop that is executed a certain amount of times depending on other factors in a policy. To use the While statement in this way, you use an integer variable as a counter. You set the value of the counter before the While loop begins and decrement it inside the loop. The While statement tests the value of the counter each time the loop is executed and exits when the value of the counter is zero. The following example shows a simple use of the While statement:
Counter = 10; While (Counter > 0) { Log("The value of Counter is " + Counter); Counter = Counter - 1; }
141
Here, you assign the value of 10 to a variable named Counter. In the While statement, the policy tests the value of Counter to see if it is greater than zero. If Counter is greater than zero, Netcool/Impact executes the statements in the block that follows. The final statement in the block decrements the value of Counter by one. The While loop in this example executes ten times before exiting. When you run this example, it prints the following to the policy log:
The The The The The The The The The The value value value value value value value value value value of of of of of of of of of of Counter Counter Counter Counter Counter Counter Counter Counter Counter Counter is is is is is is is is is is 10 9 8 7 6 5 4 3 2 1
The following example shows how to use the While statement to iterate through an array. You often use this technique when you handle data items retrieved from a data source.
MyArray = {"One", "Two", "Three", "Four"}; Counter = Length(MyArray); While (Counter > 0) { Index = Counter - 1; Log(MyArray[Index]); Counter = Counter - 1; }
Here, you set the value of Counter to the number of elements in the array. The While statement loops through the statement block once for each array element. You set the Index variable to the value of the Counter minus one. This is because Netcool/Impact arrays are zero-based. This means that the index value of the first element is 0, rather than 1. When you run this example, it prints the following to the policy log:
Four Three Two One
As you can see in the examples above, when you use this technique to iterate through the elements in an array, you access the elements in reverse order. To avoid this, you can increment the counter variable instead of decrementing it in the loop. This requires you to test whether the counter is less than the number of elements in the array inside the While statement.
142
The following example shows how to loop through an array while incrementing the value of the counter variable.
MyArray = {"One", "Two", "Three", "Four"}; ArrayLength = Length(Array); Counter = 0; While (Counter < ArrayLength) { Log(MyArray[Counter]); Counter = Counter + 1; }
When you run this policy, it prints the following to the policy log:
One Two Three Four
Action Functions
Netcool/Impact provides a pre-defined set of functions called action functions that you can use to perform the core functionality of a Netcool/Impact policy. You use action functions to handle events, handle data, send e-mail, execute external commands and perform a variety of other tasks. For a complete list of the available action functions, see the Netcool/Impact Policy Language Reference. You call action functions in the same way you call functions in programming languages like C/C++ and Java. The syntax for calling an action function is the name of the function followed by a comma-separated list of input parameters. The parameters are enclosed in parentheses. If the function returns a value, you must specify a return variable for the function. The following example shows how to call the SendEmail function. The SendEmail function sends an e-mail to the specified addressee.
User = NULL; Address = "admin@example.com"; Subject = "URGENT: Node not responding"; Message = "This is an urgent message from Netcool/Impact. Node ID3849 is not responding to network ping."; Sender = "Netcool/Impact"; ExecuteOnQueue = False; SendEmail(User, Address, Subject, Message, Sender, ExecuteOnQueue);
Here, you define a set of variables and then pass them as input parameters to the SendEvent function. It is also possible to pass literal values to the function instead of variables. However, you can increase the readability of your policies by using meaningful variable names in this way.
Chapter 14. Policy Fundamentals 143
The following example shows how to call the GetByFilter function. The GetByFilter function retrieves data from a data source using a filter as the query condition.
DataType = "Admin"; Filter = "Location = London"; CountOnly = False; MyResults = GetByFilter(DataType, Filter, CountOnly);
Here, as in the previous example, you define a set of variables and then pass them as input parameters to the function. GetByFilter returns an array. In this example, the array is stored in a variable named MyResults.
Parser Functions
Parser functions are another set of functions that are pre-defined by Netcool/Impact. These functions help you perform common tasks such as manipulating strings, converting values to different data types and formatting date and time strings. For a complete list of the available parser functions, see the Netcool/Impact Policy Language Reference. As with action functions, you call parser functions in the same way you call functions in programming languages like C/C++ and Java. The syntax for calling an parser function is the name of the function followed by a comma-separated list of input parameters. The parameters are enclosed in parentheses. If the function returns a value, you must specify a return variable for the function. The following example shows how to call the Split function. The Split function splits a string into multiple substrings.
MyString = "This|is|a|test."; Delimiter = "|"; MyArray = Split(MyString, Delimiter);
Here, you define a set of variables and then pass them as input parameters to the function. The function returns an array of substrings.
User-Defined Functions
Netcool/Impact also allows you to declare your own functions and call them within a policy. User-defined functions help you encapsulate and re-use functionality in your policy. The syntax for a function declaration is the Function keyword followed by the name of the function and a comma-separated list of input parameters. The list of input parameters is followed by a statement block enclosed in curly braces. Unlike action and parser functions, you cannot specify a return value for a user-defined function. However, because the scope of variables in a Netcool/Impact policy is global, you can approximate this functionality by setting the value of a return variable inside the function.
144 Impact Version 4.0 Solutions Guide
Function declarations must appear in a policy before any instance where the function is called. The best practice is to declare all functions at the beginning of a policy. The following example shows how to declare a user-defined function called GetNodeByHostname. This function looks up a node in an external data source using the supplied hostname.
Function GetNodeByHostName(Hostname) { DataType = "Node"; Filter = "Hostname =" + Hostname + ""; CountOnly = False; MyNodes = GetByFilter(DataType, Filter, CountOnly); MyNode[0] = MyNodes; }
You call user-defined functions in the same way that you call other types of functions. The following example shows how to call the function declared above.
GetNodeByHostName("ORA_HOST_01");
Here, the name of the node that you want to look up is ORA_HOST_01.The function looks up the node in the external data source and returns a corresponding data item named MyNode. For more information on looking up data and on data items, see the next chapter in this book.
145
146
About Events
This section contains overview information about events. It contains the following topics: What are Events? What are Event Sources? How Does Netcool/Impact Obtain Events? How Does Netcool/Impact Handle Events? What Can I Do with Events in a Policy?
147
148
149
Example
The following policy shows how to use the dot notation to access the value of the Node, Severity and Summary fields in an incoming event and print them to the policy log:
Log(EventContainer.Node); Log(EventContainer.Severity); Log(EventContainer.Summary);
Example
The following policy shows how to use the @ notation to access the value of the Node, Severity and Summary fields in an incoming event and print them to the policy log:
Log(@Node); Log(@Severity); Log(@Summary);
Examples
The following examples show how to update the Summary and Severity fields in an incoming event.
@Summary = "Node down"; @Summary = @Summary + ": Updated by Netcool/Impact"; @Severity = 3; @Severity = @Severity + 1;
150
Example
The following example shows how to add a new journal entry to an incoming event.
// Assign the journal entry text to the JournalEntry variable @JournalEntry = Modified on + LocalTime(GetDate()) + "\r\n" + Modified by Netcool\Impact.; // Send the event to the event source using ReturnEvent ReturnEvent(EventContainer);
151
For more information on adding journal entries, see "Assigning the JournalEntry Variable" on page 151.
152
The following example shows how to send the event to the event source.
ReturnEvent(MyEvent);
Example
The following example shows how to create, populate and send a new event to an event source.
// Create a new event container MyEvent = NewEvent("defaulteventreader"); // Populate the event container member variables MyEvent.Node = "192.168.1.1"; MyEvent.Summary = "Node down"; MyEvent.Severity = 5; MyEvent.AlertKey = MyEvent.Node + ":" + MyEvent.Summary; // Add a journal entry (optional) MyEvent.JournalEntry = Modified on + LocalTime(GetDate()) + "\r\n" + Modified by Netcool/Impact"; // Send the event to the event source ReturnEvent(MyEvent);
Deleting Events
To delete an incoming event from the event source, you do the following: Set the DeleteEvent variable in the event container Send the event to the event source using the ReturnEvent function
153
Example
The following example shows how to delete an incoming event from the event source.
// Set the DeleteEvent Variable @DeleteEvent = True; // Send the event to the event source ReturnEvent(EventContainer);
154
About Data
This section contains overview information about handling data in a Netcool/Impact policy. It contains the following topics: What Kind of Data Can I Handle in a Policy? What Can I Do with Data in a Policy?
155
Add data to a data source Update data in a data source Delete data in a data source Call database functions Call stored procedures
156
It contains the following sections: What Does It Mean to Retrieve Data By Filter? What Is a Filter? How Do I Retrieve Data By Filter? Examples
What Is a Filter?
A filter is a text string that sets out the conditions under which Netcool/Impact retrieves the data items. When you compose the filter string, you are telling Netcool/Impact, "Give me all the data items in this type, where the value of the Location field is New York," or "Give me all the data items in this type, where the IPAddress field is 192.168.1.1." The format of the filter string varies depending on the category of the data type.
SQL Filters
For SQL database and internal data types, the filter is an SQL WHERE clause that provides a set of comparisons that must be true in order for a data item to be returned. These comparisons are typically between field names and their corresponding values. The type of comparison is specified by one of the standard comparison operators (<, >, =, <=, >=, != and LIKE). Multiple comparisons can be used together with the AND and NOT operators. Any string literals in an SQL filter must be enclosed in single quotation marks. For SQL database data types, the syntax of the SQL filter is specified by the underlying data source. When Netcool/Impact goes to the data source to retrieve the data items, it passes this filter directly to the data source for processing. For internal data types, the SQL filter is processed internally by Netcool/Impact. The following examples show some typical SQL filters.
157
To get all data items where the value of the Location field is New York:
Location = New York
To get all data items where the value of the Location field is New York or New Jersey:
Location = New York OR Location = New Jersey
To get all data items where the value of the Location field is Chicago or Los Angeles and the value of the Level field is 3:
(Location = New York OR Location = New Jersey) AND Level = 3
Complete syntax and additional examples for SQL filters are provided in the Netcool/Impact Policy Reference Guide.
LDAP Filters
For LDAP database types, the filter is an LDAP filter string as described in Internet RFC 2254. As with SQL filters, LDAP filters provide a set of comparisons that must be true in order for a data item to be returned. These comparisons are typically between field names and their corresponding values. The comparison operators supported in LDAP filters are =, ~=, <, <=, >, >= and !. One difference between LDAP filters and SQL filters is that any boolean operators used to specify multiple comparisons must be prepended to the expression. Another difference is that string literals are not specified using quotation marks. The following examples show some typical LDAP filters. To get all data items where the common name value is Mahatma Gandhi:
(cn=Mahatma Gandhi)
To get all data items where the value of the location attribute does not begin with the string NYC.
(!(location=NYC*))
To get all data items where the value of the facility attribute is Wandsworth or Putney:
(|(facility=Wandsworth)(facility=Putney))
Complete syntax and additional examples for LDAP filters are provided in the Netcool/Impact Policy Reference Guide.
Mediator Filters
The syntax for Mediator filters vary depending on the underlying DSA. For more information on the Mediator syntax for a particular DSA, see the DSA documentation.
158
Examples
The examples below show how to retrieve data by filter.
Example 1
The following example shows how to retrieve data from an SQL database data type. In this example, you get all of the data items from a data type named Node where the value of the Location field is New York and the value of the TypeID field is 012345. Then, you print the data item fields and values to the policy log using the Log and CurrentContext functions.
// Call GetByFilter and pass the name of the data type // and the filter string. DataType = "Node"; Filter = "Location = New York AND TypeID = 012345"; CountOnly = False; MyNodes = GetByFilter(DataType, Filter, CountOnly); // Log the data item field values. Log(CurrentContext());
159
Example 2
The following example also shows how to retrieve data from an SQL database data type. In this example, you get all of the data items from a data type named Node where the value of the IPAddress field equals the value of the Node field in an incoming event. As above, you print the fields and values in the data items to the policy log.
// Call GetByFilter and pass the name of the data type // and the filter string. DataType = "Node"; Filter = "IPAddress = " + @Node + ""; CountOnly = False; MyNodes = GetByFilter(DataType, Filter, CountOnly); // Log the data item field values. Log(CurrentContext());
Make sure that you understand the filter syntax used in the sample code above. When using the value of a variable inside an SQL filter string, the value must be encapsulated in single quotation marks. This is because Netcool/Impact processes the filter string in two stages. During the first stage, it evaluates the variable. During the second stage, it concatenates the filter string and sends it to the data source for processing. A shorter version of this example is as follows:
MyNodes = GetByFilter("Node", "Location = " + @Node + "", False); Log(CurrentContext());
Example 3
The following example shows how to retrieve data from an LDAP data type. In this example, you get any data items from a data type named User where the value of the cn (common name) field is Brian Huang. Then, you print the data item fields and values to the policy log using the Log and CurrentContext functions.
// Call GetByFilter and pass the name of the data type // and the filter string. DataType = "User"; Filter = "(cn=Brian Huang)"; CountOnly = False; MyUsers = GetByFilter(DataType, Filter, CountOnly); // Log the data item field values. Log(CurrentContext());
160
Example 4
The following example also shows how to retrieve data from an LDAP data type. In this example, you get all data items from a data type named Node where the value of the Location field is New York or New Jersey. As above, you print the fields and values in the data items to the policy log.
// Call GetByFilter and pass the name of the data type // and the filter string. DataType = "Node"; Filter = "(|(Location=NewYork)(Location=New Jersey))"; CountOnly = False; MyNodes = GetByFilter(DataType, Filter, CountOnly); // Log the data item field values Log(CurrentContext());
Example 5
The following example shows how to look up data from a Smallworld DSA Mediator data type. Smallworld is a network inventory manager developed by GE Network Solutions. Netcool/Impact provides a Mediator DSA and a set of predefined data types that allow you to read network data from the Smallworld NIS. In this example, the you get all of the data items from the SWNetworkElement data type where the value of ne_name is DSX1 PNL-01 (ORP). Then, you print the data item fields and values to the policy log using the Log and CurrentContext functions.
// Call GetByFilter and pass the name of the data type // and the filter string. DataType = "SWNetworkElement"; Filter = "ne_name = DSX1 PNL-01 (ORP)"; CountOnly = False; MyElements = GetByFilter(DataType, Filter, CountOnly); // Log the data item field values. Log(CurrentContext());
161
What Is a Key?
A key is a special field in a data type that uniquely identifies a data item. You specify key fields when you create a data type. The most common way to use the key field is to use it to identify a key field in the underlying data source. For more information on data type keys, see "Data Type Keys" on page 38.
162
Netcool/Impact determines if the key field values match by comparing each value in the array with the corresponding key field on a one-by-one basis. For example, if you have a data type with two key fields named Key_01 and Key_02 and you use a key expression of {"KEY_12345", "KEY_93832"}, the function compares KEY_12345 with the value of Key_01 and KEY_93832 with the value of Key_02. If both fields match the specified values, the function returns the data item. If only one field or no fields match, the data item is not returned.
Examples
The examples below show how to retrieve data by key.
Example 1
The following example shows how to return data from a data type using a single key expression. In this example, you retrieve a data item from a data type called Node where the value of the key field is ID-00001. Then, you print the data item fields and values to the policy log using the Log and CurrentContext functions.
// Call GetByKey and pass the name of the data type // and the key expression. DataType = "Node"; Key = "ID-00001"; MaxNum = 1; MyNodes = GetByKey(DataType, Key, MaxNum); // Log the data item field values. Log(CurrentContext());
163
Example 2
The following example shows how to return data by key using a multiple key expression. In this example, you retrieve a data item from a data type called Customer where the value of its key fields are R12345 and D98776. As above, you print the fields and values in the data items to the policy log.
// Call GetByKey and pass the name of the data type. // the key expression. Type = "Customer"; Key = {"R12345", "D98776"}; MaxNum = 1; MyCustomers = GetByKey(Type, Key, MaxNum); // Log the data item field values. Log(CurrentContext());
164
What Is a Link?
A link is an element of the data model that defines a relationship between different units or sets of data. Netcool/Impact supports two type of links: dynamic links and static links. Dynamic links define a relationship between two data types. Static links define a relationship between two data items. For more information on links, see Chapter 6. "Working with Links" on page 53.
Examples
The examples below show how to retrieve data by link.
Example 1
This example shows how to retrieve data by link. In this example, you call GetByFilter and retrieve a data item from the Node data type whose Hostname value matches the Node field in an incoming event. Then you call GetByLinks to retrieve all of the data items in the Customers data type that are linked to the Node. In this example, you print the fields and values in the data items to the policy log before exiting.
// Call GetByFilter and pass the name of the data type // and the filter string. DataType = "Node"; Filter = "Hostname = " + @Node + ""; CountOnly = False; MyNodes = GetByFilter(DataType, Filter, CountOnly); // Call GetByLinks and pass the target data type, // the maximum number of data items to retrieve and // the source data item. DataTypes = {"Customer"}; Filter = ""; MaxNum = "10000"; DataItems = MyNodes; MyCustomers = GetByLinks(DataTypes, Filter, MaxNum, DataItems); // Log the data item field values. Log(CurrentContext()); Chapter 16. Handling Data 165
Example 2
This example also shows how to retrieve data by link. In this example, you use a link filter to specify a subset of data items in the target data type to return. As above, you call GetByFilter and retrieve a data item from the Node data type whose Hostname value matches the Node field in an incoming event. Then you call GetByLinks to retrieve all of the data items in the Customers data type whose Location is New York that are linked to the Node. You then print the fields and values in the data items to the policy log before exiting.
// Call GetByFilter and pass the name of the data type // and the filter string. DataType = "Node"; Filter = "Hostname = " + @Node + ""; CountOnly = False; MyNodes = GetByFilter(DataType, Filter, CountOnly); // Call GetByLinks and pass the target data type, // the maximum number of data items to retrieve and // the source data item. DataTypes = {"Customer"}; Filter = "Location = New York"; MaxNum = "10000"; DataItems = MyNodes; MyCustomers = GetByLinks(DataTypes, Filter, MaxNum, DataItems); // Log the data item field values. Log(CurrentContext());
166
Adding Data
To add a data item to a data type, you do the following: Create a new context using the NewObject function Populate the member variables in the context Add the data item
167
Example
The following example shows how to add a data item to a data type. In this example, the data type is named User. The User data type contains the following fields: Name, Location and ID.
// Create new context. MyUser = NewObject(); // Populate the member variables in the context. MyUser.ID = "00001"; MyUSer.Name = "Jennifer Mehta"; MyUser.Location = "New York"; // Call AddDataItem and pass the name of the data type // and the context. DataType = "User"; AddDataItem(DataType, MyUser);
Updating Data
This section contains information on deleting data items from a data type. It contains the following topics: Updating Single Data Items Updating Multiple Data Items
168
The following example shows how to update a single data item. In this example, you call GetByFilter and retrieve a data item from a data type called Node. Then you change the value of the corresponding field variables.
// Call GetByFilter and pass the name of the data type // and the filter string. DataType = "Node"; Filter = "Location = " + @Node + ""; CountOnly = False; MyNodes = GetByFilter(DataType, Filter, CountOnly); MyNode = MyNodes[0]; // Update the values of the field variables in MyNode // Updates are made in real time in the data source MyNode.Name = "Host_01"; MyNode.ID = "00001"; // Log the data item field values. Log(CurrentContext());
169
The following example shows how to update multiple data items. In this example, you update all of the data items in the Customer data type whose Location is New York. The update changes the values of the Location and Node fields. Then, you retrieve the same data items using GetByFilter to verify the update. Before exiting, you print the data item field values to the policy log.
// Call BatchUpdate and pass the name of the data type, // the filter string and an update expression DataType = "Customer"; Filter = "Location = New York"; UpdateExpression = "Location = London, Node = Host_02"; BatchUpdate(DataType, Filter, UpdateExpression); // Call GetByFilter and pass the name of the data type // and a filter string DataType = "Customer"; Filter = "Location = London"; CountOnly = False; MyCustomers = GetByFilter(DataType, Filter, CountOnly); // Log the data item field values. Log(CurrentContext());
Deleting Data
This section contains information on deleting data items from a data type. It contains the following topics: Deleting Single Data Items Deleting Multiple Data Items
170
Example
The following example shows how to delete a data item. In this example, you delete a data item from a data type named User where the value of the Name field is John Rodriguez. Because the data type (in this case) only contains one matching data item, you can reference it as MyUsers[0].
// Call GetByFilter and pass the name of the data type // and the filter string. DataType = "User"; Filter = "Name = John Rodriguez"; CountOnly = False; MyUsers = GetByFilter(DataType, Filter, CountOnly); MyUser = MyUsers[0]; // Call DeleteDataItem and pass the data item. DeleteDataItem(MyUser);
171
The following example shows how to delete multiple data items by filter. In this example, you delete all of the data items in a data type named Node, where the value of Location is New York.
// Call BatchDelete and pass the name of the data type // and a filter string that specifies which data items to delete DataType = "Node"; Filter = "Location = New York"; DataItems = NULL; BatchDelete(DataType, Filter, DataItems);
172
Example
The following example shows how to call the database COUNT function within a policy. In this example, you count the number of data items in the Node data type, where the value of the Location field is New York. Then, you print the number of items counted to the policy log.
// Call CallDBFunction and pass the name of the data type, // a filter string and the function expression. DataType = "Node"; Filter = "Location = New York"; Function = "COUNT()"; NumItems = CallDBFunction(DataType, Filter, Function); // Print the number of counted items to the policy log. Log(NumItems);
173
174
About Hibernations
This section contains overview information about hibernations. It contains the following topics: What Are Hibernations? What Is the Hibernation Data Type? What Are Action Keys? What Is the Hibernation Timeout Value? What Can I Use Hibernations For? What Can I Do with Hibernations in a Policy?
175
Hibernating a Policy
To hibernate a policy, you call the Hibernate function and pass an action key and the number of seconds for it to hibernate. The action key can be any unique string you want to use to identify the policy. Typically, you obtain this string by doing any combination of the following: Use the value of the Identifier field in an incoming ObjectServer event. The ObjectServer generates a unique Identifier value for each event. Use the Random function to generate a random value. Use the GetDate function to generate a value based on the current system time. This is only appropriate for scenarios in which you are processing or fewer events per second.
176
Examples
The following examples show how to hibernate a policy.
Example 1
In this example, the action key is the value of the Identifier field in an incoming ObjectServer event. This policy will hibernate for sixty seconds before being woken by the hibernating policy activator.
// Call Hibernate and pass an action key and the timeout // value for the hibernation. ActionKey = @Identifier; Reason = NULL; Timeout = 60; Hibernate(ActionKey, Reason, Timeout);
Example 2
In this example, the action key is a combination of the current system time and a random value. This policy will hibernate for two minutes before being woken by the hibernating policy activator.
// Call Hibernate and pass an action key and the timeout // value for the hibernation. ActionKey = GetDate() + "_" + Random(9999); Reason = NULL; Timeout = 120; Hibernate(ActionKey, Reason, Timeout);
Retrieving Hibernations
Retrieving hibernations is the way that you get data items from the Hibernation data type. You must retrieve a hibernation before you can wake it from within a policy or remove it. You can retrieve hibernations by: Action key search Filter
177
178
Waking a Hibernation
To wake a hibernation, you do the following: Retrieve the hibernation using GetHibernatingPolicies or GetByFilter Call ActivateHibernation
Calling ActivateHibernation
After you have retrieved the hibernation, you can call the ActivateHibernation function and pass the data item as an input parameter.
Example
The following example shows how to wake a hibernation. In this example, you wake a hibernation policy whose action key value is ActionKeyABC.
// Call GetHibernatingPolicies and pass the start action key // and end action key values. StartActionKey = "ActionKeyAAA"; EndActionKey = "ActionKeyZZZ"; MaxNum = 10000; MyHibers = GetHibernatingPolicies(StartActionKey, EndActionKey, MaxNum); MyHiber = MyHibers[0]; // Call ActivateHibernation and pass the Hibernation data item as // an input parameter. ActivateHivernation(MyHiber);
Removing Hibernations
To remove a hibernation from the internal data repository, you call the RemoveHibernation function and pass the action key of the hibernation as an input parameter.
179
Example
The following example shows how to remove a hibernation. In this example, the action key for the hibernation is ActionKeyABC.
RemoveHibernation("ActionKeyABC");
180
Sending an E-Mail
To send e-mail you call the SendEmail function and pass the following information as input parameters: The e-mail address of the recipient The subject line text for the e-mail The body content of the e-mail The name of the e-mail sender
The following example shows how to send an e-mail. In this example, you send the e-mail to the address admin@example.com.
// Call SendEmail and pass the addressee, subject, body content and sender as // input parameters. Address = "admin@example.com"; Subject = "URGENT: Node down"; Message = "URGENT MESSAGE: Node 1237ASDS is not responding to network ping."; Sender = "Netcool/Impact"; ExecuteOnQueue = False; SendEmail(Address, Subject, Message, Sender, ExecuteOnQueue);
181
182
About Netcool/Impact IM
This section contains overview information about Netcool/Impact instant messaging (IM). It contains the following topics: What Is Instant Messaging? What Is Netcool/Impact IM? What Are the Netcool/Impact IM Components? How Does Netcool/Impact IM Work? How Do I Set Up Netcool/Impact IM?
183
Message Listening
During the message listening phase, the Jabber reader service listens for new messages from one or more IM accounts. When a new message is received, the Jabber reader creates a new EventContainer and populates it with the contents of the incoming message. Then, the Jabber reader starts the policy specified in its configuration settings and passes it the EventContainer. Netcool/Impact then processes the policy.
Message Sending
Message sending is the phase during which Netcool/Impact sends new messages via the Jabber service. Message sending occurs during the execution of a policy when Netcool/Impact encounters a call to the SendInstantMessage function. When Netcool/Impact processes a call to SendInstantMessage, it passes the message content, recipient and other information to the Jabber service. The Jabber service then assembles the message and sends it to a Jabber server where it is routed to the specified recipient.
Sending Messages
You send instant messages from within a policy using the SendInstantMessage function. This function requires you to specify the recipient and the body content of the message. You can also specify a subject, a chatroom ID and whether to send the message directly or put it on the message queue for processing by the command execution manager service. For a complete description of this function, see the Netcool/Impact Policy Reference Guide.
Example
The following example shows how to send and receive instant messages using Netcool/Impact IM. In this example, the Jabber reader service calls the policy whenever an incoming message is received. The policy then confirms receipt of the message and performs a different set of actions, depending on whether the message sender is NetcoolAdmin or NetcoolOps.
// Call SendInstantMessage and pass the name of the recipient and the content // of the message as message parameters To = @From // Recipient is sender of the original message TextMessage = "Message receipt confirmed."; SendInstantMessage(To, NULL, NULL, TextMessage, False); If (@From == "NetcoolAdmin") { Log("Message received from user NetcoolAdmin."); Log("Message contents: " + @Body); If (@From == "NetcoolOps") { Log("Message received from user NetcoolOps."); Log("Message contents: " + @Body); } Else { Log("Message received from unrecognized user."); Log("Message contents: " + @Body);
185
186
187
Example
The following example shows how to execute an external command using the JRExec server. In this example, you send a page to an administrator using a paging application named pageit that is installed in the /opt/pager/bin directory on the system. The pageit application takes the phone number of the pagee and the return contact number as command line arguments. In this application, the JRExec server waits for the application to finish before continuing to process any other commands.
// Call JRExecAction and pass the command string and // other parameters Command = "/opt/pager/bin/pageit"; Args = {"2125551212", "2126353131"}; ExecuteOnQueue = False; Timeout = 60; JRExecAction(Command, Args, ExecuteOnQueue, Timeout); 188 Impact Version 4.0 Solutions Guide
where filename is the path and filename of the target JRExec Server logfile. The JRExec Server properties file is named jrexecserver.props and is located in the $NCHOME/impact/etc directory.
189
Examples
The following example shows how to send a command to the local system. In this example, you connect to the telnet application running on port 23 on localhost and send the touch command.
// Call CommandResponse and pass the required values as // input paramaters Host = "localhost"; UserName = "user_01"; Password = "p4ssw0rd"; InitialPrompt = "localhost{user_01}:"; Port = 23; Timeout = 60; Expiration = 60; Session = CommandResponse(Host, UserName, Password, InitialPrompt, Port, Timeout, Expiration); // Send command Session.SendCommand = "touch cr_test.txt"; Session.ExpectList = {"ulysses{user_01}:"}; // Disconnect Session.Disconnect = True;
The following example shows how to send a command to a remote system for which you expect a response. In this example, you connect to the telnet application running on port 23 of a system named ulysses and send the ls command.
// Call CommandResponse and pass the required values as // input paramaters Host = "ulysses"; UserName = "user_01"; Password = "p4ssw0rd"; InitialPrompt = "ulysses{user_01}:"; Port = 23; Timeout = 60; Expiration = 60; Session = CommandResponse(Host, UserName, Password, InitialPrompt, Port, Timeout, Expiration); // Set the value of the ExpectList variable to a substring that // matches the expected response Session.SendCommand = "ls"; Session.ExpectList = {"ulysses{user_01}:"};
190
// Print the response received from the remote system to the policy log Log(Session.ResponseReceived); // Disconnect Session.Disconnect = True;
191
192
Handling Strings
The Netcool/Impact policy language allows you to manipulate strings in a variety of ways. You can do the following with strings: Concatenate strings Find the length of a string Split a string into substrings Extract a substring from another string Replace a substring in a string Strip a substring from a string Trim whitespace from a string Change the case of a string Encrypt and decrypt strings
Concatenating Strings
To concatenate strings, you use the addition operator (+). You can concatenate two strings or multiple strings at once. You can also concatenate a string with a numeric value. The following example shows how to concatenate strings.
String1 = "This"; String2 = "is a test"; String3 = String1 + " " + String2; Log(String3); String4 = "The value of X is" + 5; Log(String4);
193
When you run this example, it prints the following to the policy log:
This is a test The value of X is 5
When you run this example, it prints the following to the policy log:
15
When you run this example, it prints the following to the policy log:
Four Three Two One
194
When you run this example, it prints the following to the policy log:
is
When you run this example, it prints the following to the policy log:
This is not a test.
195
When you run this example, it prints the following to the policy log:
This is a test.
When you run this example, it prints the following to the policy log:
This is a test.
When you run this example, it prints the following to the policy log:
this is a test.
You can change the case of a string to all upper case using the ToUpper function. The following example shows how to change a string to upper case.
Log(ToUpper("this is a test.");
When you run this example, it prints the following to the policy log:
THIS IS A TEST.
196
You can encrypt a string using the Encrypt function. This function takes the string as an input parameter and returns an encrypted version. The following example shows how to encrypt a string.
MyString = Encrypt("password");
You can decrypt a string that you have previously encrypted using the Decrypt function. This function takes an encrypted string as an input parameter and returns the plaintext version. The following example shows how to decrypt a string.
MyString = Decrypt("AB953E4925B39218F390AD2E9242E81A");
Handling Arrays
The Netcool/Impact policy language allows you to do the following with arrays: Find the length of an array Find the distinct values in an array.
When you run this example, it prints the following to the policy log:
3
When you run this example, it prints the following to the policy log:
{One, Two, Three}
197
198
Overview
Event enrichment is an automated process in which Netcool/Impact monitors an event source for new events, looks up information related to them in an external data source and then adds the information to them. Event enrichment is one of the most common and valuable things users do with Netcool/Impact. This chapter contains a tutorial that you can use to learn about event enrichment. You should read this chapter and become familiar with the concepts, tasks and other information that it provides before you start developing your own solutions with Netcool/Impact.
Tutorial Goal
The goal of this tutorial is to develop an event enrichment solution that will enhance the value of an existing Netcool installation. This solution should automate common tasks performed manually by the network operators and help to integrate related business data with alerts in the Netcool/OMNIbus ObjectServer. This tutorial leads you through the following steps: Understanding the Netcool installation Understanding the business data Analyzing the workflow in the environment
199
Creating a project Setting up a data model Setting up services Writing an event enrichment policy Configuring the event reader to run the policy Running the complete solution
Sample Environment
This tutorial uses a sample environment that provides the background for understanding various event enrichment concepts and tasks. This environment is a network operations center for a large enterprise where the company has installed and configured Netcool/OMNIbus and is currently using it to manage devices on its network. The sample environment is a scaled down representation of what you might actually find in a real-world operations center. It contains only the network elements and business data needed for this tutorial.
200
The information you want to use is stored in two databases named ORA_01 and ORA_02. ORA_01 is a network inventory database that stores information on the devices in the network, including their technical specification, facility locations and rack numbers. ORA_02 is a database that contains information about the various departments in the business. These are located on systems named ORA_HOST_01 and ORA_HOST_02 respectively. They run on port 1521
The operators might perform other actions, like looking up the administrators on call at the facility where the device is located and contacting them by phone or pager. After the problem that caused the alert has been addressed, the operators might also record the resolution in a problem log and delete the alert from the ObjectServer. For this tutorial, however, you will only use the workflow tasks listed above.
201
3.
4.
202
5. 6.
3.
4.
Click the New Data Source button. The New Data Source window appears.
5. 6. 7. 8. 9.
Enter NCOMS in the Data Source Name field. Enter the name and password of an ObjectServer user in the Username and Password fields. Enter NCO_HOST_01 in the Primary Hostname field. Enter 4100 in the Primary Port field. Click Test Connection to test the ObjectServer connection.
10. Enter NCO_HOST_02 in the Backup Hostname field. 11. Enter 4100 in the Backup Port field. 12. Click Test Connection to test the ObjectServer connection. 13. Click OK.
204
2.
205
3.
Click the New Data Source button. The New Data Source window appears.
4. 5. 6. 7. 8. 9.
Enter ORACLE_01 in the Data Source Name field. Enter an Oracle username and password in the Username and Password fields. Enter ORA_HOST_01 in the Primary Hostname field. Enter 1521 in the Primary Port field. Enter ORA_01 in the SID field. Click Test Connection to test the ObjectServer connection.
10. Click OK. Repeat the steps in the task above to create another data source that corresponds to the ORA_02 database. Name this data source ORACLE_02.
206
2. 3.
Select Oracle_01 from the data sources list. Click the New Data Type button. A new Data Type Editor tab appears in the Main Work panel of the GUI.
207
4. 5. 6. 7. 8.
Enter Device in the Data Type Name field. Enter ORACLE_01 in the Data Source Name field. Click Browse and select an icon to use for the data type from the window that appears. Select the Enabled option. Scroll the Data Type Editor tab down so that the Table Description area is visible.
9.
Select Device from the Base Table list. Netcool/Impact queries the Oracle database and populates the Table Description browser with the names of each column in the Device table.
11. Specify that the DeviceID field is the key field for the data type by selecting the Key option in the DeviceID row. 12. Select Hostname from the Display Name Field list. 13. Click the Save button in the Data Type Editor tab.
14. Click the Close button in the Data Type Editor tab.
208 Impact Version 4.0 Solutions Guide
Repeat the steps in the task above to create another data type that corresponds to the Department table in the ORA_02 database. Name this data type Department.
This filter tells Netcool/Impact that Device data items are linked to Department data items if the value of the Location field in the Department is equal to the value of the Facility field in the Device. To create the dynamic link: 1. 2. In the Netcool/Impact GUI, open the Data Types panel in the Navigation panel. Click the name of the Device data type. A new Data Type Editor tab opens in the Main Work panel of the GUI. This editor displays configuration information for the Device data type.
209
3.
Select the Dynamic Links tab in the editor. The Links From This Data Type area appears in the editor.
210
4.
Click the New Link By Filter button. The Link By Filter window appears.
5. 6.
Select Department from the Target Data Type list. In the Filter ... field, enter the filter string that defines the relationship between the Device and Department list. As noted in the description of this task above, the filter string is Location = '%Facility%'. This means that you want Device data items to be linked to Department data items if the Location field in the Department is the same as the Facility field in the Device. Click OK.
7.
211
8.
9.
Setting Up Services
The next step in this tutorial is to set up the event reader required by the solution.
212
To create the event reader: 1. In the Netcool/Impact GUI, open the Services panel in the Navigation panel.
2. 3.
Select Event Reader from the Type list. Click the New Service button. The Event Reader Configuration window appears.
4. 5. 6.
Enter TUT_READER_01 in the Service Name field. Select NCOMS from the ObjectServer Data Source list. Enter 3000 in the Polling Interval field.
213
7. 8.
Select the Startup option. This option specifies whether the service starts automatically when you run Netcool/Impact. Click OK.
This section assumes that you already know how to create, edit and save a policy using the policy editor tools in the Netcool/Impact GUI. For more information on these tools, see the Netcool/Impact User Interface Guide.
214
Here, GetByFilter is retrieving data items from the Device data type where the value of the Hostname field is equal to the value of the Node field in the incoming alert. The data items are stored in an array named MyDevices. Although GetByFilter is capable of returning more than one data items in the array, you really only expect the array to contain one data item in this situation, as each device in the database has a unique Hostname. The first element of the MyDevices array is assigned to the MyDevice variable so that MyDevice can be used as shorthand later in the policy. Because you want to retrieve one and only one data item from the data type, the policy also prints error messages to the policy log if GetByFilter retrieves less than or more than one.
215
In order to add the information, you enter the following in the policy editor tab below the code you entered above:
@JournalEntry = Device hardware ID is + MyDevice.HardwareID + .; @JournalEntry = 'Device located in ' + MyDevice.Facility + ' facility.'; @JournalEntry = 'Device located on ' + MyDevice.Rack + ' rack.';
When you update the journal entry in this way, Netcool/Impact sends a command to the ObjectServer each time the value of JournalEntry is changed. To reduce the load on the ObjectServer, you can combine these statements into one and use line feed and carriage return characters to enter line breaks in the journal.
@JournalEntry = Device hardware ID is + MyDevice.HardwareID + . + "\r\n" + 'Device located in ' + MyDevice.Facility + ' facility.' + "\r\n" + 'Device located on ' + MyDevice.Rack + ' rack.';
Note that string literals assigned to JournalEntry must be enclosed in single quotes, with the exception of special characters like \r and \n. As with other updates to events in an event source, updates to ObjectServer alerts are made in real time by Netcool/Impact.
Here, GetByLinks retrieves up to ten thousand Department data items linked to data items in the MyDevices array. Since you are certain that the business has less than ten thousand departments, you can use a large value such as this one to make sure that all Department data items are returned. The returned data items are stored in the MyDepts array. Because you want to at least one data item from the data type, the policy also prints an error message to the policy log if GetByLinks does not return any.
216
Here, you use a While loop to iterate through the elements in the MyDepts array. MyDepts is the array of Department data items returned previously in the policy by a call the GetByLinks. Before the While loop begins, you set the value of the Count variable to the number of elements in the MyDepts array. Each time the loop runs, it tests the value of Count. If Count is greater than zero, the statements inside the loop are executed. If Count is less than or equal to zero, the statements are not executed. Because Count is decremented by one each time the loop is performed, the While loop runs once for each data item in MyDepts. A variable named Index is used to refer the current element in the array. The value of Index is the value of Count minus one, as Netcool/Impact arrays are zero-based structures whose first element is counted as zero instead of one. Inside the loop, the policy uses an If statement to test the name of the current Department in the array against the name of the two mission-critical business departments. If the name of the current Department is matches the mission-critical departments, the policy sets the value of the Severity field in the alert to 5, which signifies a critical severity.
217
218
219
220
Appendix A. Glossary
This appendix contains the following section: "Glossary of Terms" on page 221
Glossary of Terms
Action function: An action function is a built-in IPL function that performs a high-level task such as retrieving data from a data source or sending e-mail. Action functions are pre-defined by the IPL and cannot be modified or extended when you write a policy. Assignment operator: The assignment operator is a built-in IPL function that assigns a value to a variable. The assignment operator is =. Boolean operator: A boolean operator is a built-in IPL function that specifies a logical operation of AND, OR or NOT when Netcool/Impact evaluates sets of operations. The boolean operators are &&, || and !. Command execution manager: The command execution manager is the Netcool/Impact service that manages remote command execution via the CommandResponse function in the IPL Command line manager: The command line manager is the service that manages the Netcool/Impact command line interface. Comparison operator: A comparison operator is a built-in IPL function that Netcool/Impact uses to compare two values. The comparison operators are ==, !=, <, >, <= and >=. Control structure: A control structure is a statement block in the IPL that is executed when the terms of the control condition are satisfied. The IPL supports If ... Then ... Else and When control structures. CORBA name service: The CORBA name service is the Netcool/Impact service that provides CORBA naming functionality for mediator DSAs. Data item: A data item is an element of a Netcool/Impact data model that represents an actual unit of data stored in a data source (for example, a row in relational database table). Data model: A data model is an abstract representation of the business data and meta data used in a Netcool/Impact installation. A data model contains data sources, data types, links and event sources. Data source: A data source is an element of a Netcool/Impact data model that represents an external source of data (for example, a relational database).
Appendix A. Glossary
221
Data source adaptor: A data source adaptor (DSA) is a component of Netcool/Impact that allows the application to access data stored in an external source of data. Data type: A data type is an element of a Netcool/Impact data model that represents a set of data stored in a data source (for example, a table or view in a relational database). Database listener: A database listener is a Netcool/Impact service that listens for incoming messages from an SQL database data source and then triggers policies based on the incoming message data. DSA: See data source adaptor. Dynamic link: A dynamic link is an element of a Netcool/Impact data model that represents a dynamic relationship between data items in data types. E-mail reader: An e-mail reader is a Netcool/Impact service that polls a POP mail server at intervals for incoming e-mail and then triggers policies based on the incoming e-mail data. E-mail sender: An e-mail sender is a Netcool/Impact service that sends e-mail via an SMTP mail server. Event: An event is a set of data that represents a status condition or an activity that has occurred in your environment. Most commonly, events originate with Netcool probes and monitors and are stored in the Netcool/OMNIbus ObjectServer database. Event processor: The event processor is the service responsible for managing events coming into Netcool/Impact via event reader, event listener and e-mail reader services. The event processor manages the incoming event queue and is responsible for sending queued events to the policy engine for processing. Event reader: An event reader is a Netcool/Impact service that monitors an event source for new, updated and/or deleted events and triggers policies based on the event data. See standard event reader and generic event reader. Event source: An event source is a data source that stores and manages events. Most commonly, the event source used by Netcool/Impact is the ObjectServer database. Exception: An exception an occurrence during runtime that changes the normal flow of policy execution. Field: A field is a single named unit of data in a Netcool/Impact event or data item. Filter: A filter is an expression that Netcool/Impact uses to select data (for example, data items in a data type) from a larger set of data. See SQL filter, LDAP filter and Mediator filter. Function: A function is a named set of instructions in the IPL that accepts certain pre-defined input parameters and optionally returns a value or set of values. See action function, parser function and user-defined function. Generic event listener: A generic event listener is a Netcool/Impact service that listens to an external data source for incoming events and triggers policies based on the event data.
222
Generic event reader: A generic event reader is an event reader that monitors an SQL database event source for new and/or modified events and triggers policies based on the event information. GUI server: See Netcool/Impact GUI server. Hibernating policy activator: The hibernating policy activator is the Netcool/Impact service that is responsible for waking hibernating policies. IPL: See Netcool/Impact policy language. Jabber reader: A Jabber reader is a Netcool/Impact service that listens to external instant messaging servers for messages and triggers policies based on the incoming message data. Jabber service: The Jabber service is a Netcool/Impact service that sends instant messages to instant messaging clients like AOL Instant Messenger and Yahoo! Messenger via a Jabber server. JRExec server: See Netcool/Impact JRExec server. JMS DSA: The JMS DSA is a data source adaptor that allows Netcool/Impact to send and receive Java Message System (JMS) messages. Key field: A key field is a field that uniquely identifies a data item in a data type. Key expression: A key expression is an expression specify the value that one or more key fields in a data item must have in order to be retrieved by the GetByKey function in the IPL. LDAP DSA: The LDAP DSA is a data source adaptor that allows Netcool/Impact to read directory data managed by an LDAP server. LDAP filter: An LDAP filter is an expression that Netcool/Impact uses to select data elements located at a location in an LDAP directory tree. The syntax for LDAP filters is specified in Internet RFC 2254. Link: A link is an element of a Netcool/Impact data model that defines a relationship between data types and/or data items. See dynamic link and static link. Mathematic operator: A mathematic operator is a built-in IPL function that performs a mathematic operation on two values. The mathematic operators are +, -, *, / and %. Mediator DSAs: Mediator DSAs are a type of data source adaptor that allows Netcool/Impact to access data provided by third-party systems, devices and applications. The Cramer Dimension DSA is an example of a mediator DSA. NCHOME: NCHOME is an operating system environment variable that identifies the location of Netcool product installations on your file system. The default value for this variable is /opt/ibm/netcool. This variable is referenced as $NCHOME on UNIX platforms and %NCHOME% on Windows platforms. Netcool/Impact database: The Netcool/Impact database is a PostgreSQL database named Impact that is managed by the Netcool database server. This database stores reporting information used by the Netcool/Impact server. See Netcool database server.
Appendix A. Glossary
223
Netcool database server. The Netcool database server is a specially configured version of PostgreSQL that has been prepared for use with Netcool/Impact and other Netcool products. See Netcool/Impact database. Netcool/Impact GUI server: The Netcool/Impact GUI server is the component of Netcool/Impact that serves the web-based graphical user interface to users web browsers via HTTP. Netcool/Impact JRExec server: The Netcool/Impact JRExec server is the component of Netcool/Impact that executes commands, scripts and applications triggered by the JRExecAction function in the IPL. Netcool/Precision DSA. The Netcool/Precision DSA is a data source adaptor that allows Netcool/Impact to access data managed by the Netcool/Precision application. Netcool/Impact Security Manager: The Netcool Security Manager is the component of the Netcool suite that is responsible for authenticating user logins. Netcool/Impact server: The Netcool/Impact server is the primary component of Netcool/Impact. This component is responsible for maintaining the data model, managing services and running policies. Netcool/Impact policy language: The Netcool/Impact policy language (IPL) is the programming language that you use to write policies. Operator: An operator is a built-in IPL function that assigns a value to a variable, performs an operation on a value or specifies how two values are to be compared in a policy. See assignment operator, mathematic operators, comparison operators, boolean operators and string operators. Parser function: A parser function is a built-in IPL function that performs a low-level task such as converting numeric and date formats or extracting a substring from a string. Parser functions are pre-defined by the IPL and cannot be modified or extended when you write a policy. Policy: A policy is a set of rules and actions that Netcool/Impact is required to perform when certain events or status conditions occur in your environment. Policies are implemented using the IPL. Policy activator: A policy activator is a Netcool/Impact service that runs a specified policy at intervals that you define. Policy logger: The policy logger is the Netcool/Impact services that writes messages to the policy log. Precision DSA: See Netcool/Precision DSA. Precision event listener: The Precision event listener is a Netcool/Impact service that listens to the Netcool/Precision application for incoming messages and triggers policies based on the message data. Security Manager: See Netcool/Impact Security Manager.
224
Self-monitoring service: The self-monitoring service is a Netcool/Impact service that monitors Netcool/Impact for memory and other status conditions and reports them to the Netcool/OMNIbus ObjectServer as events. Service: A service is a runnable sub-component of Netcool/Impact that you control from within the Netcool/Impact GUI. SNMP DSA: The SNMP DSA is a data source adaptor that allows Netcool/Impact to set and retrieve management information stored by SNMP agents. It also allows Netcool/Impact to send SNMP traps and notifications to SNMP managers. Socket DSA: The Socket DSA is a data source adaptor that allows Netcool/Impact to exchange information with external applications using a socket server as the brokering agent. SQL database DSAs: SQL database DSAs are data source adaptors that allow Netcool/Impact to retrieve information from relational databases and other data sources that provide a public interface via JDBC (Java Database Connectivity). SQL database DSAs also allow Netcool/Impact to add, modify and delete information stored in these data sources. SQL filter: An SQL filter is an expression that Netcool/Impact uses to select rows in a database table. The syntax for the filter is similar to the contents of an SQL WHERE clause. Standard event reader: A standard event reader is a Netcool/Impact service that monitors a Netcool/OMNIbus ObjectServer database for new, updated and/or deleted events and triggers policies based on the event data. Static link: A static link is an element of a Netcool/Impact data model that defines a static relationship between data items in internal data types. String operator: A string operator is a built-in IPL function that performs an operation on two strings. Netcool/Impact supports one string operator that you can use for string concatenation. The string concatenation operator is +. User-defined function: A user-defined function is a custom function that you use to organize code in a Netcool/Impact policy. Variable: A variable is an IPL keyword that represents a value or a set of values. WASCE (WebSphere Application Server Community Edition): IBM WASCE is a lightweight Java application server built using Apache Geronimo technology. The Netcool/Impact server and GUI server run as application instances inside a WASCE container by default. Web services DSA: The web services DSA is a data source adapter that allows Netcool/Impact to exchange information with external applications that provide a web services API. XML DSA: The XML DSA is a data source adapter that allows Netcool/Impact to read XML data from strings and files and to read XML data from web servers over HTTP.
Appendix A. Glossary
225
226
Appendix B. Notices
This appendix contains the following: "Notices" on page 227 "Trademarks" on page 229
Notices
This information was developed for products and services offered in the U.S.A. IBM may not offer the products, services, or features discussed in this document in other countries. Consult your local IBM representative for information on the products and services currently available in your area. Any reference to an IBM product, program, or service is not intended to state or imply that only that IBM product, program, or service may be used. Any functionally equivalent product, program, or service that does not infringe any IBM intellectual property right may be used instead. However, it is the user's responsibility to evaluate and verify the operation of any non-IBM product, program, or service. IBM may have patents or pending patent applications covering subject matter described in this document. The furnishing of this document does not grant you any license to these patents. You can send license inquiries, in writing, to: IBM Director of Licensing IBM Corporation North Castle Drive Armonk, NY 10504-1785 U.S.A. For license inquiries regarding double-byte (DBCS) information, contact the IBM Intellectual Property Department in your country or send inquiries, in writing, to: IBM World Trade Asia Corporation Licensing 2-31 Roppongi 3-chome, Minato-ku Tokyo 106-0032, Japan The following paragraph does not apply to the United Kingdom or any other country where such provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
227
LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this statement may not apply to you. This information could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the publication. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time without notice. Any references in this information to non-IBM Web sites are provided for convenience only and do not in any manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of the materials for this IBM product and use of those Web sites is at your own risk. IBM may use or distribute any of the information you supply in any way it believes appropriate without incurring any obligation to you. Licensees of this program who wish to have information about it for the purpose of enabling: (i) the exchange of information between independently created programs and other programs (including this one) and (ii) the mutual use of the information which has been exchanged, should contact: IBM Corporation 958/NH04 IBM Centre, St Leonards 601 Pacific Hwy St Leonards, NSW, 2069 Australia IBM Corporation 896471/H128B 76 Upper Ground London SE1 9PZ United Kingdom IBM Corporation JBFA/SOM1 294 Route 100 Somers, NY, 10589-0100 United States of America Such information may be available, subject to appropriate terms and conditions, including in some cases, payment of a fee. The licensed program described in this document and all licensed material available for it are provided by IBM under terms of the IBM Customer Agreement, IBM International Program License Agreement or any equivalent agreement between us.
228
Any performance data contained herein was determined in a controlled environment. Therefore, the results obtained in other operating environments may vary significantly. Some measurements may have been made on development-level systems and there is no guarantee that these measurements will be the same on generally available systems. Furthermore, some measurements may have been estimated through extrapolation. Actual results may vary. Users of this document should verify the applicable data for their specific environment. Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products. All statements regarding IBM's future direction or intent are subject to change or withdrawal without notice, and represent goals and objectives only. This information contains examples of data and reports used in daily business operations. To illustrate them as completely as possible, the examples include the names of individuals, companies, brands, and products. All of these names are fictitious and any similarity to the names and addresses used by an actual business enterprise is entirely coincidental.
Trademarks
The following terms are trademarks of International Business Machines Corporation in the United States, other countries, or both: AIX AIX 5L Netcool Intel, Intel Inside (logos), MMX, and Pentium are trademarks of Intel Corporation in the United States, other countries, or both. Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both. Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both. Linux is a trademark of Linus Torvalds in the United States, other countries, or both. UNIX is a registered trademark of The Open Group in the United States and other countries. Other company, product, or service names may be trademarks or service marks of others.
Appendix B. Notices
229
230
Index
A
action functions, 143 arrays, 138, 197 finding distinct values, 197 finding the length, 197 automation, 3 setting up, 30 data types, 33 caching, 48 categories, 34 fields, 36 keys, 38 setting up, 38 database functions, calling, 173 data-handling in a policy, 155 DataItem (built-in variable), 156 DataItems (built-in variable), 156 dynamic links, 54 event state variables, 149 EventContainer (built-in variable), 149 events, 63, 147 adding journal entries to, 151 deleting, 153 sending new, 152
C
command and response, 189 command execution manager, 129 configuration, 129 setting up, 129 command line manager, 130 configuration, 130 setting up, 130 contexts, 139 CORBA name service, 131 configuration, 131 setting up, 131
F
filters, 157 LDAP filters, 158 Mediator filters, 158 SQL filters, 157 functions action, 143 parser, 144 user-defined, 144
E
e-mail sending, 181 event access, 5 event container variables, user-defined, 149 event containers, 148 event enrichment, 7, 13 event fields accessing, 149 updating, 150 variables, 149 event gateway, 14 event gateways, 9 event listeners, 89 configuration, 91 process, 90 setting up, 93 event notification, 9, 14 event readers, 77 architecture, 79 configuration, 81 process, 79 setting up, 83 event sources, 63 Architecture, 66 non-ObjectServer, 65 ObjectServer, 64 setting up, 66 types, 64
G
glossary, 221
D
data adding, 167 deleting, 170 retrieving by filter, 156 retrieving by key, 162 retrieving by link, 164 updating, 168 data access, 6 data items, 156 field variables, 156 data models, 2, 18 architecture, 21 components, 19 examples, 22 setting up, 25 data sources, 27 architecture, 29 categories, 28
H
hibernating policy activator, 127 configuration, 128 setting up, 128 Hibernation data type, 175 hibernations, 175 removing, 179 retrieving, 177 waking, 179
I
If statements, 140 instant messaging, 183 IPL, 135
231
J
Jabber, 183 JRExec server, 188
X
x events in y time, 8, 13
K
keys, 162 multiple key expressions, 162 single key expressions, 162
S
services, 2, 72 setting up, 75 types, 73 single key expressions, 162 solutions, 11 setting up, 14 types, 13 SQL filters, 157 static links, 54 strings, 193 changing the case, 196 concatenating, 193 encrypting and decrypting, 196 extracting a substring, 194 finding the length, 194 replacing a substring, 195 splitting into substrings, 194 stripping a substring, 195 trimming whitespace, 196
L
LDAP filters, 158 links, 53 categories, 54 dynamic, 54 setting up, 56 static, 54
M
Mediator filters, 158 multiple key expressions, 162
T N
Netcool GUI Server, 2 Netcool Security Manager, 1 Netcool/Impact policy language, 135 Netcool/Impact Server, 1 third-party integration, 6
U
user-defined functions, 144
P
parser functions, 144 policies, 2, 134 hibernating, 176 policy activators, 121 configuration, 122 setting up, 123 policy context, 136 policy language, 135 policy log, 135 printing to, 137 policy logger, 125 configuration, 125
V
variables event field, 149 event state, 149 user-defined, 138
W
While statements, 141 workflow analysis, 9
232
IBM
Restricted Material of IBM Licensed Materials - Property of IBM