DSAReference Guide
DSAReference Guide
IBM
Note
Before using this information and the product it supports, read the information in "Notices".
Edition notice
This edition applies to version 7.1.0.33 of IBM Tivoli Netcool®/Impact and to all subsequent releases and modifications
until otherwise indicated in new editions.
References in content to IBM products, software, programs, services or associated technologies do not imply that they
will be available in all countries in which IBM operates. Content, including any plans contained in content, may change
at any time at IBM's sole discretion, based on market opportunities or other factors, and is not intended to be a
commitment to future content, including product or feature availability, in any way. Statements regarding IBM's future
direction or intent are subject to change or withdrawal without notice and represent goals and objectives only. Please
refer to the IBM Community terms of use for more information.
© Copyright International Business Machines Corporation 2006, 2023.
US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with
IBM Corp.
Contents
iii
Controlling how frequently Impact considers the UI provider data to be stale.......................................29
Clearing the UI Data Provider server cache with the UI data provider DSA............................................ 29
UI data provider operators........................................................................................................................ 30
An example using the UI data provider to integrate with IBM Tivoli Monitoring..................................... 30
Configuring Netcool/Impact to send messages to Tivoli Monitoring Universal Message Console....30
iv
Encryption.................................................................................................................................................. 75
Sign and encrypt messages....................................................................................................................... 77
Configure security with a WS-Policy file....................................................................................................78
Worked example...................................................................................................................................80
v
XmlHttpTestPolicy.............................................................................................................................. 121
XmlXsdFileTestPolicy......................................................................................................................... 121
vi
Implementing a custom socket server................................................................................................... 160
Socket DSA data model........................................................................................................................... 160
Socket DSA data source.....................................................................................................................160
Socket DSA data types....................................................................................................................... 160
Configuring the socket DSA..................................................................................................................... 160
Writing socket DSA policies.....................................................................................................................161
Retrieving data by filter...................................................................................................................... 161
Retrieving data by key........................................................................................................................ 162
Retrieving data by links...................................................................................................................... 163
Sending data.......................................................................................................................................164
Working with the sample socket server.................................................................................................. 164
Setting up the sample socket server................................................................................................. 164
Sample socket server components................................................................................................... 164
Running the sample socket server.................................................................................................... 166
Testing the socket server................................................................................................................... 167
Implementing a custom socket server................................................................................................... 167
Creating a socket................................................................................................................................167
Waiting for DSA connections..............................................................................................................168
Performing handshaking with the DSA.............................................................................................. 168
Listening for operation requests from the socket DSA..................................................................... 168
Requesting operation parameters from the socket DSA.................................................................. 168
Performing operations requested by the DSA...................................................................................170
Returning operation results to the DSA.............................................................................................170
Socket DSA and socket server connection state.................................................................................... 170
Socket server threading...........................................................................................................................170
Index................................................................................................................ 177
vii
viii
About this publication
The Netcool/Impact DSA Reference Guide contains information about Impact data source adaptors
(DSAs).
Intended audience
This publication is for users who are responsible for creating Netcool/Impact data models and writing
Netcool/Impact policies.
Publications
This section lists publications in the Netcool/Impact library and related documents. The section also
describes how to access Tivoli® publications online and how to order Tivoli publications.
Netcool/Impact library
• Administration Guide
Provides information about installing, running and monitoring the product.
• Policy Reference Guide
Contains complete description and reference information for the Impact Policy Language (IPL).
• DSA Reference Guide
Provides information about data source adaptors (DSAs).
• Operator View Guide
Provides information about creating operator views.
• Solutions Guide
Provides end-to-end information about using features of Netcool/Impact.
Ordering publications
You can order many Tivoli publications online at http://www.elink.ibmlink.ibm.com/publications/servlet/
pbi.wss.
You can also order by telephone by calling one of these numbers:
• In the United States: 800-879-2755
• In Canada: 800-426-4968
In other countries, contact your software account representative to order Tivoli publications. To locate the
telephone number of your local representative, perform the following steps:
1. Go to http://www.elink.ibmlink.ibm.com/publications/servlet/pbi.wss.
2. Select your country from the list and click Go.
3. Click About this site in the main panel to see an information page that includes the telephone number
of your local representative.
Accessibility
Accessibility features help users with a physical disability, such as restricted mobility or limited vision,
to use software products successfully. In this release, the Netcool/Impact console does not meet all the
accessibility requirements.
Obtaining fixes
A product fix might be available to resolve your problem. To determine which fixes are available for your
Tivoli software product, follow these steps:
1. Go to the IBM Software Support Web site at http://www.ibm.com/software/support.
2. Navigate to the Downloads page.
3. Follow the instructions to locate the fix you want to download.
4. If there is no Download heading for your product, supply a search term, error code, or APAR number in
the search field.
For more information about the types of fixes that are available, see the IBM Software Support Handbook
at http://www14.software.ibm.com/webapp/set2/sas/f/handbook/home.html.
Submitting problems
You can submit your problem to IBM Software Support in one of two ways:
Typeface conventions
This publication uses the following typeface conventions:
Bold
• Lowercase commands and mixed case commands that are otherwise difficult to distinguish from
surrounding text
• Interface controls (check boxes, push buttons, radio buttons, spin buttons, fields, folders, icons,
list boxes, items inside list boxes, multicolumn lists, containers, menu choices, menu names, tabs,
property sheets), labels (such as Tip:, and Operating system considerations:)
• Keywords and parameters in text
Italic
• Citations examples: titles of publications, diskettes, and CDs
• Words defined in text (example: a nonswitched line is called a point-to-point line)
• Emphasis of words and letters (words as words example: "Use the word that to introduce a
restrictive clause."; letters as letters example: "The LUN address must start with the letter L.")
• New terms in text (except in a definition list): a view is a frame in a workspace that contains data.
• Variables and values you must provide: ... where myname represents....
Monospace
• Examples and code examples
• File names, programming keywords, and other elements that are difficult to distinguish from
surrounding text
• Message text and prompts addressed to the user
• Text that the user must type
• Values for arguments or command options
Data source adapters (DSA) are software components that are used to communicate with external data
sources.
Categories of DSAs
There are the following categories of DSAs:
SQL database DSAs
SQL database DSAs are used to access information stored in SQL database data sources. For more
information about SQL database DSAs, see “Working with SQL database DSAs” on page 4.
LDAP DSA
The LDAP DSA are used to access information stored in an LDAP server. For more information about
LDAP DSA, see Chapter 5, “Working with the LDAP DSA,” on page 37.
Mediator DSAs
Mediator DSAs are used to communicate with various third-party applications or generic data
interfaces such as a Web services API, SNMP, or custom interfaces. For more information about
Mediator DSAs, see “Mediator DSAs” on page 3.
Mediator DSAs
Mediator DSAs are used to communicate with various third-party applications or generic data interfaces
such as a Web services API or custom interfaces.
Some Mediator DSAs are built in DSAs and do not require any additional installation or configuration.
Other Mediator DSAs require you to manually install and configure them.
Table 1 on page 3 lists the provided built-in Mediator DSAs:
XML DSA Chapter 10, “Working with the XML DSA,” on page 111
SNMP DSA Chapter 11, “Working with the SNMP DSA,” on page 123
ITNM DSA Chapter 12, “Working with the ITNM DSA,” on page 153
The following Mediator DSAs are provided but you must install and configure them independently of the
application:
• Alcatel 5620 DSA
• GE Smallworld DSA
Event readers
Event readers are services that query a data source at intervals for events and then run a policy that is
based on the incoming event data.
Two types of event readers are provided: standard event readers and database event readers. Standard
event readers query a Netcool/OMNIbus ObjectServer database by using the ObjectServer DSA. Database
event readers query other relational databases by using other types of SQL database DSAs.
The default event reader configuration is sufficient when you process an event flow of around 500 events
per second. To enrich the event flow at any time, adjust the following parameters in the event processor
properties file.
impact.perftesteventreader.objectserver.maxtoreadperquery=2000
impact.perftesteventreader.objectserver.polltime=1500 (polling inteval 1500ms)
impact.perftesteventreader.maxqueuesize=4000
Important: Increasing the read rate will also increase the memory and performance requirements for the
event reader. If the query size is set too large the event reader may suffer an out of memory exception in
the case of an event flood.
For more information about the event processor, see the Event processor commands in the Administration
Guide and Configuring the event processor service in the online help.
Event listeners
Event listeners are services that listen for incoming communication from an external data source through
a DSA.
Event listeners are implemented by certain DSAs that provide the means for asynchronous exchange of
data with the underlying sources of data. These DSAs include the database listener service for some SQL
database DSAs (such as the Oracle DSA), OMNIbusEventListener for OMNIbus version 7.2 and later. They
also include other listeners for Web services, JMS, and ITNM.
Policies
DSA policies are policies that contain instructions for interacting with a data source using a DSA. These
policies contain calls to data-handling functions (such as GetByFilter) or DSA-specific functions that
are instructions to send or retrieve information to and from the external data sources.
impact.directsql.preservearrays=true
This behavior can also be set on a policy level by setting the variable DIRECTSQL_PRESERVE_ARRAYS in
the policy.
For example by setting:
DIRECTSQL_PRESERVE_ARRAYS="true";
or
DIRECTSQL_PRESERVE_ARRAYS="false";
Where DIRECTSQL_PRESERVE_ARRAYS is set at a policy level, this takes precedence over the global
setting for the policy
For example, if the global setting is impact.directsql.preservearrays=true but the policy has
DRECTSQL_PRESERVE_ARRAYS="false"; then any array column will be returned as String for the
policy.
Note: The setting of DIRECTSQL_PRESERVE_ARRAYS must come before the DirectSQL call in the policy
for it to be effective.
Generic SQL To use the Generic SQL DSA, you must specify No
its JDBC driver in the Generic SQL data source
configuration window.
Informix The Informix DSA supports versions 11.x and 12.x. Yes
MS-SQL Server The DSA can support MS-SQL Server 2008, 2012, No
2014, 2017 and 2019
ObjectServer The DSA supports versions 7.3, 7.4 and 8.1 of the Yes
Netcool/OMNIbus ObjectServer.
Oracle The Oracle DSA supports versions 11g, 12c, 18c Yes
and 19c of the Oracle database server.
Sybase The Sybase DSA supports versions 12.x, 15.x and Yes
16.x of the SAP ASE/Sybase Database Server.
Procedure
1. Obtain the appropriate JDBC driver according to the DSA specification or the third-party JAR files.
2. Copy the JDBC driver or third-party JAR files to the $IMPACT_HOME/dsalib directory.
This directory is created during the installation, and might contain files.
3. Restart the Impact Server.
What to do next
In a clustered configuration, you must repeat this procedure for each server in the cluster because files in
the $IMPACT_HOME/dsalib directory are not replicated between cluster members. Stop all the servers
in the cluster while you perform this procedure.
Procedure
1. In the $IMPACT_HOME/etc directory, create a properties file for the DSA for which you want to change
the default character set encoding.
The properties filename must have the following format:
servername_drivermainclass.props
where servername is the name of your Impact Server, and drivermainclass is the class name of the
JDBC driver to connect to the SQL database.
For example, you will create the NCI_org.gjt.mm.mysql.Driver.props file, if the name of your
Impact Server is NCI, and if it is connecting to the MySQL database.
Remember: You can get the drivermainclass values for other SQL databases, from their JDBC
documentation.
2. Add a CHARSET=encoding property to the properties file.
For example, CHARSET=EUC_JP.
3. Restart the Impact Server.
Procedure
1. In the $IMPACT_HOME/etc directory, create or modify a properties file for the DB2 DSA for which
you want to change the useJDBC4ColumnNameAndLabelSemantics property.
The properties filename should have the following format
impact_server_com.ibm.db2.jcc.DB2Driver.props where impact_server is the name of
your Impact Server, for example NCI_com.ibm.db2.jcc.DB2Driver.props.
2. Set the useJDBC4ColumnNameAndLabelSemantics property in the properties
file to a value appropriate for your system . The default value is
DB2BaseDataSource.NO (2). For details about valid values for the
useJDBC4ColumnNameAndLabelSemantics property, see https://www.ibm.com/support/
knowledgecenter/en/SSEPGG_11.5.0/com.ibm.db2.luw.apdv.java.doc/src/tpc/imjcc_r0052607.html.
3. Restart the Impact Server.
Procedure
1. Set up your Oracle database to support Kerberos. See documentation from Oracle for details.
2. Add the connection properties to your Netcool/Impact Oracle data source.
a. Edit your data source file located in the following directory: $IMPACT_HOME/etc
b. Add the following properties:
<YourOralceDataSourceName>.Oracle.NUMDSPROPERTIES=3
<YourOralceDataSourceName>.Oracle.DSPROPERTY.1.NAME=CONNECTION_PROPERTY_THIN_NET_AUTHENTIC
ATION_SERVICES
<YourOralceDataSourceName>.Oracle.DSPROPERTY.1.VALUE=KERBEROS
<YourOralceDataSourceName>.Oracle.DSPROPERTY.2.NAME=CONNECTION_PROPERTY_THIN_NET_AUTHENTIC
ATION_KRB5_MUTUAL
<YourOralceDataSourceName>.Oracle.DSPROPERTY.2.VALUE=true
<YourOralceDataSourceName>.Oracle.DSPROPERTY.3.NAME=CONNECTION_PROPERTY_THIN_NET_AUTHENTIC
ATION_KRB5_CC_NAME
<YourOralceDataSourceName>.Oracle.DSPROPERTY.3.VALUE=/tmp/krb5cc_5088
Function Description
GetByKey Retrieves data items (rows in a table or other data element) whose key fields
match the specified key expression.
GetByFilter Retrieves data items whose field values match the specified SQL filter string.
GetByLinks Retrieves data items that are dynamically or statically linked to another data item
using the GUI.
DirectSQL Retrieves data items by directly running an SQL SELECT query against the
underlying database or other source of data.
For detailed syntax descriptions of these functions, see the Policy Reference Guide.
The following example shows how to use GetByKey to retrieve data items (rows in a table or other data
element) whose key field matches the specified key expression. In this example, the SQL database data
type associated with the table is Customer and the key expression is 12345.
DataType = "Customer";
Key = 12345;
MaxNum = 1;
The following example shows how to use GetByFilter to retrieve data items whose field values match
the specified SQL filter string. In this example, the SQL database data type is Node and the filter string is
Location = 'New York City' AND Facility = 'Manhattan'.
DataType = "Node";
Filter = "Location = 'New York City' AND Facility = 'Manhattan'";
CountOnly = False;
DataType = {"Customer"};
Filter = "";
MaxNum = 1000;
DataItems = MyNodes;
DataType = "User";
MyUser = NewObject();
AddDataItem(DataType, MyUser);
For a detailed syntax description of this function, see the Policy Reference Guide.
DataType = "Customer";
Filter = "Name = 'John Smith'";
CountOnly = "False";
MyCustomer[0].Location = "Raleigh";
MyCustomer[0].Facility = "FAC_01";
The following example shows how to modify multiple rows in an SQL database table by using the
BatchUpdate function. In this example, you update the Location and Facility columns in the table for
each row where the value of Location is New York City.
DataType = "Customer";
Filter = "Location = 'New York City'";
UpdateExpression = "Location = 'Raleigh' AND Facility = 'FAC_01'";
For more information about using these methods to modify SQL database data, see the Policy Reference
Guide.
Function Description
DeleteDataItem Deletes a single data item which is a row in a table or other data element.
BatchDelete Deletes one or more data items whose field values match the specified SQL
filter string.
The following example shows how to delete a row in a database table by using the DeleteDataItem
function. In this example, you first retrieve the data item that represents the row by using the GetByKey
function and then call DeleteDataItem.
DataType = "Node";
Key = "DB2_01";
MaxNum = 1;
DeleteDataItem(MyNode[0]);
The following example shows how to delete multiple rows from a database table by using the BatchDelete
function. In this example, you delete all rows from the table that is represented by the User data type,
where the value of the Location column is New York City.
DataType = "User";
Filter = "Location = 'New York City'";
For more information about using these functions to delete SQL database data, see the Policy Reference
Guide.
DataType = "Server";
Filter = "0 = 0";
Metric = "NOW()";
For a detailed syntax description of the CallDBFunction function, see the Policy Reference Guide.
Sp_Parameter = NewObject();
Sp_Parameter.CustType = "Platinum";
Sp_Parameter.Location = "Mumbai";
DataSource = "SYB_03";
ProcName = "GetCustomerByLocation";
For a detailed syntax description of the CallStoredProcedure function, see the Policy Reference Guide.
Standard failover
Standard failover is a configuration in which an SQL database DSA switches to a secondary database
server when the primary server becomes unavailable and then continues using the secondary until
Netcool/Impact is restarted.
If the secondary server becomes unavailable, the SQL database DSA will attempt to resume connections
to the original primary server.
Failback
Failback is a configuration in which an SQL database DSA switches to a secondary database server
when the primary server becomes unavailable and then tries to reconnect to the primary at intervals to
determine whether it has returned to availability.
If the primary server has become available, the DSA will resume connections using that server. If the
primary has not become available, the DSA will continue to use the secondary server. In a failback
configuration, the SQL database DSA will always attempt to reconnect to the primary server before
making a connection to the secondary.
Procedure
You use the data source editor to select a failover configuration for the data source and to specify
connection information for the primary and secondary database servers.
For more information about creating and configuring SQL database data sources, see the online help.
MySQL Error codes 1047, 1048, 1051, 1052, 1054 to 1064 inclusive, 1071,
1106 to 1111 inclusive, 1122, 1138, 1146, 1217, 1222
PostgreSQL SQL states 03000, 42000, 42601, 42602, 42622, 42701, 42702,
42703, 42704, 42803, 42804, 42809, 42883, 42939, 42P01,
42P02, 42P10, 42P18
SQL Server Error codes 105, 207, 208, 213, 229, 230, 260
Sybase Error codes 100 to 300 inclusive, 403, 404, 407, 413
For instructions in providing an alternate customized list, see “Customizing DSA failover” on page 16.
impact.database=error_codes
where database is the name of the database and error_codes is a comma-separated list of error
identification numbers. To specify a range of codes, place a less-than character between the lower limit
and upper limit numbers as follows: 200<300. The error code range is inclusive of the numbers specified.
The following table shows the internal database names that you must use in the properties file.
DB2 db2
Derby derby
GenericSQL genericsql
HSQL hsqldb
Informix informix
MySQL mysql
ODBC odbc
Oracle oracle
PostgreSQL postgresql
Sybase sybase
Error codes are defined by at the database level. For a list of possible error codes, see the documentation
provided with the database application.
The following example shows a properties file that lists the default built-in error codes excluded by
Netcool/Impact when determining if a database server is unavailable.
impact.db2=
impact.informix=-899<-200
impact.mssql=105,207,208,213,229,230,260
impact.mysql=1047,1048,1051,1052,1054<1064,1071,1106<1111,1122,1138,1146,
1217,1222
impact.objectserver=667,5555,20000,20001,20002
impact.odbc=
impact.oracle=100,900<999,17006
impact.postgresql=03000,42000,42601,42602,42622,42701,42702,42703,42704,
Procedure
• To enable customized failback, in the $IMPACT_HOME/etc/<ServerName>_server.props file,
change the value for impact.objectserver.failback.enabled from false to true.
impact.objectserver.failback.enabled=true
Important: If you are running a cluster setup repeat this step for each server in the cluster. You
must also restart the server to implement these changes. By default this property is disabled and the
failback setup uses a ping mechanism like other SQL DSAs.
• If the connection to the primary server and port hangs, you can change the value for the timeout,
which by default is 20 seconds.
– In the $IMPACT_HOME/etc/<ServerName>_server.props file, add the following property
impact.datasource.failback.tester.timeout=<# of milli seconds>. For example,
if you want to change the timeout to 1 minute, set the value of the property to 60000
impact.datasource.failback.tester.timeout=60000
• Change the polling time, which checks whether the primary server is up. By default, the polling time is
1 minute.
– In the $IMPACT_HOME/etc/<ServerName>_server.props file, add the following
propertyimpact.objectserver.failback.pollinterval=<# of milli seconds>. For
example, if you want to change the polling time to 10 seconds, set the value of the property to
10000 impact.objectserver.failback.pollinterval=10000
• Determine which server is acting as the primary.
– Go to the backup ObjectServer server.
– Run the following query: SELECT Value from catalog.properties WHERE PropName =
'ActingPrimary';
– If the value for PropName='ActingPrimary' is FALSE, then the primary server is in active.
– If the value for PropName='ActingPrimary' is TRUE, then the backup is acting as the primary
server. This situation can occur when the ObjectServer gateway is doing a resync with the primary
server and the primary server is not available to accept any connections.
Procedure
1. In the $IMPACT_HOME/etc directory, create a properties file for the DSA for which you want to set the
JDBC connection properties.
The properties filename must have the following format:
servername_drivermainclass.props
where servername is the name of your Impact Server, and drivermainclass is the class name of the
JDBC driver to connect to the SQL database.
For example, you will create the NCI_oracle.jdbc.driver.OracleDriver.props file, if the
name of your Impact Server is NCI and it is connecting to an Oracle database.
Remember: You can get the drivermainclass values for other SQL databases from their JDBC
documentation.
2. Add the connection property propertyname=propertyvalue to the properties file as per the
documentation for the JDBC driver, one property per line.
For example, if the Oracle server requires clients to enable specific encryption and integrity settings,
you would add the following properties.
oracle.net.encryption_client=REQUESTED
oracle.net.encryption_types_client=AES256
oracle.net.crypto_checksum_client=REQUESTED
oracle.net.crypto_checksum_types_client=SHA1
Procedure
1. In the $IMPACT_HOME/etc directory, create a properties file for the DSA for which you want to set the
JDBC connection properties.
The properties filename must have the following format:
servername_drivermainclass_datasourcename.props
where servername is the name of your Impact Server, drivermainclass is the class name of the JDBC
driver, and datasourcename is the name of the data source in Impact.
encryptionAlgorithm=2
securityMechanism=9
Example usage
The following example shows a specific situation where the impact.jdbc.pool.simplifiedkey
property is required:
• Multiple Impact datasources exist for the same RDBMS
• No custom properties are set at datasource level
• For each Impact datasource, a MAXSQLCONNECTION setting of 100 is required to avoid processing
thread contention.
• But the server side maximum allowed number of connections for the RDBMS is also 100.
In this case, a maximum of 100 connections can be pooled in Impact datasources for the RDBMS. If
you did not set the impact.jdbc.pool.simplifiedkey property, Impact could attempt to make 100
connections for each datasource, which would fail as soon as the 101st connection is attempted.
Procedure
1. Click Data Model to open the Data Model tab.
2. From the Cluster and Project lists, select the cluster and project you want to use.
3. In the Data Model tab, click the New Data Source icon in the toolbar. Select UI Data Provider. The
tab for the data source opens.
4. In the Data Source Name field:
Enter a unique name to identify the data source. You can use only letters, numbers, and the
underscore character in the data source name. If you use UTF-8 characters, make sure that the
locale on the Impact Server where the data source is saved is set to the UTF-8 character encoding.
5. In the Host Name field, add the location where the UI data provider is deployed. The location is a
fully qualified domain name or IP address.
6. In the Port field, add the port number of the UI data provider.
7. Use SSL: To enable Netcool/Impact to connect over SSL to a data provider, you must export a
certificate from the data provider and import it into the Impact Servers and each GUI Server. If the
data provider is an IBM Dashboard Application Services Hub server, complete these steps to export
and import the certificate. For other data provider sources, after you obtain the certificate, use steps
(f and g) to import the certificate.
a) In the IBM Dashboard Application Services Hub server, go to Settings, WebSphere
Adminstrative Console, Launch WebSphere administrative console.
Procedure
1. Right click the UI data provider data source you created, and select New Data Type.
2. In the Data Type Name field, type the name of the data type.
3. The Enabled check box is selected to activate the data type so that it is available for use in policies.
Procedure
1. In the Data Model tab, right click the data type and select View Data Items. If items are available for
the data type, they show on the right side in tabular format.
2. If the list of returned items is longer than the UI window, the list is split over several pages. To go from
page to page, click the page number at the bottom.
3. To view the latest available items for the data type, click the Refresh icon on the data type.
4. You can limit the number of data items that display by entering a search string in the Filter field. For
example, add the following syntax to the Filter field, totalMemory=256. Click Refresh on the data
items menu to show the filtered results.
Filter Retrieved Data Items: The filter searches all the fields in the current set of paged results
containing the search text. If the number of results requires the results to be paged, the filter only
filters the results on the current page. The filter is cleared when you navigate between pages.
Tip: If your UI Data Provider data type is based on a Netcool/Impact policy, you can add
&executePolicy=true to the Filter field to run the policy and return the most up to date filtered
results for the data set.
For more information about using the Filter field and GetByFilter function runtime parameters to limit
the number of data items that are returned, see “Using the GetByFilter function to handle large data
sets” on page 23.
This policy example uses the FILTER runtime parameters in a GetByFilter (Filter, DataType,
CountOnly) implementation in a UI data provider.
DataType="123UIdataprovider";
CountOnly = false;
index = 0;
if(Num > 0){
while(index <Num){
Log("Node["+index+"] id = " + MyFilteredItems[index].id +
"---Node["+index+"] DisplayName= " +
MyFilteredItems[index].t_DisplayName);
index = index + 1;
}
}
Log("========= END =========");
Here are some more syntax examples of the FILTER runtime parameters that you can use in a
GetByFilter (Filter, DataType, CountOnly) implementation in a UI data provider.
Example 1:
Filter = "&count=6";
No condition is specified. All items are fetched by the server, but only the first 6 are returned.
Example 2:
Filter = "&count=3&start=2";
No condition specified. All items are fetched by the server, but only the first 3 are returned, starting at
item #2
Example 3:
Only items that match the condition = "t_DisplayName ends 'ces' are fetched.
Example 4:
Filter = "¶m_One=paramOne";
All items are fetched by the server, and paramOne is available for use by the provider when it returns the
data set.
* ^ $ . |
Examples:
An example using an Asterisk (*) as a delimiter:
• Property Syntax: impact.uidataprovider.query.delimiter=\\*
• Filter query: t_DisplayName contains 'Imp'*count=5
An example with a combination of characters:
• Property Syntax:impact.uidataprovider.query.delimiter=ABCD
• Filter query: t_DisplayName contains 'Imp'ABCDcount=5
An example of a regular expression, subject to Java language reg expression rules:
• Property Syntax: impact.uidataprovider.query.delimiter=Z|Y
• Filter queryt_DisplayName contains 'S'Zcount=9Zstart=7YexecutePolicy=true
An example of a combination of special characters: * . $ ^ |
• Property Syntax: impact.uidataprovider.query.delimiter=\\*|\\.|\\$|\\^|\\|
• Filter query t_DisplayName contains 'S'.count=9|start=7$executePolicy=true
UI data provider data items contain many properties. Each of these properties has two attributes that are
relevant for filtering UI data provider data items, a display value attribute and the actual value attribute.
Operators are evaluated against the display value by default. If you want to filter for the actual values
instead, you must add an asterisk (*) before the property. For example:
(*TYPE = ‘SERVER’)'s
For a full list of the available operators, see “UI data provider operators” on page 30
6. To create the custom schema values, click the Open Schema Definition Editor icon. You must
create custom schema values for each schema that is defined in the database and included in the
returned results. To view the schema values that are required for your policy, right click the associated
data type and click View Data Items. You must create a custom schema value for each column that
you want to view in the widget in the console.
For more information about how to create user output parameters and custom schema values, see
“Creating custom schema values for output parameters” on page 27.
Example
In the following policy example, the UI data provider data type called uidataprovider-ImpactROI is
sourcing the data from the REPORT_ImpactROI data type that uses the GetByFilter function and the
IPL policy language. The REPORT_ImpactROI data type is a standard data type delivered with Netcool/
Impact.
DataType="uidataprovider-ImpactROI";
Filter = "PROCESS_NAME=’Escalate’";
CountOnly = false;
The GetByFilter function returns an OrgNodes object that represents an array of values:
The filter matches only one item in the data, and the GetByFilter function returns one item as a result:
DataType="myuidataproviderDataType";
Filter = "SAVED_TIME > 1000";
CountOnly = false;
If the filter matches two items, the GetByFilter function returns these two items as follows:
Filter="&count=200";
DemoUISchema=GetByFilter('UITestCuriMySQL',Filter,CountOnly);
Log(DemoUISchema);
You create the following output parameter for to represent the DemoUISchema parameter. You do not
have to enter a data source or data type name.
After you create the output parameter, you must create custom schema values for id, firstName, and
lastName. To view the schema values that are required for your policy, right click the associated data
type and click View Data Items.
O1.city="NY"
O1.ZIP=07002
You define the following custom schemas values for this policy:
If you use the DirectSQL policy function with the UI data provider or OSLC, you must define a custom
schema value for each DirectSQL value that you use.
If you want to use the chart widget to visualize data from an Impact object or an array of Impact objects
with the UI data provider and the console, you define custom schema values for the fields that are
contained in the objects. The custom schemas help to create descriptors for columns in the chart during
initialization. However, the custom schemas are not technically required. If you do not define values for
either of these formats, the system later rediscovers each Impact object when it creates additional fields
such as the key field. UIObjectId, or the field for the tree widget, UITreeNodeId. You do not need to
define these values for OSLC.
Procedure
1. In the Policy Settings Editor, select DirectSQL, Impact Object, or Array of Impact Object in the
Format field.
2. The system shows the Open the Schema Definition Editor icon beside the Schema Definition
field. To open the editor, click the icon.
3. You can edit an existing entry or you can create a new one. To define a new entry, click New. Enter a
name and select an appropriate format.
To edit an existing entry, click the Edit icon beside the entry that you want to edit
4. To mark an entry as a key field, select the check box in the Key Field column. You do not have to define
the key field for Impact objects or an array of Impact objects. The system uses the UIObjectId as the
key field instead.
5. To delete an entry, select the entry and click Delete.
Procedure
1. Use the GetHTTP function to send DELETE requests to the UI Data Provider server.
The GetHTTP function with the 'DELETE' method can be run before or after retrieving a data set. Here
is an example of IPL policy with GetHTTP.
// Execute GetHTTP DELETE method to clear cacheof dataset identified with <_paramXXXX>:
GetHTTP(host, port, "http", path, "key", "DELETE", "BASIC", null, null, null, props);
The only difference in above GetHTTP method execution is the usage of 'GET'
instead of 'DELETE' HTTP method
2. Using the GetByFilter function to send a DELETE request to UI Data Provider server.
GetByFilter() can be used to run GET and DELETE HTTP methods. Here is an example:
DataType="UIDPdatatype_name";
Filter = "param_SourceToken= 'sysitmsles:LZ'count=4 delete=true";
CountOnly = false; OrgNodes = GetByFilter( DataType, Filter, CountOnly );
Log("Number of org nodes returned:" + Num);
// They will be 4 or less Org Nodes returned
Log("Number of org nodes returned:" + Num);
The important parameter in the Filter is 'delete=true'. When the GetByFilter function runs with
'delete=true' in the filter value, the data set is retrieved and then the data set is removed from UI
Data Provider server cache. If GetByFilter runs with the Filter value 'delete=false' or the delete
parameter is omitted, then only the GET request is submitted to the UI Data Provider server and cache
is not cleared.
Procedure
1. In the Netcool/Impact UI find the ITM project, and the policies for IPL and
JavaScript ITMLibraryFunctionsIPL, ITMLibraryFunctionsJS, ITMFunctionsCallerIPL,
and ITMLibraryFunctionsCallerJS.
2. Update the ITMFunctionsCallerJS or ITMFunctionsCallerIPL policy that you want to use with
Tivoli Monitoring specific information such as host name, port, user name, password, attribute, and
object that is based on the function to be called.
Remember: The example function is using default values.
3. Run the policy. The functions return an XML formatted string.
Procedure
• To obtain data from Tivoli Monitoring 6.3, use the UI data provider DSA to access the Tivoli Monitoring
data provider seeChapter 3, “Working with the UI data provider DSA,” on page 21.
• For more information, see the following link and information center reference.
– Netcool/Impact devWorks wiki, see examples associated to dashboarding in the Scenarios and
Examples page at the following URL: https://www.ibm.com/developerworks/mydeveloperworks/
wikis/home?lang=en#/wiki/Tivoli%20Netcool%20Impact/page/Scenarios%20and%20examples
– Netcool/Impact Solutions Guide, Visualizing data from the UI data provider in the console, Visualizing
a data mashup from two IBM Tivoli Monitoring sources. This example shows how to visualize the
data from Tivoli Monitoring sources in dashboard. You can use the same method to retrieve data for
event management purposes.
Procedure
1. Select the Data Model tab.
2. From the Cluster and Project lists, select the cluster and project you want to use.
3. To create a new RESTful data source, click New Data Source > RESTful API.
4. In the Data Source Name field:
Enter a unique name to identify the data source. You can use only letters, numbers, and the
underscore character in the data source name. If you use UTF-8 characters, make sure that the
locale on the Impact Server where the data source is saved is set to the UTF-8 character encoding.
5. Set the Host Name. The host name can be a fully qualified domain name or IP address. Do not
include the protocol or port number. For example: ibm.com, api.ibm.com, 192.168.1.255.
6. Set the Resource Path. The resource path will be appended to all REST requests for this data source.
For example: /v1/api, /api/stats/, /services/data.
Tip: You can extend the resource path using the Path parameter in the RESTful policy function
instead. The RESTful function combine the Resource Path from the data source and the Path
parameter to create the complete path for its REST request.
7. Set the Port number. For the SSL protocol, the default port is 443.
8. To enable an SSL connection between the DSA and the endpoint, select the Use HTTPS check box.
• For SSL connections, you must add the endpoint SSL certificate(s) to Impact's trust store. See
Enabling SSL connections with external servers for more information on how to add SSL certificates
to the trust store.
The following will be added to the URL when making the request:
13. Set the Protected Request Headers. If the value of a request header contains sensitive
information such as an API key or authorization token, you can use Protected Request Headers to
hide the value from the user interface and policy logger.
Note: If the same request header is also declared in a policy or as a normal Request Header, then the
DSA uses the following order of precedence when selecting a header value: Policy > Normal Request
Headers > Protected Request Headers.
14. Specify HTTP parameters if you are making requests to the datasource where the same HTTP
parameters are being used consistently.
The REST API datasource can persist these and they will be used on every call to the data source
unless overridden by the policy function.
For example, if a new parameter is added to the grid, this is the same as adding a query parameter to
the request. If the grid has the following paramaters:
Specifying proxy server connection details for a RESTful DSA data source
Use this information to specify proxy server connection details for a RESTful DSA data source.
Procedure
1. Check the Use Proxy Server box if you want connect to a web server using a proxy server. If the
checkbox is checked, you must specify values for the Proxy Hostname and Proxy Port properties.
2. Specify the name of the proxy host in the Proxy Hostname field.
3. Specify the port on the proxy host through which to make the connection in the Proxy Port field.
4. Select Use HTTPS to connect to the proxy server.
You should select this checkbox if you want to use SSL and if you do you have to import a certificate.
5. If you want to perform no authentication with the proxy server, select No Authentication.
6. If you want to perform basic authentication with the proxy server, select BASIC.
If so, use the User Name and Password properties specified in the Proxy Setting tab to authenticate
with the proxy server.
7. Specify the realm if the proxy server requires one in the Proxy Realm field.
8. Specify the user name to log on to the proxy server in the User Name field.
9. Specify the password to log on to the proxy server in the Password field.
Procedure
1. Click Data Model to open the Data Model tab.
2. From the Cluster and Project lists, select the cluster and project you want to use.
3. In the Data Model tab, click the New Data Source icon in the toolbar. Select OAuth. The tab for the
data source opens.
4. In the Data Source Name field:
Enter a unique name to identify the data source. You can use only letters, numbers, and the
underscore character in the data source name. If you use UTF-8 characters, make sure that the
locale on the Impact Server where the data source is saved is set to the UTF-8 character encoding.
5. In the Access Token field, add the access token for the OAuth data source.
6. In the Refresh Token field, add the refresh token for the OAuth data source.
The LDAP DSA is a direct-mode data source adaptor that runs in-process with Netcool/Impact. This
DSA is automatically loaded during application run time. You do not have to start or stop this DSA
independently of the application. Netcool/Impact is not able to use this DSA to add, modify, or delete
information managed by the LDAP server
To use the LDAP DSA, complete the following tasks:
• Create an LDAP DSA data model that provides an abstract representation of the data managed by the
LDAP server.
• Write one or more LDAP DSA policies that retrieve data from the underlying LDAP server.
For more information about LDAP data model, see.“LDAP data model” on page 37
For more information about LDAP policies, see.“LDAP policies” on page 39
Configuration Description
Property
Search scope Keyword that indicates the scope for the LDAP search. Possible values are:
OBJECT_SCOPE, ONELEVEL_SCOPE, and SUBTREE_SCOPE.
OBJECT_SCOPE causes the LDAP DSA to search only the specified base context
for matches.
ONELEVEL_SCOPE causes the DSA to search only the child entities of the base
context for matches.
SUBTREE_SCOPE causes the DSA to search all descendants of the base
context.
Base context Location in the LDAP tree regarding which the LDAP DSA searches for matching
entities. An example is ou=people, o=IBM.com.
Key search field Attribute in the LDAP entity that uniquely identifies it as a key. Used when you
retrieve data items from an LDAP data type with the GetByKey function in a
policy.
Display name field Attribute in the LDAP entity that is logged when you log the entity in a policy.
Restriction filter LDAP search filter as described in Internet RFC 2254: String Representation of
LDAP Search Filters.
Function Description
GetByKey Retrieves data items, or entities in the LDAP directory tree, whose key fields
match the specified key expression. The key field is configured in the Key search
field entry in the data type.
GetByFilter Retrieves data items whose field values match the specified LDAP filter string.
GetByLinks Retrieves data items that are dynamically or statically linked to another data item
using the Netcool/Impact GUI.
Example
The following example shows how to use GetByKey to retrieve data items, or entities in the LDAP
directory tree, whose key field matches the specified key expression. In this example, the LDAP data type
associated with a search scope in the tree is Customer and the key expression is 12345.
DataType = "Customer";
Key = 12345;
MaxNum = 1;
The following example shows how to use GetByFilter to retrieve data items whose field values match
the specified LDAP filter string. The LDAP filter is part of the specification that is described in Internet
RFC 2254. In this example, the LDAP data type is Facility and the filter string is (|(facility=Wall
St.)(facility=Midtown)(facility=Jersey City)).
DataType = "Facility";
Filter = "(|(facility=Wall St.)(facility=Midtown)(facility=Jersey City))";
CountOnly = False;
If the filter does not return any LDAP entities when you think it should, sometimes this can be fixed
be adding a * to the end of the search text. For example, instead of Filter = "(cn=myuser)", try
Filter= "(cn=myuser*)";
The following example shows how to use GetByLinks to retrieve data items that are statically or
dynamically linked to another data item by using the Netcool/Impact GUI. In this example, you use
GetByLinks to retrieve data items of type Customer that are linked to data items in the MyFacilities
array that is returned in the previous example.
DataType = {"Customer"};
Filter = "";
MaxNum = 1000;
DataItems = MyFacilities;
Note: A policy processing exception is generated if a null value is returned by either of the GetByFilter
or GetByKey functions when querying an LDAP data source.
To stop this exception from being generated, add the following property to $IMPACT_HOME/etc/
<ImpactServerName>_server.props:
impact.jndi.suppressnull=true
Restart the Impact server for change to take effect.
For detailed syntax descriptions of these functions, see the Policy Reference Guide.
<LDAP TYPE>.LDAP.COUNTLIMIT=x
<LDAP TYPE>.LDAP.PAGESIZE=y
Where x is the limit to be used in a non paging setup and y is the page size in a paging setup.
You must restart the Impact server for the changes to take effect.
Note: The code can only take effect if there is a restriction filter set on the data type.
Procedure
Use a version of the WSDL file that defines the SOAP interface for the web service with the web services
DSA. WSDL files are most often made available by a web service at a known URL. For example, the
web service WSDL for a real-time stock quote service is available at http://www.webservicex.net/
stockquote.asmx?wsdl. You can compile a WSDL by using its URL or by using a copy of the file that is
stored locally in your file system.
Procedure
1. Navigate to the $IMPACT_HOME/bin directory.
2. In the command prompt, run the compiler script with the following options:
Where:
package_name
The name of the JAR file (without the .jar suffix) to be created by the script.
wsdl_file
The name of the JAR file (without the .jar suffix) to be created by the script.
destination
The directory to copy the generated JAR file to, the default directory is $IMPACT_HOME/wslib.
You must enter the entire command in one line, without any line breaks. For example, on UNIX:
The example command compiles a WSDL file, US.wsdl that is in the current working directory, and
creates the amazon.jar file, in the $IMPACT_HOME/wslib directory.
Another example shows how to compile a WSDL file using a URL:
./nci_compilewsdl weather
http://www.webservicex.net/WeatherForecast.asmx?WSDL ../wslib
Procedure
1. Change an existing WSDL file or create a new file that references an existing file.
2. Move all the Java archive files from the $IMPACT_HOME/wslib directory to a temporary location.
3. Restart Netcool/Impact.
4. Compile the WSDL file.
5. If the compiled WSDL file is not saved to the $IMPACT_HOME/wslib directory, move the new JAR file
to the $IMPACT_HOME/wslib directory.
6. Move all the Java archive files, except for the files that you either changed or referenced in your new
WSDL file, from the temporary directory to the $IMPACT_HOME/wslib directory.
If you do copy the files that you changed, your changes are overwritten with the original file.
Example
CallProps=NewObject();
CallProps.ProxyEnabled=true;
CallProps.ProxyHost=HostName;
CallProps.ProxyPort=PortNumber;
CallProps.ProxyDomain=DomainName;
CallProps.ProxyUsername=Username;
CallProps.ProxyPassword=Password;
CallProps.DecryptPassword=true;
WSSetDefaultPKGName
The WSSetDefaultPKGName function sets the default package that is used by WSNewObject and
WSNewArray.
The package name is the name that you supplied to the nci_compilewsdl script when you compiled
the WSDL file for the web service. It is also the name of the JAR file that is created by this script, without
the .jar suffix.
Syntax
This function has the following syntax:
WSSetDefaultPKGName(PackageName)
Parameters
The WSSetDefaultPKGName function has the following parameter.
PackageName String Name of the default WSDL package used by WSNewObject and
WSNewArray.
Example
The following example sets the default package that is used by subsequent calls to WSNewObject and
WSNewArray to google.
WSSetDefaultPKGName("google");
Syntax
This function has the following syntax:
Object = WSNewObject(ElementType)
Parameters
This WSNewObject function has the following parameter.
ElementType String Name of the complex data type that is defined in the WSDL
file. The name format is [Package.]TypeName, where
Package is the name of the package you created when you
compiled the WSDL file, without the .jar suffix.
Return Value
A new web services object.
Examples
The following example shows how to use WSNewObject to create a web services object, what you
previously called WSSetDefaultPKGName in the policy. This example creates an object of the data type
ForwardeeInfo as defined in the mompkg.jar file compiled from the corresponding WSDL.
// Call WSSetDefaultPKGName
WSSetDefaultPKGName("mompkg");
// Call WSNewObject
MyObject = WSNewObject("ForwardeeInfo");
The following example shows how to use WSNewObject to create a web services object, where you did
not previously call WSSetDefaultPKGName in the policy.
// Call WSNewObject
MyObject = WSNewObject("mompkg.ForwardeeInfo");
Syntax
This function has the following syntax:
Parameters
This WSNewSubObject function has the following parameters.
Return Value
A new web services child object.
Examples
The following example shows how to use WSNewSubObject to create a web services child object:
// Call WSNewSubObject
ticketId=WSNewSubobject(incident, "TICKETID");
WSNewArray
The WSNewArray function creates an array of complex data type objects or primitive values, as defined in
the WSDL file for the web service.
You use this function when you are required to pass an array of complex objects or primitives to a web
service as message parameters.
Syntax
This function has the following syntax:
Parameters
The WSNewArray function has the following parameters:
ElementType String Name of the complex object or primitive data type that is defined
in the WSDL file. The name format is [Package.]TypeName,
where Package is the name of the package you created when
you compiled the WSDL file, without the .jar suffix. The
package name is required only if you did not previously call the
WSSetDefaultPKGName function in the policy.
Return Value
The WSNewArray returns the new array that is created by the function.
Examples
The following example shows how to use WSNewArray to creates a web services array, where you
previously called WSSetDefaultPKGName in the policy. This example creates an array of the data type
String as defined in the mompkg.jar file that is compiled from a WSDL file.
// Call WSSetDefaultPKGName
WSSetDefaultPKGName("mompkg");
// Call WSNewArray
The following example shows how to use WSNewArray to create a web services array, where you did not
previously call WSSetDefaultPKGName in the policy.
// Call WSNewArray
The following example invokes a web service method called runPolicy and passes in a string array as
a parameter to the method. The policy creates a WSNewArray object and populates the object with 3
elements. Note that WSNewArray object is used only for arrays of primitives. For arrays of complex types,
you need to create a WSNewSubObject for each array element. Also, in general it is easier to use the web
services wizard to generate the web services policy from a WSDL, rather than manually creating the web
services policy.
RunPolicyDocument=WSNewObject("com.myexample.RunPolicyDocument");
_RunPolicy=WSNewSubObject(RunPolicyDocument,"RunPolicy");
_Arg0=WSNewArray("java.lang.String",3);
_Arg0[0] = 'aaa';
_Arg0[1] = 'bbb';
_Arg0[2] = 'ccc';
_RunPolicy.Arg0Array=_Arg0;
WSParams = {RunPolicyDocument};
WSService = 'MyWebService';
WSEndPoint = 'http://localhost:8888/MyWebService;
WSMethod = 'runPolicy';
Syntax
This function has the following syntax:
This function returns the value of your target web services call.
Parameters
The WSInvokeDL function has the following parameters:
WSEndPoin String The web service endpoint URL of the target web service.
t
WSMethod String The web service method defines which method you would like to call in
WSInvokeDL().
WSParams Array The web services operation parameters are defined by /definitions/
message/part elements in the WSDL file. It comprises an array that
contains all of the parameters that are required by the specified web
service operation.
callProps String, The optional container in which you can set any of the properties, which
Boolean, are listed in the callProps properties section.
integer
callProps properties
Remember: Any options that are set in callProps must precede the actual call to WSInvokeDL.
CacheStub
Caches generated stubs. This value must be set to true if either or both of the following properties
are enabled, ReuseHttpClient, MaintainSession.
Examples of usage:
callProps.CacheStub=true;
callProps.ReuseHttpClient = true;
CharSet
Sets the encoding other than UTF-8.
Chunked
Divides the packets into small chunks if the server supports the feature. The default property is true.
ConnectionManagerTimeout
Sets how long (in milliseconds) a client should wait for a free connection before timing
out. The default is 30000 milliseconds.
Example usage:
callProps.ConnectionManagerTimeout=30000;
Starting with 7.1.0.30, the ConnectionManagerTimeout property has been deprecated and you
should use WSTimeout instead.
CustomHeaders
Adds custom header values other than the headings that are already supported in the documentation.
DecryptPassword
Enables the decryption of an encrypted password in a policy.
EnableWSS
Enables Web Service Security. If you specify EnableWSS, you must also specify the following
properties:
• WSSRepository, which specifies the path location of WSS Repository.
• WSSConfigFile, which specifies configuration file for EnableWSS.
callProps.EnableWSS = true;
callProps.WSSRepository= "/opt/IBM/tivoli/impact/dsa/wsdsa/wss";
callProps.WSSConfigFile = "/opt/IBM/tivoli/impact/dsa/wsdsa/wss/conf/Sample03_wss.xml";
callProps.WSSPolicyFile = "/opt/IBM/tivoli/impact/dsa/wsdsa/wss/conf/policy03.xml";
GetHeaders
Retrieves the Web Service headers and returns them in the ResponseHeaders variable.
To retrieve the Web Service headers, use the following:
callProps.GetHeaders = true;
You can access individual headers with dot or bracket notation. For example, to access the Content-
Language header:
Log(ResponseHeaders);
ContentLanguage = ResponseHeaders["Content-Language"];
Log(ContentLanguage);
Sample output:
HandleFault
Is used to manage faults. Fault messages are returned from the web services server to indicate that
there is a problem.
callProps.KeepAlive = true;
LogSoapMessages
You can enable logging of outgoing and incoming soap messages, by setting the LogSoapMessages
property to true. This property should only be used for debugging purposes and should not be
enabled permanently in a production environment.
callProps = NewObject();
callProps.LogSoapMessages = "true";
WSInvokeDLResult = WSInvokeDL(WSService, WSEndPoint, WSMethod, WSParams,
callProps);
Sets the maximum number of parallel connections to a host. This value can be increased
if the web service client is experiencing timeouts while waiting for a free connection. This number
cannot exceed the value of MaxTotalConnections.
Example usage:
callProps.MaxConnectionsPerHost=10;
MaxTotalConnections
The total number of connections for the web service client across all hosts.
Example usage:
callProps.MaxTotalConnections=20;
Password
Specifies the password for basic authentication. PreemptiveAuth enables Preemptive
Authentication.
ReuseHttpClient
Enables the underlying infrastructure to reuse the HTTP client if one is available. The
ReuseHttpClient is useful if the client is using HTTPS to communicate with the server. The
parameter must be set to true or false.
Specifies how long the client should wait between data packets. If no data is received
before the SocketTimeout is reached, the connection will be considered inactive. The default is 60000
milliseconds.
Example usage:
Timeout
This property is used in a blocking scenario. The client system times out after the specified amount of
time.
You can optionally set a global web Service DSA call timeout property called
impact.server.dsainvoke.timeout. The property must be added to the Netcool/Impact server
property file, <servername>_server.props. It is best to use the timeout property on a per policy
basis as specified in callProps.Timeout.
The value is set in milliseconds, for example, impact.server.dsainvoke.timeout=30000 (30
seconds).
When you set the properties in any of the .props files, restart theNetcool/Impact server to
implement the changes.
If the impact.server.dsainvoke.timeout property is set, all WSInvokeDL calls use the same
timeout setting.
TrustCertificate
Allows the WSInvokeDL function to connect to an SSL endpoint without having to import
the chain into the trust store. The endpoint's SSL certificate must still be valid and not expired:
callProps.TrustCertificate=true;
Username
Specifies the user name for basic authentication.
WSTimeout
Specifies how long the client should wait when establishing a connection with the remote
host. The default is 60000 milliseconds.
Example usage:
callProps.WSTimeout=60000;
XMLFactory
When set to true, the function will use an internal XML library to generate the SOAP XML
payload. This may be useful in resolving compatibility issues with the default XML library.
Example usage:
callProps.XMLFactory=true;
Examples
Remember: Any options that are set in callProps must precede the actual call to WSInvokeDL.
callProps.Username="username";
callProps.Password="password";
The following example shows how to use the WSInvokeDL function to send a message to the target web
service.
Example using IPL:
ServiceName = "StockQuote";
EndPointURL = "http://www.webservicex.net/stockquote.asmx";
MethodName = "GetQuote";
ParameterArray = { "IBM" };
callProps = NewObject();
ServiceName = "StockQuote";
EndPointURL = "http://www.webservicex.net/stockquote.asmx";
MethodName = "GetQuote";
ParameterArray = [ "IBM" ];
Use the DecryptPassword policy parameter to enable the decryption of an encrypted password in a
policy that is used with the callProps function:
callProps=NewObject();
callProps.Password="<Web Serice encrypted using nci_crypt>";
callProps.DecryptPassword=true;
//default is false and must be plain text password.
The password is decrypted at policy runtime and is used in plain text internally to Netcool/Impact.
You can also use the CustomHeaders parameter to add custom http header values other than the
headings that are already supported in the documentation.
Headers = NewObject();
Headers.HeaderName1='HeaderValue1';
Headers.HeaderName2='HeaderValue2';
callProps.CustomHeaders=Headers;
callProps=NewObject();
callProps.HandleFault=true;
When the default value is false, the policy throws an exception. When the value is true, the policy returns
only the fault string message. No fault code is returned.
If the value is true, the return is similar to the following example.
To turn off the formatting and return the message in plain text add the following parameter anywhere in
<serverName>_server.props:
impact.wsinvoke.formatfaultmessage=false
Syntax
This function has the following syntax:
Parameters
The WSNewEnum function has the following parameters.
EnumType String The enumeration class name that exists in the package that is
created by nci_compilewsdl
Return Value
A new enumeration type and value.
Example
The following example shows how to use the WSNewEnum function to send a message to the target web
service.
Sending messages
You can use the web services DSA to send messages.
Procedure
1. Call WSSetDefaultPKGName.
2. Add message parameters with any required data.
3. Call WSInvoke or WSInvokeDL.
Important: [The WSInvoke feature is deprecated.]
When a WSDL file is compiled with nci_compilewsdl or by the web services DSA wizard, you must
use the WSInvokeDL() function to make web services calls.
Example
The following example shows how to set the default package:
WSSetDefaultPKGName("google");
In this example, google.jar is the package you created when you compiled the WSDL file for the web
service.
Note: If you do not call this function before you call WSNewArray or WSNewObject, you must explicitly
specify the package name in those function calls.
Example using web services DSA functions to create a real-time stock quote service
You can add a combination of web services DSA functions to create a policy. The following IPL policy
example uses a stock quote service.
WSSetDefaultPKGName("impactstockquote");
endpoint ="http://www.webservicex.net/stockquote.asmx";
quoteDoc=WSNewObject("net.webservicex.www.GetQuoteDocument");
params = { quoteDoc };
return = WSInvokeDL("StockQuote", endpoint, "GetQuote", params);
result = return.GetQuoteResponse.GetQuoteResult;
log("result = " + result);
The following example is the same but uses JavaScript, where the params = [quoteDoc]; value is
enclosed in braces ([]).
WSSetDefaultPKGName("impactstockquote");
endpoint ="http://www.webservicex.net/stockquote.asmx";
quoteDoc=WSNewObject("net.webservicex.www.GetQuoteDocument");
params = [ quoteDoc ];
return = WSInvokeDL("StockQuote", endpoint, "GetQuote", params);
result = return.GetQuoteResponse.GetQuoteResult;
Log("result = " + result);
WSSetDefaultPKGName("impactglbweather");
endpoint ="http://www.webservicex.net/globalweather.asmx";
weatherdoc=WSNewObject("net.webservicex.www.GetWeatherDocument");
The following example is the same but uses JavaScript, where the params value is enclosed in braces
([]).
WSSetDefaultPKGName("impactglbweather");
endpoint ="http://www.webservicex.net/globalweather.asmx";
weatherdoc=WSNewObject("net.webservicex.www.GetWeatherDocument");
Example that uses web services DSA functions to create a currency converter service
The policy in IPL, includes the following web service DSA functions: WSSetDefaultPKGName,
WSNewObject, WSNewSubObject, WSInvokeDL, and WSNewEnum.
WSSetDefaultPKGName("impactcurrencyconverter");
endpoint ="http://www.webservicex.net/CurrencyConvertor.asmx";
convDoc=WSNewObject("net.webservicex.www.ConversionRateDocument");
params = { convDoc };
return = WSInvokeDL("CurrencyConvertor", endpoint, "ConversionRate", params);
result = return.ConversionRateResponse.ConversionRateResult;
log("result = " + result);
log("--------------------------------");
The following example is the same but uses JavaScript, where the params value is enclosed in square
braces [].
WSSetDefaultPKGName("impactcurrencyconverter");
endpoint ="http://www.webservicex.net/CurrencyConvertor.asmx";
convDoc=WSNewObject("net.webservicex.www.ConversionRateDocument");
params = [ convDoc ];
return = WSInvokeDL("CurrencyConvertor", endpoint, "ConversionRate", params);
result = return.ConversionRateResponse.ConversionRateResult;
Log("result = " + result);
Log("--------------------------------");
Procedure
Compile the web services listener WSDL file in the usual way. See “Running the WSDL compiler script” on
page 44.
When the web services listener WSDL file has compiled, you can execute a policy like the following
example:
Example
To create a Java based client to run a policy, use the WSTestDL.java file as example to model the code.
Using the XML soap envelope client, the XML is similar to the following examples.
Run a policy without input parameters, no results are retuned.
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:typ="http://response.micromuse.com/types">
<soapenv:Header/>
<soapenv:Body>
<typ:runPolicy>
<arg0>PolicyNameTest</arg0>
<arg2>false</arg2>
</typ:runPolicy>
</soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope
xmlns:soapenv="http://
schemas.xmlsoap.org/soap/envelope/"
xmlns:typ="http://
response.micromuse.com/types">
<soapenv:Header/>
<soapenv:Body>
<typ:runPolicy>
<arg0>PolicyNameTest</arg0>
<!--Zero or more repetitions:-->
<arg1>
<desc>ProductName</desc>
<format>String</format>
<label>ProductName</label>
<name>ProductName</name>
<soapenv:Envelope
xmlns:soapenv="http://
schemas.xmlsoap.org/soap/envelope/"
xmlns:typ="http://
response.micromuse.com/types">
<soapenv:Header/>
<soapenv:Body>
<typ:runPolicy>
<arg0>PolicyNameTest</arg0>
<!--Zero or more repetitions:-->
<arg1>
<desc>ProductName</desc>
<format>String</format>
<label>ProductName</label>
<name>ProductName</name>
<value>Impact</value>
</arg1>
<arg1>
<desc>Company</desc>
<format>String</format>
<label>Company</label>
<name>Company</name>
<value>IBM</value>
</arg1>
<arg1>
<desc>Revision</desc>
<format>Integer</format>
<label>Revision</label>
<name>Revision</name>
<value>7</value>
</arg1>
<arg2>true</arg2>
</typ:runPolicy>
</soapenv:Body>
</soapenv:Envelope>
Runtime parameters
Runtime parameters in web services listener policies are handled in the same way as any other policy.
You can use the variable name to reference the parameters in the policy. No initialization of the variables
is required.
For example, if an incoming web services message contains runtime parameters named Param1,
Param2, and Param3, when it runs the policy the web services listener creates new variables in the
policy context with those parameter names. The following code shows how to reference those variables in
a policy:
WSListenerResult
WSListenerResult is a special data item that contains the result of a web services policy.
You can use NewObject function to create the WSListenerResult data and populate its member
variables with values. When the policy terminates, this data item is passed to the web services listener to
be returned to the calling application.
The following example shows how to create the WSListenerResult data item and populate its member
values.
WSListenerResult = NewObject();
WSListenerResult.Node = "192.168.1.1";
WSListenerResult.Location = "New York";
WSListenerResult.Summary = "Node not responding to ping.";
WSListenerResult can contain other data types. The caller parses the object to get the right data from
the result. The name contains the field name through which the caller can identify the type of data that is
used.
For example, the "SERVICEREQUESTIDENTIFIER" column from the database, is an Integer.
The assignment WSListenerResult.SERVICEREQUESTIDENTIFIER=_result[0]
.SERVICEREQUESTIDENTIFIER assigns the Integer value to the result. The result is the return value
from the GetByFilter function. If the value of the service request is "1", then:
• The getValue method from the policyExecutionResult returns 1.
• The getName method from the policyExecutionResult returns SERVICEREQUESTIDENTIFIER.
WSListenerResult = NewObject();
WSListenerResult.FirstName=”MyName”;
WSListenerResult.LastName=”MyLastName”;
WSListenerResult=NewObject();
index = 0;
objects=[];
objects1=[];
while (index < 5) {
Obj = NewObject();
Obj.FirstName="FistNameJS"+index;
Obj.LastName="LastNameJS"+index;
Obj.Location="LocationJS"+index;
Obj1=NewObject();
Obj1.DOB=LocalTime(GetDate());
Obj1.PlaceOfBirth="City"+index;
objects[index]=Obj;
objects1[index]=Obj1;
index = index +1;
}
WSListenerResult.FirstObject=objects;
WSListenerResult.SecondObject=objects1;
The name of the array can be anything, it is not used as an element, for example, FirstObject,
SecondObject.
WSListenerResult=NewObject();
Log( "class of WSListenerResult: " + ClassOf(WSListenerResult));
index = 0;
objects={};
while (index < 5) {
Obj = NewObject();
Obj.FirstName="FistName"+index;
Obj.LastName="LastName"+index;
Obj.Location="Location"+index;
index = index +1;
objects=objects+{Obj};
}
WSListenerResult.ImpactObject=objects;
WSListenerResult.Product="Impact";
The Return Document: The XML returned from calling runPolicy method has parent name element
“return”: example:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<a:runPolicyResponse xmlns:a="http://types.common.response.micromuse.com/">
<return>
<name>Product</name>
<value>Impact</value>
</return>
<return>
<name>Location</name>
<value>Location0</value>
</return>
<return>
<name>FirstName</name>
<value>FistName0</value>
</return>
<return>
<name>LastName</name>
<value>LastName0</value>
</return>
<return>
<name>Location</name>
<value>Location1</value>
</return>
<return>
<name>FirstName</name>
<value>FistName1</value>
</return>
<return>
<name>LastName</name>
<value>LastName1</value>
</return>
</a:runPolicyResponse>
</soap:Body>
</soap:Envelope>
SOAP endpoint
The Simple Object Access Protocol (SOAP) endpoint is a URL. It identifies the location on the built-in
HTTP service where the web services listener listens for incoming requests. Calling applications must
specify this endpoint when they send web services messages to Netcool/Impact.
The endpoint URL varies depending on the configuration of Netcool/Impact. The following URL uses the
default configuration.
http://<hostname>:<port>/jaxws/impact/ImpactWebServiceListenerDLIfc
Where <hostname> is the name of the system where Netcool/Impact is installed, <port> is the port
number that is used by the built-in HTTP service. The default port number is 9080.
The following example shows the endpoint URL for a web services listener that is running on a system
named impact_01 and uses the default port.
http://impact_01:9080/jaxws/impact/ImpactWebServiceListenerDLIfc
nci_findendpoint server_name
Where server_name is the name of the Impact Server instance for example, NCI.
The web services call must provide a user name who has the ImpactAdminUser role in the Impact Server
and the password for this user. By default, the impactadmin user has the ImpactAdminUser role.
WSDL file
The Web Services Description Language (WSDL) file is an XML document that describes the web services
interface.
The WSDL file specifies three messages that define the terms of communication between Tivoli Netcool/
Impact and calling applications. Calling applications use these messages to log in to Tivoli Netcool/
Impact and to request the execution of a policy. You can also use the messages to respond to login
requests and return policy results. The WSDL file also specifies types of data that can be passed in the
body of the messages.
The WSDL specifies the following messages:
• runPolicy
• runPolicyResponse
• WSListenerException
runPolicy
The runPolicy message requests that Tivoli Netcool/Impact run the specified policy.
The following table shows the parameters in runPolicy.
Parameter Description
arg2 Specifies whether to return the results of the policy to the calling application.
A calling application sends this message. The web services listener responds by returning a message of
type runPolicyResponse.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:typ="http://types.common.response.micromuse.com/">
<soapenv:Header/>
<soapenv:Body>
<typ:runPolicy>
<arg0>PolicyName</arg0>
<arg1>
<desc>input_parameter</desc>
<format>String</format>
<label>input_parameter</label>
<name>input_parameter</name>
<value>value</value>
</arg1>
<arg2>true</arg2>
</typ:runPolicy>
</soapenv:Body>
</soapenv:Envelope>
Policy parameters
A policy can be configured to accept runtime parameters. For more information on how to define
parameters, see Working with policy parameters
To populate the parameters in your run request, declare each parameter using an arg2 element.
The following table shows the parameters in policyUserParams.
Parameter Description
format Specify the parameter format type. Supported formats include String,
Long_String, Integer, Long,
Float, Double, Date, Timestamp, Boolean.
name The name of the policy parameter. Must match the name of the parameter as
defined by the policy.
Log(input_parameter); // Test
The backslash character is treated as an escape character by the policy engine. If a parameter value
contains a backslash character, you must double escape the string otherwise the run attempt will fail with
a com.micromuse.common.parser.internal.core.ParseException error.
Example:
<arg1>
<desc>input_parameter</desc>
<format>String</format>
<label>input_parameter</label>
<name>input_parameter</name>
<value>File Server G:\\</value>
</arg1>
You can use the EscapeString in the format field to preserve backslashes without the need
to double escape them.
For example, the following policy uses EscapeString to preserve the backslash in the parameter value.
<arg1>
<desc>input_parameter</desc>
<format>EscapeString</format>
<label>input_parameter</label>
<name>input_parameter</name>
<value>File Server G:\</value>
</arg1>
runPolicyResponse
The runPolicyResponse message is sent by the web services listener in response to a request from a
calling application to run a policy.
The runPolicyResponse contains a single parameter result. This parameter contains an array of
name-value pairs that correspond to the member variables in the WSListenerResult data item that is
returned by the policy.
The web services listener sends this message to a calling application if the wantResult parameter was
specified as true in the originating runPolicy message.
WSListenerException
The WSListenerException message is sent by the web services listener in response to invalid
messages from a calling application.
The WSListenerException contains a single parameter named WSListenerException that provides
detail about the error.
test_wslistener.bat
http://ImpactHostName.ibm.com:9080/jaxws/impact/ImpactWebServiceListenerDLIfc
impactadmin netcool123
1. To create a Java Client to connect to the web services listener, use the WSTestDL.java file that is in
the $IMPACT_HOME/integrations/web-service-listener directory.
2. To start the policy by using the XML Soap Envelop client such as SoapUI.
• Run a policy with one input parameter that does not return a result.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<typ:runPolicy xmlns:typ="http://response.micromuse.com/types">
<arg0>WSSSample03</arg0>
<arg1>
<desc>Product</desc>
<format>String</format>
<label>Product</label>
<name>Product</name>
<value>Impact</value>
</arg1>
<arg2>false</arg2>
</typ:runPolicy>
</soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<typ:runPolicy xmlns:typ="http://response.micromuse.com/types">
<arg0>WSSSample03</arg0>
<arg1>
<desc>Product</desc>
<format>String</format>
<label>Product</label>
<name>Product</name>
<value>Impact</value>
</arg1>
<arg1>
<desc>Company</desc>
<format>String</format>
<label>Company</label>
<name>Company</name>
<value>IBM</value>
</arg1>
<arg2>true</arg2>
</typ:runPolicy>
</soapenv:Body>
</soapenv:Envelope>
Procedure
1. Use the following command to export the self-signed certificate to a file called mycertificate.
2. When prompted enter the keystore password which will be the impactadmin user password
configured at installation time.
3. Copy the mycertificate file to the location where you want to start the WebService call and import
the certificate into the truststore that is used by the Java process. By default the truststore that is
used by the Java process is in the $JAVA_HOME/jre/lib/security/cacerts file and its default
password is changeit.
This password is not managed or updated by the Netcool/Impact installer. If you change the password
you can for you convenience make it the same as the Liberty or Impact keystore password.
If you are running the test_wslistener script from the Netcool/Impact installation, the
$JAVA_HOME that is used is $IMPACT_HOME/sdk.
4. When prompted enter the Java keystore password.
5. Use the following command to run the test_wslistener script:
Where <hostname> is the host name you configured in the CN field of the dname argument of the
certificate.
6. Run the following command to execute the sample client on a remote host or the Impact Server.
$JAVA_HOME\bin\java -Djavax.net.ssl.keyStore=
$JAVA_HOME\<jre>\lib\security\cacerts"
-cp ".;<$IMPACT_HOME>\integrations\web-service-listener\lib\*"
WSTestDL https:/<impacthost>:9081/jaxws/impact/ImpactWebServiceListenerDLIfc
impactadmin <password> password <policy>
Where <password> is the impactadmin user password and <policy> is the name of the policy to
execute.
Procedure
1. In the Policies tab, select the arrow next to the New Policy icon. To run the Web services wizard,
select Use Wizard > Web Services.
Procedure
1. Get the latest WSDL file which must match your target web service.
2. Determine the endpoint of your target running web service.
3. Run the $IMPACT_HOME/bin/nci_compilewsdl script to compile the target WSDL file. Always
place the output JAR file to $IMPACT_HOME/wslib directory. Otherwise, Netcool/Impact is not able
to find the JAR file at run time.
4. Use policy editor to write your policy to make web services calls.
5. Run the policy that you created.
Procedure
1. Stop the Impact Server.
2. Remove the old JAR file from the $IMPACT_HOME/wslib directory.
3. Start the Impact Server.
4. Run the nci_compilewsdl script from IMPACT_HOME/bin to generate the new JAR file in the wslib
directory or alternatively run the web services wizard to generate a new JAR file and a new policy.
Web service DSA has limited support to Web services security standard defined by Oasis-Open. The
following security features are supported:
• User name token authentication
• User name token authentication with a plain text password
• Message integrity and non-repudiation with signature
• Encryption
• Sign and encrypt messages
Procedure
1. Stop all the Impact Servers in the cluster.
2. Complete the following steps for the primary Impact Server. These changes are replicated to the
secondary servers in the cluster.
a. Update the $IMPACT_HOME/dsa/wsdsa/wss/conf/wss.xml file in your Tivoli Netcool/Impact
installation directory to set up security features that are required by your web service calls.
For most cases, you must update two related XML elements, which are OutflowSecurity and
possibly InflowSecurity in your wss.xml file. See Chapter 7, “Web services security,” on page
71 for examples on how to configure the OutflowSecurity and InflowSecurity parameters.
b. Update the $IMPACT_HOME/dsa/wsdsa/wss/conf/wscb.properties file to set up user ID
and password that is required by particular security features. For example, UsernameToken or
Signature. This file has the following format:
num=2
uid.1=client
pwd.1=apache
uid.2=service
pwd.2=apache
where num property defines how many user names and password pairs are included in the file.
uid.1 defines the user name for the first pair, while pwd.1 is the password for the first pair. The
same scheme applies to the consecutive pairs.
3. Complete the following step for each Impact Server in the cluster:
a. If you require web service security features such as signature or encryption, you must upload a
keystore with your private key to $IMPACT_HOME/dsa/wsdsa/wss/conf/. Create a properties
file under $IMPACT_HOME/dsa/wsdsa/wss/conf/ and add the following properties:
org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
org.apache.ws.security.crypto.merlin.keystore.type=jks
org.apache.ws.security.crypto.merlin.keystore.password=apache
org.apache.ws.security.crypto.merlin.file=client.jks
Where file is the name of the keystore and password is the password used to access the keystore.
See “Sign and encrypt messages” on page 77 for more information.
4. Start the primary Impact Server. Ensure that it starts and initializes successfully.
callProps = NewObject();
callProps.EnableWSS = true;
callProps.WSSRepository= "/opt/IBM/tivoli/impact/dsa/wsdsa/wss";
callProps.WSSConfigFile = "/opt/IBM/tivoli/impact/dsa/wsdsa/wss/conf/wss.xml";
callProps.WSSPolicyFile = "/opt/IBM/tivoli/impact/dsa/wsdsa/wss/conf/policy.xml";
Note: The use of WSSConfig has been deprecated. The web service security should be
configured using WSSPolicyFile instead.
6. Optional. You can also configure HTTP basic authentication by adding the following optional properties
into the policy.
callProps.Username="myName";
callProps.Password="myPassword";
7. The supporting security feature, WSInvokeDL() function is started with an additional callProps
object:
Procedure
1. Open the WSSConfigFile as defined in the web service policy:
callProps.WSSConfigFile = "/opt/IBM/tivoli/impact/dsa/wsdsa/wss/conf/wss.xml";
2. Locate the transportSender and change the name from http to https:
<transportSender class="org.apache.axis2.transport.http.CommonsHTTPTransportSender"
name="https">
<parameter locked="false" name="PROTOCOL">HTTP/1.1</parameter>
<parameter locked="false" name="Transfer-Encoding">chunked</parameter>
</transportSender>
Procedure
1. Open the $IMPACT_HOME/dsa/wsdsa/wss/conf/wss.xml parameters file and configure the
OutflowSecurity parameter.
<parameter name="OutflowSecurity"
<action>
<items>UsernameToken Timestamp</items>
num=1
uid.1=bob
pwd.1=bobPassword
The wscb.properties defines username/password pairs. In this example, uid refers to the
username and pwd is the user's password.
3. If no InflowSecurity is required, then remove the existing InflowSecurity parameter from
$IMPACT_HOME/dsa/wsdsa/wss/conf/wss.xml
4. Restart the Impact server to load the file changes.
5. Open the Web Service policy and set the following properties for the WSInvokeDL function:
callProps = NewObject();
callProps.EnableWSS = true;
callProps.WSSRepository= "/opt/IBM/tivoli/impact/dsa/wsdsa/wss";
callProps.WSSConfigFile = "/opt/IBM/tivoli/impact/dsa/wsdsa/wss/conf/wss.xml";
Results
Outbound messages will be sent with an authentication token and timestamp.
Procedure
1. Open the $IMPACT_HOME/dsa/wsdsa/wss/conf/wss.xml parameters file and configure the
OutflowSecurity parameter.
<parameter name="OutflowSecurity"
<action>
<items>UsernameToken</items>
<user>bob</user>
<passwordCallbackClass>com.micromuse.common.util.WSPWCBHandler</
passwordCallbackClass>
<passwordType>PasswordText</passwordType>
</action>
<parameter>
num=1
uid.1=bob
pwd.1=bobPassword
Where num represents the total number of user/password pairs. Each username and password are
represented as numeric pairs with the key uid and pwd.
3. If no InflowSecurity is required, then remove any existing InflowSecurity parameter from
$IMPACT_HOME/dsa/wsdsa/wss/conf/wss.xml
4. Restart the Impact server to load the file changes.
5. Open the Web Service policy and set the following properties for the WSInvokeDL function:
callProps = NewObject();
callProps.EnableWSS = true;
callProps.WSSRepository= "/opt/IBM/tivoli/impact/dsa/wsdsa/wss";
callProps.WSSConfigFile = "/opt/IBM/tivoli/impact/dsa/wsdsa/wss/conf/wss.xml";
Results
Outbound messages will be sent with a plain text authentication token.
Procedure
1. Upload or create a keystore with the keys to be used for signing to $IMPACT_HOME/dsa/wsdsa/wss/
conf/.
For this example, messages will be signed with the private key under the client alias.
2. Open the $IMPACT_HOME/dsa/wsdsa/wss/conf/wss.xml parameters file and configure the
OutflowSecurity parameter.
<parameter name="OutflowSecurity">
<action>
<items>Timestamp Signature</items>
<user>client</user>
<signaturePropFile>client.properties</signaturePropFile>
<passwordCallbackClass>com.micromuse.common.util.WSPWCBHandler</passwordCallbackClass>
<signatureKeyIdentifier>DirectReference</signatureKeyIdentifier>
</action>
<parameter>
<parameter name="InflowSecurity">
<action>
<items>Timestamp Signature</items>
<signaturePropFile>client.properties</signaturePropFile>
</action>
<parameter>
org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
org.apache.ws.security.crypto.merlin.keystore.type=jks
org.apache.ws.security.crypto.merlin.keystore.password=apache
org.apache.ws.security.crypto.merlin.file=client.jks
Where file is the location of the keystore from Step 1. The password should be the password used to
access the keystore.
5. Configure the password callback file (wscb.properties). Create $IMPACT_HOME/dsa/
wsdsa/wss/conf/wscb.properties and add the username and password pairs to the file.
num=1
uid.1=client
pwd.1=apache
The wscb.properties defines username/password pairs. In this example, uid refers to the aliases
found in the keystore and pwd is the password used to access the key entry.
6. Restart the Impact server to load the file changes.
7. Open the Web Service policy and set the following properties for the WSInvokeDL function:
callProps = NewObject();
callProps.EnableWSS = true;
callProps.WSSRepository= "/opt/IBM/tivoli/impact/dsa/wsdsa/wss";
callProps.WSSConfigFile = "/opt/IBM/tivoli/impact/dsa/wsdsa/wss/conf/wss.xml";
Results
Outbound service messages will be signed using the private key from the keystore.
Encryption
Use the following Rampart configuration (wss.xml) to enable message level encryption for the web
service.
Procedure
1. Upload or create a keystore with the keys to be used for encryption to $IMPACT_HOME/dsa/
wsdsa/wss/conf/.
For this example, messages will be encrypted with the public key under the service alias.
<parameter name="OutflowSecurity">
<action>
<items>Encrypt</items>
<encryptionUser>service</EncryptionUser>
<encryptionPropFile>client.properties</encryptionPropFile>
</action>
</parameter>
<parameter name="InflowSecurity">
<action>
<items>Encrypt</items>
<passwordCallbackClass>com.micromuse.common.util.WSPWCBHandler</passwordCallbackClass>
<decryptionPropFile>client.properties</decryptionPropFile>
</action>
</parameter>
org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
org.apache.ws.security.crypto.merlin.keystore.type=jks
org.apache.ws.security.crypto.merlin.keystore.password=apache
org.apache.ws.security.crypto.merlin.file=client.jks
Where file is the location of the keystore from Step 1. The password should be the password used to
access the keystore.
5. Configure the password callback file (wscb.properties). Create $IMPACT_HOME/dsa/
wsdsa/wss/conf/wscb.properties and add the username and password pairs to the file.
num=1
uid.1=service
pwd.1=apache
Where uid.1 is the keystore alias of the private key and pwd.1 is the password used to access the
keystore.
6. Restart the Impact server to load the file changes.
7. Open the Web Service policy and set the following properties for the WSInvokeDL function:
callProps = NewObject();
callProps.EnableWSS = true;
callProps.WSSRepository= "/opt/IBM/tivoli/impact/dsa/wsdsa/wss";
callProps.WSSConfigFile = "/opt/IBM/tivoli/impact/dsa/wsdsa/wss/conf/wss.xml";
Procedure
1. Upload or create a keystore with the keys to be used for signing/encryption/decryption to
$IMPACT_HOME/dsa/wsdsa/wss/conf/.
For this example, messages will be encrypted with the public key under the service alias and signed
with the private key under the client alias.
2. Open the $IMPACT_HOME/dsa/wsdsa/wss/conf/wss.xml parameters file and configure the
OutflowSecurity parameter.
<parameter name="OutflowSecurity">
<action>
<items>Timestamp Signature Encrypt</items>
<user>client</user>
<passwordCallbackClass>com.micromuse.common.util.WSPWCBHandler</
passwordCallbackClass>
<signaturePropFile>client.properties</signaturePropFile>
<signatureKeyIdentifier>DirectReference</signatureKeyIdentifier>
<encryptionKeyIdentifier>SKIKeyIdentifier</encryptionKeyIdentifier>
<encryptionUser>service</encryptionUser>
</action>
</parameter>
<parameter name="InflowSecurity">
<action>
<items>Timestamp Signature Encrypt</items>
<passwordCallbackClass>com.micromuse.common.util.WSPWCBHandler</
passwordCallbackClass>
<signaturePropFile>client.properties</signaturePropFile>
</action>
</parameter>
org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
org.apache.ws.security.crypto.merlin.keystore.type=jks
org.apache.ws.security.crypto.merlin.keystore.password=apache
org.apache.ws.security.crypto.merlin.file=client.jks
Where file is the location of the keystore from Step 1. The password should be the password used to
access the keystore.
5. Configure the password callback file (wscb.properties). Create $IMPACT_HOME/dsa/
wsdsa/wss/conf/wscb.properties and add the username and password pairs to the file.
num=2
uid.1=service
pwd.1=apache
uid.2=client
pwd.2=apache
The wscb.properties defines username/password pairs. In this example, uid refers to the aliases
found in the keystore and pwd is the password used to access the key entry.
6. Restart the Impact server to load the file changes.
7. Open the Web Service policy and set the following properties for the WSInvokeDL function:
callProps = NewObject();
callProps.EnableWSS = true;
callProps.WSSRepository= "/opt/IBM/tivoli/impact/dsa/wsdsa/wss";
callProps.WSSConfigFile = "/opt/IBM/tivoli/impact/dsa/wsdsa/wss/conf/wss.xml";
Results
All outbound web service messages service calls will be encrypted using the public key from the keystore
alias service. Outbound messages will also be timestamped and signed using the key from the keystore
alias client. Inbound traffic will be decrypted and its timestamp and signature verified using the same
keystore.
Procedure
1. Configure Web Service Security as per the “Sign and encrypt messages” on page 77 topic.
The keystore and wscb.properties will be used in a similar manner but using a Rampart policy file.
2. Remove the OutflowSecurity and InflowSecurity parameters from the Axis2 descriptor file
(WSSConfigFile), $IMPACT_HOME/dsa/wsdsa/wss/conf/Sample03_wss.xml.
3. Upload the WS-Policy language file to $IMPACT_HOME/dsa/wsdsa/wss/conf/.
4. Open the WS-Policy file and add a rampart configuration within the body of the WS-Policy.
The following WS-Policy example, policy.xml demonstrates the rampart configuration for signed
and encrypted messages using AsymmetricBinding.
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
cd IMPACT_HOME/wslib/
IMPACT_HOME/sdk/bin/jar –uf sample03.jar ./client.jks
callProps = NewObject();
callProps.EnableWSS = true;
callProps.WSSRepository= "/opt/IBM/tivoli/impact/dsa/wsdsa/wss";
callProps.WSSConfigFile = "/opt/IBM/tivoli/impact/dsa/wsdsa/wss/conf/Sample03_wss.xml";
Add the WSSPolicyFile property with the location of the WS-Policy file:
callProps.WSSPolicyFile = "/opt/IBM/tivoli/impact/dsa/wsdsa/wss/conf/policy.xml";
Worked example
This example shows how to set up a stand-alone Apache Axis2 rampart server with an Netcool/
Impact policy to enable Web Service Security.
Procedure
1. Set up Rampart as a stand-alone server.
cp $RAMPART_HOME/modules/rahas-1.7.0.mar $AXIS2_HOME/repository/modules/
cp $RAMPART_HOME/modules/rampart -1.7.0.mar $AXIS2_HOME/repository/modules/
cd $RAMPART_HOME/samples/policy directory
g. Run the following command to build sample03 application and start the stand-alone server.
The command creates all the necessary files and starts a stand-alone application for sample03.
The port number is displayed in the terminal.
Buildfile: /home/netcool/apache/rampart-1.7.0/samples/policy/build.xml
[echo] AXIS2_HOME=/home/netcool/apache/axis2-1.7.9/lib
[echo] /home/netcool/apache/axis2-1.7.9/lib
clean:
[delete] Deleting directory /home/netcool/apache/rampart-1.7.0/samples/policy/build
check.dependency:
service.03:
[mkdir] Created dir: /home/netcool/apache/rampart-1.7.0/samples/policy/build/
service_repositories/sample03
[mkdir] Created dir: /home/netcool/apache/rampart-1.7.0/samples/policy/build/
service_repositories/sample03/services
[mkdir] Created dir: /home/netcool/apache/rampart-1.7.0/samples/policy/build/
service_repositories/sample03/modules
[copy] Copying 3 files to /home/netcool/apache/rampart-1.7.0/samples/policy/build/
service_repositories/sample03/modules
[mkdir] Created dir: /home/netcool/apache/rampart-1.7.0/samples/policy/build/temp
[mkdir] Created dir: /home/netcool/apache/rampart-1.7.0/samples/policy/build/temp/
META-INF
[javac] /home/netcool/apache/rampart-1.7.0/samples/policy/build.xml:170: warning:
'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for
repeatable builds
[javac] Compiling 2 source files to /home/netcool/apache/rampart-1.7.0/samples/policy/
build/temp
[copy] Copying 1 file to /home/netcool/apache/rampart-1.7.0/samples/policy/build/
temp/META-INF
[copy] Copying 1 file to /home/netcool/apache/rampart-1.7.0/samples/policy/build/temp
[copy] Copying 1 file to /home/netcool/apache/rampart-1.7.0/samples/policy/build/temp
[copy] Copying 1 file to /home/netcool/apache/rampart-1.7.0/samples/policy/build/temp
[jar] Building jar: /home/netcool/apache/rampart-1.7.0/samples/policy/build/
service_repositories/sample03/services/sample03.aar
[delete] Deleting directory /home/netcool/apache/rampart-1.7.0/samples/policy/build/
temp
[java] [SimpleHTTPServer] Starting
[java] [SimpleHTTPServer] Using the Axis2 Repository /home/netcool/apache/
rampart-1.7.0/samples/policy/build/service_repositories/sample03
[java] [SimpleHTTPServer] Listening on port 8080
[java] [INFO] Deploying module: addressing-1.7.9
- file:/home/netcool/apache/rampart-1.7.0/samples/policy/build/service_repositories/
sample03/modules/addressing-1.7.9.mar
Deployed services
sample03
Available operations
-echo
Click the sample03 link to view the WSDL file. The full link to the WSDL file is http://
server:8080/axis2/services/sample03?wsdl. Make a note of the URL address.
Now that service is up and running, the next step is to create a policy in Netcool/Impact that will
access the endpoint.
2. Create a Netcool/Impact policy and configure Web Service Security.
a. Create a new policy with the web services wizard. When prompted for the WSDL path, enter the
URL from Step 1h, http://server:8080/axis2/services/sample03?wsdl. For the package
name, enter sample03.
If the web service security requires a username/password, you can configure this in Step 5 of the
wizard under the Web Service Security section. For this example, the endpoint does not require
user authentication.
b. The wizard creates the policy with the following code:
//Specify parameters
EchoDocument=WSNewObject("org.apache.rampart.samples.policy.sample03.EchoDocument");
_Echo=WSNewSubObject(EchoDocument,"Echo");
WSParams = {EchoDocument};
c. To load the WS-Policy file, we need to set the WSSPolicyFile property. Locate the callProps
section.
d. The web service wizard will also compile the WSDL file into a jar file IMPACT_HOME/wslib/
sample03.jar
And add the following line:
callProps.WSSPolicyFile = "/opt/IBM/tivoli/impact/dsa/wsdsa/wss/conf/policy.xml";
3. After creating the policy, we need to update the Axis2 descriptor file. We want to use a Rampart
WS-Policy file instead of the Axis2 descriptor file.
a. Open the file IMPACT_HOME/dsa/wsdsa/wss/conf/Sample03_wss.xml. The XML file is
generated from the wss.xml.template file and must be customized to suit the requirements
of the sample03 endpoint. Locate and delete the OutflowSecurity and InflowSecurity
parameters.
4. Upload the Rampart policy file to Impact and update it to load passwords from wscb.properties.
a. Copy the Rampart sample policy file from RAMPART_HOME/samples/policy/sample01/
policy.xml and upload it to IMPACT_HOME/dsa/wsdsa/wss/conf
b. Open IMPACT_HOME/dsa/wsdsa/wss/conf/policy.xml and locate the
passwordCallbackClass entry:
<ramp:passwordCallbackClass>org.apache.rampart.samples.policy.sample03.PWCBHandler</
ramp:passwordCallbackClass>
<ramp:passwordCallbackClass>com.micromuse.common.util.WSPWCBHandler</
ramp:passwordCallbackClass>
num=2
uid.1=service
pwd.1=apache
uid.2=client
pwd.2=apache
cd /opt/IBM/tivoli/impact/wslib
/opt/IBM/tivoli/impact/sdk/bin/jar -uf sample01.jar /opt/IBM/tivoli/impact/dsa/wsdsa/wss/
conf/client.jks
Results
The policy log will print the following entry:
Procedure
1. Obtain and install the required JMS client libraries.
2. Copy the client JAR files from the JMS client installation directory to the $IMPACT_HOME/dsalib
directory.
3. Restart the Impact Server.
4. Create a JMS data source, and configure it for the JMS source.
For more information about creating a JMS data source, see “JMS data source” on page 86.
5. Handle the incoming JMS messages.
You can handle the incoming JMS messages by using any of these approaches:
• Write JMS policies that use the JMS data source, and the JMS functions.
For more information, see “Writing JMS DSA policies” on page 90.
• Configure the JMSListener service to send JMS events to a policy.
If you use the JMSListener to send JMS messages to your policy, you do not have to use the
ReceiveJMSMessage function to receive them. For more information, see “Handling incoming
messages from a JMS message listener” on page 96.
Procedure
1. Obtain the OpenJMS libraries from the OpenJMS website http://openjms.sourceforge.net/.
2. To install OpenJMS, follow the procedure in the getting started information that is available on the
OpenJMS website.
3. Copy the OpenJMS client JAR files to the $IMPACT_HOME/dsalib directory.
You can find the OpenJMS client JAR files in the lib subdirectory in the OpenJMS installation
directory.
4. Restart the Impact Server.
5. To start the OpenJMS server, use the startup script that is in the bin subdirectory in the OpenJMS
installation directory.
6. Create a JMS data source, and configure it for OpenJMS.
For more information, see “JMS data source” on page 86
Table 24. General settings for the JMS data source window
Window element Description
Data Source Name Enter a unique name to identify the data source.
You can use only letters, numbers, and the
underscore character in the data source name.
If you use UTF-8 characters, make sure that the
locale on the Impact Server where the data source
is saved is set to the UTF-8 character encoding.
org.exolab.jms.jndi.
InitialContextFactory
JNDI Provider URL Enter the JNDI provider URL. The JNDI provider
URL is the network location of the JNDI provider.
The required value for this field varies by JMS
implementation. For OpenJMS, the default value
of this property is tcp://hostname:3035, where
host name is the name of the system on which
OpenJMS is running. The network protocol TCP or
RMI, must be specified in the URL string. For other
JMS implementations, see the related product
documentation.
JNDI URL Packages Enter the Java package prefix for the JNDI context
factory class. For OpenJMS, BEA WebLogic, and
Sun Java Application Server, you are not required
to enter a value in this field.
JMS Connection Factory Name Enter the name of the JMS connection factory
object. The JMS connection factory object is
a Java object that is responsible for creating
new connections to the messaging system.
The connection factory is a managed object
that is administered by the JMS provider. For
example, if the provider is BEA WebLogic, the
connection factory object is defined, instantiated,
and controlled by that application. For the
name of the connection factory object for your
JMS implementation, see the related product
documentation.
JMS Destination Name Enter the name of a JMS topic or queue, which is
the name of the remote topic or queue where the
JMS message listener listens for new messages.
Procedure
1. Open the JMS data source for editing in a text editor of your choice.
You can find all data sources in the $IMPACT_HOME/etc/ directory. The data source file name
is <servername>_<datasourceName>.ds. <servername> is the name of the Impact Server
instance, and <datasourceName> is the name of your JMS data source as displayed in the data
source editor in GUI.
2. Add your JNDI properties in the following format:
<datasourceName>.JMS.DSPROPERTY.#.NAME=<property>
<datasourceName>.JMS.DSPROPERTY.#.VALUE=<property value>
# is the property number in a sequence of properties, the starting number is 1, for example:
<datasourceName>.JMS.DSPROPERTY.1.NAME=java.naming.factory.initial
<datasourceName>.JMS.DSPROPERTY.1.VALUE=org.exolab.jms.jndi.
InitialContextFactory
<datasourceName>.JMS.DSPROPERTY.2.NAME=java.naming.provider.url
<datasourceName>.JMS.DSPROPERTY.2.VALUE=tcp://jndi_host:3035
<datasourceName>.JMS.DSPROPERTY.3.NAME=java.naming.security.principal
<datasourceName>.JMS.DSPROPERTY.3.VALUE=User1
<datasourceName>.JMS.DSPROPERTY.4.NAME=java.naming.security.credentials
<datasourceName>.JMS.DSPROPERTY.4.VALUE=password
<datasourceName>.JMS.NUMDSPROPERTIES=4
Policy To Execute Select the policy that you created to run in response to incoming
messages from the JMS service.
JMS Data Source JMS data source to use with the service.
You need an existing and valid JMS data source for the
JMS Message Listener service to establish a connection with
the JMS implementation and to receive messages. For more
information about creating JMS data sources, see “JMS data
source configuration properties” on page 86.
Message Selector The message selector is a filter string that defines which
messages cause Netcool/Impact to run the policy specified in the
service configuration. You must use the JMS message selector
syntax to specify this string. Message selector strings are similar in
syntax to the contents of an SQL WHERE clause, where message
properties replace the field names that you might use in an SQL
statement.
The content of the message selector depends on the types and
content of messages that you anticipate receiving with the JMS
message listener. For more information about message selectors,
see the JMS specification or the documentation distributed with
your JMS implementation. The message selector is an optional
property.
Durable Subscription: Enable You can configure the JMS message listener service to use
durable subscriptions for topics that allow the service to receive
messages when it does not have an active connection to the
JMS implementation. A durable subscription can have only one
active subscriber at a time. Only a JMS topic can have durable
subscriptions.
Note: Since a durable connection can have only one active
subscriber at a time, in a cluster configuration during failover and
failback, a delay/pause can be configured. The delay/pause allows
the service to shut down on the other cluster members during
failover/failback.
The delay/pause is configured in the jmslistener properties
file using the durablejmspause property, for example:
impact.<jmslistenerservicename>.durablejmspause=3
0000. The durableJmsPause property defines the time in
milliseconds, so
impact.<jmslistenerservicename>.durablejmspause=3
0000 defines a pause of 30 seconds.
Clear Queue Clear the message waiting in the JMSMessageListener queue that
has not yet been picked by the EventProcessor service. It is
recommended not to do this while the Service is running.
Starts automatically when server Select to automatically start the service when the server starts.
starts You can also start and stop the service from the GUI.
Procedure
1. Create and configure a JMS data source
For more information, see “JMS data source” on page 86.
2. Create a message properties context.
For more information, see “Message properties context” on page 91.
3. Create a message body string or context.
For more information, see “Creating a message body string or context” on page 93.
4. Call the SendJMSMessage function and pass the values the JMS data source, the message properties
context, and the specified message body as runtime parameters.
For more information about the syntax of the SendJMSMessage function, see “SendJMSMessage” on
page 91.
SendJMSMessage
The SendJMSMessage function sends a message to the specified destination by using the Java Message
Service (JMS) DSA.
To send the message, you call the SendJMSMessage function and pass the JMS data source, a message
properties context, and the message body as input parameters.
Syntax
The SendJMSMessage function has the following syntax:
Parameters
The SendJMSMessage function has the following parameters.
Message String | Context String or context that contains the body of the
message.
Property Description
DeliveryMode Optional. Specifies the JMS delivery mode for the method.
Possible values are PERSISTENT and NON_PERSISTENT.
JMSDeliveryMode Optional. Specifies a JMS delivery mode. Possible values are 0 for
persistent mode and 1 for non-persistent mode.
JMSPriority Optional. Specifies a JMS priority level for the message. JMS
supports priority levels from 0 to 9, with 9 as the highest.
JMSTimeStamp Optional. Specifies a time stamp for the message in seconds since
the beginning of the UNIX epoch. If not specified, the value is set
by the JMS provider.
JMSType Optional. Specifies a JMS message type for the message. Some
JMS implementations use a message repository to store defined
types of messages. You can use this header value to associate a
particular message with a message type.
For more information about the JMS message header, see the documentation that was provided with your
JMS application.
To specify the body of a map message, you create a context by using the NewObject function. You assign
one member variable for each name-value pair in the map, where the name of the variable corresponds to
the name for the pair. When you call SendJMSMessage, you pass this context to the function as a runtime
parameter.
This example shows how to create a message body context for a map message. In this example, the
names of values in the map are name, location, and email.
MsgMapBody = NewObject();
Procedure
1. Create and configure a JMS data source
For more information, see “JMS data source” on page 86.
2. Create a message properties context.
For more information, see “Creating a message properties context” on page 95.
3. Call the ReceiveJMSMessage function and pass the values of the JMS data source, and the message
properties context as parameters.
For examples of the ReceiveJMSMessage function usage, see “ReceiveJMSMessage” on page 94.
4. Handle the retrieved message
For more information, see “Handling a retrieved message” on page 95.
ReceiveJMSMessage
The ReceiveJMSMessage function retrieves a message from the specified Java Message Service (JMS)
destination.
To retrieve the message, you call this function and pass a JMS data source, and a message properties
context as input parameters.
ReceiveJMSMessage(DataSource, MethodCallProperties)
Parameters
The ReceiveJMSMessage function has the following parameters:
Property Description
MessageSelector String expression that specifies which message in the topic or queue
you want to retrieve. The message selector syntax is similar to
the contents of an SQL WHERE clause and is defined in the JMS
specification.
Timeout Specifies the length of time that a message is retained by the JMS
delivery system before it expires. Default value is 0, which indicates
an unlimited message lifetime.
You can create an empty message properties context by passing the NewObject function to the
ReceiveJMSMessage as a parameter.
The following example shows how to create a message properties context.
Variable Description
JMSMessage JMS message body. If the message is a text message, the value
of this variable is a string. If the message is a map message, the
value of this variable is a context where each member variable in the
context corresponds to a name-value pair in the message map.
MessageType If the message is a text message, the value of this variable is a string
"Text". If the message is a map message, the value of this variable is
a string "Map".
JMSProperties Custom JMS message properties that are attached to the message.
If (MessageType == "Text") {
Log("Message body: " + JMSMessage);
} Else {
Log("Message map value 1: " + JMSMessage.MyValue1);
Log("Message map value 2: " + JMSMessage.MyValue2);
}
If (MessageType == "Text") {
Log("Message body: " + @JMSMessage);
} Else {
Log("Message map value 1: " + @JMSMessage.MyValue1);
Log("Message map value 2: " + @JMSMessage.MyValue2);
}
// Timeout must be specified in milliseconds. This parameter specifies how long the
// MessageConsumer blocks to receive a Message. A Timeout of zero makes the
// MessageConsumer wait indefinitely to receive a message.
MsgProps.Timeout = 6000;
The If (MessageType == "Text") statement also checks whether the message is a text message,
and prints the message to the log, if it is.
Configuration option 1
How to configure the WebSphere MQ client and server and Netcool/Impact all on one machine.
Procedure
1. Configure WebSphere MQ server.
For information see, http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp.
2. Copy the following four JAR files from MQ_HOME/java/lib to IMPACT_HOME/dsalib.
• com.ibm.mq.jmqi.jar
• com.ibm.mqjms.jar
• com.ibm.mq.headers.jar
• fscontext.jar
• providerutil.jar
3. Restart the Impact Server so that it picks up the new JAR files.
Configuration option 2
How to connect the WebSphere MQ client and Netcool/Impact on one machine and WebSphere MQ server
on a separate machine.
Procedure
1. Copy the following five JAR files from MQ_HOME/java/lib to IMPACT_HOME/dsalib.
• com.ibm.mq.jmqi.jar
• com.ibm.mqjms.jar
• com.ibm.mq.headers.jar
• fscontext.jar
• providerutil.jar
• dhbcore.jar
2. Restart the Impact Server so that it picks up the new JAR files.
3. You must configure the MQSeries® server to use a file system-based JNDI provider. WebSphere MQ
then uses the local file system as a JNDI registry when it registers the JMS resources accessed by the
DSA.
4. You must use "client" mode in your connection factory on the WebSphere MQ server to ensure that the
WebSphere MQ Client communicates through tcp with the WebSphere MQ Server.
For more information see http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp.
5. Ensure that you have a listener that is configured on your preferred port on the WebSphere MQ server.
6. Create the queues and destinations that you need as specified by the WebSphere MQ documentation.
For information see, http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp.
7. Copy the bindings directory, which is configured on the WebSphere MQ server, to the local file system
of the WebSphere MQ client.
8. The Netcool/Impact JMS DSA will have the following parameters:
For more information about configuring JMS DSA, see JMS data source configuration properties.
• JNDI Factory initial: com.sun.jndi.fscontext.RefFSContextFactory
• JNDI Provider URL: file:/<PathToBindingDirOnMQClient> for example, file:/C:/
MQClientBindings.
• JMS Connection Factory Name as configured on the WebSphere MQ Server.
• JMS Destination Name as configured on the WebSphere MQ Server.
9. If there are any configuration changes on the WebSphere MQ Server, you must repeat “7” on page 98
to ensure that the WebSphere MQ Client picks up the configuration changes.
Procedure
1. Create a connection factory called ImpactTopicConnectionFactory.
2. Create two new topics that are called jms/impactTopic and jms/wbeTopic.
3. Using the WebSphere Business Events Data Design application, load the project XML file
$IMPACT_HOME/integrations/wbe/Netcool_Impact_Integration.xml. Or you might want to
save the project XML file to the Server Store and create Business Events to send and test events to
the two topics.
Procedure
1. Within <WBE HOME>/WAS/runtime copy the two JAR files
com.ibm.ws.sib.client.thin.jms_<version>.jar and com.ibm.ws.ejb.thinclient_<version>.jar, where
<version> is 7.0.0 for WebSphere Business Events version 7.0.1. Paste the two JAR files into
<IMPACT_HOME>/dsalib.
2. Within <IMPACT_HOME>/wlp/user/shared/config/features.xml, comment or remove the
following line:
<feature>wasJmsClient-1.1</feature>
Data sources
You must update the data sources with the WebSphere Business Events host name and port details.
• The SendToWBE data source is configured to connect to the jms/impactTopic destination topic.
• The ReceiveFromWBE data source is configured to connect to the jms/wbeTopic destination topic.
MsgObject = NewObject();
MsgObject.Identifier='Test Id';
MsgObject.Node='Test Node';
MsgObject.AlertKey='Key 5';
MsgObject.AlertGroup='Group 5';
MsgObject.Serial=5;
MsgObject.Severity =5;
MsgObject.AdditionalField="Test";
WBEPolicy.SendEventToWBE(MsgObject);
• The WBERecieve policy is attached to the WBEJMSMessageListener listener. The policy uses the
ParseWBEMessage function to receive a JMS message, or event, from WebSphere Business Events
through the listener and converts it to a Netcool/Impact object.
JMS Listener
The JMS listener WBEJMSMessageListener receives messages from jms/wbeTopic and runs the
WBEReceive policy.
The WBE project includes two Touchpoints that are called Netcool Impact Event and Netcool Impact
Action.
• The Netcool Impact Event listens on the jms/impactTopic destination topic for the Netcool/Impact
event over the JMS bus and create an intermediate object called Netcool Omnibus Event.
• The Netcool Impact Action sends data to Netcool/Impact over the JMS bus through the jms/wbeTopic
destination topic.
Note: The topics and connection factory are optional. Complete the following steps, if you want to use the
existing topics and connection factory.
1. Edit the data sources in the WBE project to reflect the connection factory and topics.
2. Using any text/XML editor, update the Netcool_Impact_Integration XML file in IMPACT_HOME/
integrations/wbe directory to replace the topics and connection factory with the existing
information.
To integrate JMS/TIBCO over SSL, add the following properties into the $IMPACT_HOME/wlp/usr/
servers/<ServerName>/jvm.options file in Netcool/Impact:
-Dcom.ibm.jsse2.overrideDefaultTLS=true
-Djdk.tls.client.protocols=TLSv1.2
-Dhttps.protocols=TLSv1.2
When you have added these properties into jvm.options you must restart the Impact Server for the
changes to take effect.
Warning: Some older infrastructures may not work with later version of JDK. If this is the case, you
will have the following two options to make TIBCO/JMS to work in SSL mode:
The Apache Kafka DSA is installed automatically when you install Netcool/Impact. Third party Apache
Kafka libraries are shipped in JAR files with Netcool/Impact.
Table 32. General settings for the Kafka data source window
Window element Description
Data Source Name Enter a unique name to identify the data source.
You can use only letters, numbers, and the
underscore character in the data source name.
If you use UTF-8 characters, make sure that the
locale on the Impact Server where the data source
is saved is set to the UTF-8 character encoding.
Table 33. Source settings for the Kafka data source window
Window element Description
Hostname Hostname of the Kafka server to which you want to
connect.
Load from Kafka Props File Check this box to specify that additional Kafka
configuration details should be imported from a
properties file. See “Kafka configuration properties
file” on page 104.
Setting up SASL
Netcool/Impact supports SASL as an authentication method.
The SASL authentication information entered using the Kafka data source configuration settings panel
in the UI is used to construct the following properties for SASL:
• sasl.mechanism
• sasl.jaas.config
Note: The actual properties file always takes precedence over settings from the UI.
Listener properties
impact.kafka.autoreconnect
This can be set at server level in the etc/<SERVER>_server.props file.
The type is Boolean.
The default is true.
Controls whether the Kafka listener will try to reconnect to a Kafka server if the server goes down.
Note: If the server setting is false, this can be overwritten on individuals listeners by setting
autoreconnect for the listener.
For example:
impact.kafkamessagelistener.autoreconnect=true
impact.kafkamessagelistener.autoreconnect.pollinterval=300000
Log("*****************************************************************");
SendKafkaMessage
To send a Kafka message, you call the SendKafkaMessage function and pass the Kafka data source, the
name of the Kafka topic, the key of the Kafka message, the value of the message itself, and any additional
Kafka properties as required.
Syntax
The SendKafkaMessage function has the following syntax:
Parameters
The SendKafkaMessage function has the following parameters.
DataSource String Name of Kafka data source to send the message to.
Sample policy
The following sample policy uses the SendKafkaMessage function to send a Kafka message to a topic:
// Parameters
// 0. Data Source
KafkaDataSource = "MyKafkaDataSource";
KafkaTopic= "Tickets";
KafkaKey= "myKey";
Config.Properties['myFirstProperty'] = 'hello';
Config.Headers['Content-Type'] = 'application/json; charset=UTF-8';
// Call SendKafkaMessage
SendKafkaMessage(KafkaDataSource, KafkaTopic, KafkaKey, MsgTextBody,Config);
Log("SendKafkaMessage done.");
XML documents
The DSA considers an XML document to be any well-formed set of XML data that descends from a single
root element.
This document can be in a string, a text file, or on an HTTP server.
<XML_alert id="0123456789">
<XML_head>
<XML_sender>IBM</XML_sender>
<XML_subject>Alert</XML_subject>
</XML_head>
<XML_body>
<XML_node>NodeXYZ</XML_node>
<XML_summary>Node not responding</XML_summary>
</XML_body>
</XML_alert>
This figure shows the linking relationship between the corresponding element data items:
Table 35 on page 114 explains the options that are used with the scripts.
Option Description
dtdFile The path and file name of the XML DTD file that describes the XML document.
Relative to the $IMPACT_HOME/dsa/XmlDsa/bin directory.
xsdFile The path and file name of the XML XSD file that describes the XML document.
Relative to the $IMPACT_HOME/dsa/XmlDsa/bin directory.
namespace_prefix The optional prefix added to the names of element data types. This string is
not prefixed to the name of the super data type.
The CreateDtdTypes and CreateXsdTypes scripts replace any colon character in XML element names
with an underscore when you create the data types. For example, if a DTD file contains an element
named netcool:alert, the create DTD types script creates a corresponding element data type named
netcool_alert.
Important: The Impact Server must be up for these scripts to run successfully.
Here is an example of the CreateDtdTypes script usage on UNIX:
XmlDsa.fileTypes.n.property=value
where n is a numeric value that identifies the mapping, property is the name of the mapping property, and
value is the value.
Table 1 shows the mapping properties in the XmlFileTypes file.
Property Description
dtdFile Specifies the path and file name of a corresponding XML DTD or XSD file. The path
can be an absolute path or a path relative to the $IMPACT_HOME directory.
isXsd Boolean variable that specifies whether the schema is defined in XSD or DTD
format. If it is not specified, the default is DTD format. If it is not specified, the
default is DTD format.
xmlFile Specifies the path and file name of the corresponding file for XML files. The path is
relative to the $IMPACT_HOME directory. For XML strings, use the hyphen character
as a placeholder.
prefix Specifies the namespace prefix that is used to identify the corresponding element
data types. This property is optional.
This example shows a set of mapping properties for an XML document that is contained in a file.
XmlDsa.fileTypes.1.typeName XML_file_superType
XmlDsa.fileTypes.1.dtdFile dsa/XmlDsa/file.dtd
XmlDsa.fileTypes.1.xmlFile dsa/XmlDsa/file.xml
XmlDsa.fileTypes.1.prefix XML_
This example shows a set of mapping properties for an XML document that is contained in a string.
XmlDsa.fileTypes.2.typeName XML_string_superType
XmlDsa.fileTypes.2.dtdFile dsa/XmlDsa/string.dtd
XmlDsa.fileTypes.2.xmlFile -
XmlDsa.fileTypes.2.prefix XML_
Note: this example uses the hyphen character (-) for the xmlFile property.
XmlDsa.fileTypes.1.typeName XmlFileTOC
XmlDsa.fileTypes.1.dtdFile dsa/XmlDsa/TOC.xsd
XmlDsa.fileTypes.1.xmlFile dsa/XmlDsa/TOC.xml
XmlDsa.fileTypes.1.prefix FTEST_
XmlDsa.fileTypes.1.isXsd true
XmlDsa.httpTypes.n.property=value
where n is a numeric value that identifies the mapping, property is the name of the mapping property,
and value is the value.
Table 1 shows the mapping properties in the XmlHttpTypes file.
Property Description
dtdFile Path and file name of the corresponding XML DTD file. Can be an absolute
path, or relative to the $IMPACT_HOME directory.
xsdFile Path and file name of a corresponding XML XSD file. Can be an absolute path,
or relative to the $IMPACT_HOME directory. Used only if the XML schema is an
XSD.
isXsd This Boolean variable specifies whether the schema is defined in XSD or DTD
format. Default is DTD, if not specified.
url Base URL for the HTTP server. The base URL includes the server host name,
and the path where the script or executable file that provides the XML data
is located. You do not need to specify the trailing backslash in the base URL.
This URL is combined with the contents of the FilePath parameter to form
the complete URL when you retrieve the XML data in a policy.
Property Description
prefix Namespace prefix that is used to identify the corresponding element data
types (optional).
This example shows a set of mapping properties for XML data that is provided by an HTTP server.
XmlDsa.httpTypes.1.typeName XML_http_superType
XmlDsa.httpTypes.1.dtdFile dsa/XmlDsa/http.dtd
XmlDsa.httpTypes.1.url http://localhost:9080/cgi-bin
XmlDsa.httpTypes.1.user jsmith
XmlDsa.httpTypes.1.password pwd
XmlDsa.httpTypes.1.realm primary
XmlDsa.httpTypes.1.connectionsPerHost 5
Procedure
1. Retrieve the document data item.
You retrieve the data item by calling the GetByFilter function and passing the name of the super
data type and a filter string.
2. Retrieve the root level element data item.
To retrieve the root level element data item, use the GetByLinks function.
3. Retrieve the child element data item.
To retrieve child element data items, you can use successive calls to the GetByLinks function or you
can use the embedded linking syntax.
4. Access attribute values.
To access an element data item's attribute values, reference the corresponding data type fields.
Type = "XML_string_superType";
Filter = "<alert><node>Node1234</node><summary>
Node not responding</summary></alert>";
This example shows how to retrieve the document data item that is associated with an XML file, where the
corresponding super type is named XML_file_superType:
// Call GetByFilter and pass the name of the super type// and the filter
stringType = "XML_file_superType";Filter = "";CountOnly = False;DocDataItem =
GetByFilter(Type, Filter, CountOnly);
Where method is either GET or POST and path is the location of the script or executable relative to
the base URL. You specify the base URL when you set the mapping information for the document in the
XmlHttpTypes file.
Note: The FilePath specification can include query string values. You can retrieve XML documents from
the HTTP server that are dynamically created depending on values that are sent by Netcool/Impact as
part of the HTTP request.
This example shows how to use an HTTP GET request to retrieve the document data item that is
associated with XML data. In this example, the name of the super data type is XML_http_superType
and the location of the script that provides the XML data is getXMLdoc.pl.
// Call GetByFilter and pass the name of the super type// and the filter
stringType = "XML_http_superType";Filter = "Operation = 'GET' AND
FilePath = 'getXMLdoc.pl?node=NodeXYZ'";CountOnly = False;DocDataItem =
GetByFilter(Type, Filter, CountOnly);
ChildNode = RootDataItem[0].links.XML_body.first;
This example shows how to retrieve an array that contains all child element data items that are linked to
the root level element data item.
ChildNodes = RootDataItem[0].links.XML_body.array;
bodyArray=RootDataItem[0].links.XML_body.array
The following policy example shows how to get PDCDATA from the XmlFileTOC and exists in
XmlFileTestPolicy in the project XML. Enumerated elements means when the element is retrieved by
using next, it is removed from the list and does not exist anymore.
BookNode = TopNodes[0].links.FTEST_JavaXML_Contents;
Log("BookNode size: " + BookNode.size);
BookNodeLinksTypes=BookNode.links;
Log("BookNodeLinksTypes size : " + BookNodeLinksTypes.size);
Log("BookNodeLinksTypes: " +BookNodeLinksTypes);
Chapters=BookNodeLinksTypes.first.FTEST_JavaXML_Chapter;
Log("Chapters and size: " + Chapters.links.size + " " + Chapters);
index =0;
Chapter= Chapters.first;
while(Chapter != null && Chapter != NULL) {
index = index + 1;
Log("Chapter" +index + ": " + Chapter);
Chapter= Chapters.next;
Topics =Chapter.links.FTEST_JavaXML_Topic;
i = 1;
Topic=Topics.first;
while(Topic != null && Topic != NULL) {
Log("Topic"+i+": " + Topic.PCDATA);
Topic=Topics.next;
i = i +1;
}
}
This example shows how to log the PCDATA value that is associated with the current element data item:
Log(DataItem.PCDATA);
Sample policies
The DSA provides four sample policies.
• XmlStringTestPolicy
• XmlFileTestPolicy
XmlStringTestPolicy
The XmlStringTestPolicy shows how to use the XML DSA to read data from an XML string.
The policy reads the contents of an XML-formatted string and then prints the data to the policy log. Before
you use this policy, you must run the create DTD types script as follows:
You do not need to edit the contents of the XmlFileTypes configuration file. By default, this file contains
the necessary data source mappings. The data type mappings are defined as follows:
This type declaration shows how to define an XmlFile type to parse an XML file. It also uses a DTD file as
the property "isXsd" is not defined.
XmlDsa.fileTypes.1.typeName=XmlFileTOC
XmlDsa.fileTypes.1.dtdFile=dsa/XmlDsa/TOC.dtd
XmlDsa.fileTypes.1.xmlFile=dsa/XmlDsa/TOC.xml
XmlDsa.fileTypes.1.prefix=FTEST_
This type declaration shows how to define an XmlFile type to parse an XML file. The difference between
this type and the previous one is that this one uses an XSD file to get the schema info from.
XmlDsa.fileTypes.2.typeName=XmlXsdFileTOC
XmlDsa.fileTypes.2.dtdFile=dsa/XmlDsa/TOC.xsd
XmlDsa.fileTypes.2.xmlFile=dsa/XmlDsa/TOC.xml
XmlDsa.fileTypes.2.prefix=XSDFTEST_
XmlDsa.fileTypes.2.isXsd=true
XmlDsa.fileTypes.3.typeName=XmlStringTOC
XmlDsa.fileTypes.3.dtdFile=dsa/XmlDsa/TOC.dtd
XmlDsa.fileTypes.3.xmlFile=-
XmlDsa.fileTypes.3.prefix=STEST_
XmlFileTestPolicy
The XmlFileTestPolicy shows how to use the XML DSA to read data from an XML file.
This policy reads the contents of the TOC.xml file and then prints the data to the policy log. Before you
use this policy, you must run the create DTD types script as follows:
You do not need to edit the contents of the XmlFileTypes configuration file. By default, this file contains
the necessary data source mappings. The following are the data type mappings:
XmlDsa.fileTypes.1.typeName XmlFileTOC
XmlDsa.fileTypes.1.dtdFile dsa/XmlDsa/TOC.dtd
XmlDsa.fileTypes.1.xmlFile dsa/XmlDsa/TOC.xml
XmlDsa.fileTypes.1.prefix FTEST_
You must have CGI enabled on the HTTP Server. You do not have to copy the Perl CGI script onto HTTP
Server.
After you install the script, modify the XmlHttpTypes configuration file to reflect the location of the
script and to include a valid user name and password for the authentication realm, if any.
The following example shows the data type mappings:
XmlDsa.httpTypes.1.typeName XmlHttpTOC
XmlDsa.httpTypes.1.dtdFile dsa/XmlDsa/TOC.dtd
XmlDsa.httpTypes.1.prefix HTEST_
XmlDsa.httpTypes.1.url http://localhost:9080
XmlDsa.httpTypes.1.user John
XmlDsa.httpTypes.1.password Smith
XmlDsa.httpTypes.1.realm basicrealm
XmlXsdFileTestPolicy
The XmlXsdFileTestPolicy shows how to use the XML DSA to read data from an XML file.
This policy reads XML data returned from a URL and then prints the data to the policy log. Before you use
this policy, you must run the create XSD types script as follows:
where filename is the name and path of an XML file stored on the file system.
You do not need to edit the contents of the XmlFileTypes configuration file. By default, this file contains
the necessary data source mappings. The following are the data type mappings:
XmlDsa.fileTypes.2.typeName=XmlXsdFileTOC
XmlDsa.fileTypes.2.dtdFile=dsa/XmlDsa/TOC.xsd
XmlDsa.fileTypes.2.xmlFile=dsa/XmlDsa/TOC.xml
XmlDsa.fileTypes.2.prefix=XSDFTEST_
XmlDsa.fileTypes.2.isXsd=true
The SNMP DSA is a data source adaptor that is used set and retrieve management information stored by
SNMP agents.
Handling timeouts
If an agent or manager does not respond to a SET, GET, GETNEXT, or TRAP command sent by the DSA
within the timeout period specified in the function call or the related SNMP data type, the DSA sets a
timeout message in the error string and returns it to Netcool/Impact. This error string can be handled in
the body of the policy in the same was as any other error message.
Procedure
1. Log in to the Netcool/Impact GUI using a web browser.
2. Click the Data Sources tab and select SNMP from the Source list.
3. Click the New Data Source button.
The New Data Source dialog box opens.
4. Type a unique name for the data source in the Data Source Name field.
5. If you are creating this data source for use with the standard data-handling functions AddDataItem
and GetByFilter, type the host name or IP address where the agent resides in the Host Name
field and the port in the Port field. If you are creating this data source for use with the new SNMP
functions, you can accept the default values with no changes.
6. Type the name of the SNMP read-community in the Read Community field. The default is public.
7. Type the name of the SNMP write-community in the Write Community field. The default is public.
8. Type a timeout value in seconds in the Timeout field. When the DSA connects to an agent associated
with this data source, it waits for the specified timeout period before returning an error to Netcool/
Impact.
9. Select 1 or 2 from the Version list.
10. Click OK.
Procedure
1. Log in to the GUI using a web browser.
2. Click the Data Sources tab and select SNMP from the Source list.
3. Click the New Data Source button.
The New Data Source dialog box opens.
4. Type a data source name, the host name and IP address of the SNMP agent, community strings and
timeout values as specified in the previous section.
5. Select 3 from the Version list.
6. Type the name of an SNMP v3 authentication user in the User field.
7. Select a protocol from the Authentication Protocol list. The default is MD5.
8. Type the password for the authentication user in the Password field.
9. Select a protocol from the Privacy Protocol field.
10. Type a privacy password in the Privacy Password field.
11. Type a context ID in the Context ID field.
12. Type a context name in the Context Name field.
13. Click OK.
Procedure
1. Log in to the GUI using a web browser.
2. Click the name of the data source in the Data Sources tab. The Edit Data Source window opens.
3. Set the configuration properties for the data source as described in the previous sections.
4. Click OK.
Results
Any changes to the configuration take effect immediately after you finish editing the data source. There is
no need to restart the Impact Server after making a change.
Procedure
1. Log in to the Netcool/Impact GUI using a web browser.
2. In the Data Sources tab, click the Delete Data Source icon next to the name of the data source you
want to delete.
Procedure
1. In the data types tab, select an SNMP data source from the list.
2. Click the New Data Type button to open the New Data Type editor.
3. Type a name for the data type in the Data Type Name field.
Important:
The data type name must match the table name that will be queried, for example, ifTable, or
ipRouteTable.
4. Select an SNMP data source from the Data Source Name field. By default, the data source you chose
in step 2 is selected.
5. Select Table from the OID Configuration list.
6. If you are creating this data type for use with the standard data-handling functions AddDataItem and
GetByFilter, you must create a new attribute on the data type for each table you want to access. To
create an attribute, click the New Attribute button and specify an attribute name and the OID for the
table.
Important:
The attributes are the column names in each table. For example, in the following ifTable, the attributes
will be ifIndex, ifDescr and other column names:
If you are creating this data source for use with the new SNMP functions, you do not need to explicitly
create attributes for each table. In this scenario, you pass the table OIDs when you make each function
call in the Netcool/Impact policy.
7. If you want the DSA to retrieve table data from the agent using the SNMP GETBULK command instead
of an SNMP GET, select Get Bulk.
The GETBULK command retrieves table data using a continuous GETNEXT command. This option is
suitable for retrieving data from very large tables.
8. If you have selected Get Bulk, you can control the number of variables in the table for which the
GETNEXT operation is performed using the specified Non-Repeaters and Max Repetitions values.
The Non-Repeaters value specifies the first number of non-repeating variables and Max Repetitions
specifies the number of repetitions for each of the remaining variables in the operation.
9. Click Save.
Procedure
1. Log in to the GUI using a web browser.
2. Click the name of the data type in the Data Types tab.
The Edit Data Type window opens.
3. Set the configuration properties for the data type as described in the previous sections.
4. Click OK.
Procedure
1. Log in to the Netcool/Impact GUI using a web browser.
2. In the Data Types tab, click the Delete Data Type button next to the name of the data type you want
to delete.
SNMP policies
You can perform the following tasks related to the SNMP DSA in a policy:
• Set packed OID data on SNMP agents using standard data-handling functions
• Set packed OID data on SNMP agents using SNMP functions
• Set table data on SNMP agents using standard data-handling functions
• Set table data on SNMP agents using SNMP functions
• Retrieve packed OID data on SNMP agents using standard data-handling functions
• Retrieve packed OID data on SNMP agents using SNMP functions
• Send SNMP traps and notifications
MyContext = NewObject();
After you create the context, you can set the Oid and Value variables, as shown in the following example.
All member variables of the context must be set as strings.
MyContext.Oid = ".1.3.6.1.2.1.1.4.0";
MyContext.Value = "MyValue";
// Call AddDataItem and pass the name of an SNMP data type and the context
AddDataItem("MySnmpType", MyContext);
In this example, the host name, and port where the agent is located is specified by the MySnmpType data
type.
If the DSA is unable to successfully send the data to the agent, it stores an error message in the
policy-level variable ErrorString. The following example shows how to print the error message to the
policy log.
The following example shows how to set the value of a variable managed by an agent, where the
host name and port are specified by the MySnmpType data type. In this example, the variable OID is
.1.3.6.1.2.1.1.4.0 and the value is MyValue.
MyContext = NewObject();
MyContext.Oid = ".1.3.6.1.2.1.1.4.0";
MyContext.Value = "MyValue";
// Call AddDataItem and pass the name of an SNMP data type and the context
AddDataItem("MySnmpType", MyContext);
The following example shows how to set the value of a variable managed by an agent, where the host
name and port specified by the data type are overridden by context variables set in the policy. In this
example, the host is 192.168.1.1 and the port is 161.
MyContext = NewObject();
MyContext.Oid = ".1.3.6.1.2.1.1.4.0";
MyContext.Value = "MyValue";
MyContext.HostId = "192.168.1.1";
MyContext.Port = 161;
// Call AddDataItem and pass the name of an SNMP data type and the context
AddDataItem("MySnmpType", MyContext);
MyContext = NewObject();
After you create the context, you can set the member variables, and the optional variables, as shown in
the following example. All member variables of the context must be set as strings.
Here, SysLocation, and SysName are attributes that you defined in the configuration for the
corresponding SNMP DSA data source.
After you populate the context variables, you can call AddDataItem and pass the name of an SNMP data
type and the context as input parameters, as shown in the following example.
// Call AddDataItem and pass the name of an SNMP data type and the context
AddDataItem("MySnmpType", MyContext);
In this example, the host name, and port where the agent is located is specified in the data type
configuration.
If the DSA is unable to successfully send the data to the agent, it stores an error message in the
policy-level variable ErrorString. The following example shows how to print the error message to the
policy log.
The following example shows how to set the value of variables managed by an agent, where the host
name and port is specified by the MySnmpType data type.
MyContext = NewObject();
// Call AddDataItem and pass the name of an SNMP data type and the context
AddDataItem("MySnmpType", MyContext);
The following example shows how to set the value of a variable managed by an agent, where the host
name and port specified by the data type are overridden by context variables set in the policy. In this
example, the host is 192.168.1.1 and the port is 161.
MyContext = NewObject();
// Call AddDataItem and pass the name of an SNMP data type and the context
AddDataItem("MySnmpType", MyContext);
Procedure
You can use the SNMP function SnmpSetAction to set the value of a single or multiple variables
managed by an agent.
When you call SnmpSetAction, you pass an SNMP data type, the host name and port of the agent, an
array of OIDs, and the array of values that you want to set. If you are using SNMP v3, you can also specify
the information required to authenticate as an SNMP user.
For more information about SnmpSetAction, see “SNMPSetAction” on page 146.
Example
The following example shows how to set SNMP variables by calling SnmpSetAction and passing the
name of an SNMP data type, an array of OIDs, and an array of values as input parameters. In this example,
the SNMP data type is named SNMP_PACKED.
// Call SnmpSetAction and pass the name of the SNMP data type that contains
// configuration information required to perform the SNMP SET
TypeName = "SNMP_PACKED";
HostId = "192.168.1.1";
Port = 161;
VarIdList = {".1.3.6.1.2.1.1.4.0", ".1.3.6.1.2.1.1.5.0"};
ValueList = {"Value_01", "Value_02"};
Procedure
• Standard data-handling functions
• SNMP functions
TypeName = "MySnmpType";
Filter = "";
CountOnly = False;
The following example shows how to access values returned by the function. In this example,
MySnmpType defines attributes named HostId, SysContact, SysName, and SysLocation.
The following example shows how to access an error message returned by the call to GetByFilter.
The following complete example shows how to use GetByFilter and handle the values it returns.
TypeName = "MySnmpType";
Filter = "";
CountOnly = False;
// Call SnmpGetAction and pass the name of the SNMP data type that contains
// configuration information required to perform the SNMP GET
TypeName = "SNMP_PACKED";
HostId = "192.168.1.1";
Port = 161;
SnmpGetAction(TypeName, HostId, Port, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL);
Count = 0;
// Call SnmpGetNextAction and pass the name of the SNMP data type that contains
// configuration information required to perform the SNMP GETNEXT
TypeName = "SNMP_PACKED";
HostId = "192.168.1.1";
Port = 161;
Count = 0;
Procedure
• Standard data-handling functions
• SNMP functions
TypeName = "MySnmpType";
Filter = "";
CountOnly = False;
The following example shows how to access values returned by the function. In this example,
MySnmpType defines attributes named HostId, SysContact, SysName, and SysLocation.
The following example shows how to access an error message returned by the call to GetByFilter.
The following complete example shows how to use GetByFilter and handle the values it returns.
TypeName = "MySnmpType";
Filter = "";
CountOnly = False;
Example
The following example shows how to send a trap using the SnmpTrapAction function.
// Call SnmpTrapAction and pass the host name, port, OID list, OID values
// and other required parameters
HostId = "192.168.1.1";
Port = 162;
Version = 1;
Community = "public";
SysUpTime = 1001;
Enterprise = ".1.3.6.1.2.1.11";
GenericTrap = 3;
SpecificTrap = 0;
The following example shows how to send a notification using the SnmpTrapAction function. In this
example, you set a value for the SnmpTrapOid parameter.
// Call SnmpTrapAction and pass the host name, port, OID list, OID values
// and other required parameters
HostId = "192.168.1.1";
Port = 162;
Version = 1;
Community = "public";
SysUpTime = 1001;
Enterprise = ".1.3.6.1.2.1.11";
GenericTrap = 3;
SpecificTrap = 0;
SnmpTrapOid = ".1.3.6.1.2.4.1.11";
SNMP functions
The SNMP DSA supports a special set of functions that you can use to send data to and retrieve data
from SNMP agents. You can also use the SNMP functions to send SNMP traps and notifications to SNMP
managers.
The SNMP DSA supports the following functions:
SNMPGetAction
The SnmpGetAction function retrieves a set of SNMP variables from the specified agent.
The values are stored in a variable named ValueList. This function operates by sending an SNMP GET
command to the specified agent.
When you call SnmpGetAction, you pass an SNMP data type and, for SNMP v3, any authorization
parameters that are required. To override the agent and variable information specified in the SNMP data
type, you can also optionally pass a host name, a port number, a list of OIDs, and other information
needed to retrieve the data.
Note: If you are running an snmpget and an snmpset in the same policy, do not reuse the ValueList
variable in the same policy due to the special usage of ValueList.
Syntax
The following is the syntax for SnmpGetAction:
Parameters
The SNMPGetAction function has the following parameters.
TypeName String Name of the SNMP data type that specifies the host name, port, OIDs,
and other information needed to retrieve the SNMP data.
HostId String Optional. Host name or IP address of the system where the SNMP
agent is running. Overrides value specified in the SNMP data type.
Port Integer Optional. Port where the SNMP agent is running. Overrides value
specified in the SNMP data type.
VarIdList Array Optional. Array of strings containing the OIDs of SNMP variables to
retrieve from the agent. Overrides values specified in the SNMP data
type.
Community String Optional. Name of the SNMP read community string. Default is public.
Timeout Integer Optional. Number of seconds to wait for a response from the SNMP
agent at first try. As the IBM SNMP API sends subsequent retries, it
uses the following incremental strategy: The second message is sent in
twice the time of the first message, the third message is sent in twice
the time of the second message, and so forth.
The default value for the Timeout property is 15 seconds. The total
amount of time to wait for the SNMP agent to respond before timing
out is determined by the Timeout value and the number of retries that
SNMP API makes.
If Timeout is set to 1 and retries is set to 3, the actual timeout is
15 seconds this is the initial 1 second wait after the first try, plus the
cumulative wait times after three subsequent retries, namely: 2+4+8).
If Timeout is set to 5 and retries is set to 3, the actual timeout is 75
seconds.
If Timeout is set to 15 and retries is set to 3, the actual timeout is 225
seconds.
Note: The default retries is 3. You can set this value
using the impact.snmp.session.retries property in the
$IMPACT_HOME/etc/<ServerName>_server.props file. For
example, the following entry sets retries to 2:
impact.snmp.session.retries=2
If Timeout is set to 1 and retries is set to 2, the actual timeout is 7
seconds.
If Timeout is set to 1 and retries is set to 1, the actual timeout is 3
seconds.
Note:
A property (totaltimeoutsnmp) can be added to the
$IMPACT_HOME/etc/<ServerName>_server.props file to ensure
that the call only block until it gets a response or the time expires.
The value for the impact.server.totaltimeoutsnmp property is
set in milliseconds. For example, the following property ensures that
an snmpget request times out after three seconds if a response is not
received.
impact.server.totaltimeoutsnmp=3000
Version Integer Optional. SNMP version number. Possible values are 1, 2 and 3. Default
is 2.
UserId String Required for SNMP v3 authentication. If using SNMP v1 or v2, or using
v3 without authentication, pass a null value for this parameter.
AuthProtocol String Optional. For use with SNMP v3 authentication only. Possible values
are. MD5, MD5_AUTH, NO_AUTH, SHA, SHA_AUTH. NO_AUTH is the
default.
AuthPassword String Optional. For use with SNMP v3 authentication only. Authentication
password associated with the specified SNMP User ID.
PrivProtocol String Optional. Privacy policy to be used with this function. Possible values
are. DES, AES, None. None is the default.
Note: This parameter does not form a part of the function call. It must
be defined before the call to the function.
PrivPassword String Optional. For use with SNMP v3 authentication only. Privacy password
associated with the specified SNMP User ID.
ContextId String Optional. For use with SNMP v3 authentication only. Authentication
context ID.
ContextName String Optional. For use with SNMP v3 authentication only. Authentication
context name.
Return Values
When you call SnmpGetAction, it sets the following variables in the policy context: ValueList.
The ValueList variable is an array of strings, each of which stores the value of one variable retrieved
from the SNMP agent. The strings in the array are assigned in the order that the variable OIDs are
specified in the SNMP data type or the VarIdList parameter.
Error handling
If the SNMP operation fails, the Impact policy engine throws an SnmpDSAException. You can handle this
exception using the Handle() function:
Example 1
The following example shows how to retrieve a set of SNMP variables by calling SNMPGetAction and
passing the name of an SNMP data type as an input parameter. In this example, the SNMP data type is
named SNMP_PACKED. The data type configuration specifies the host name and port where the SNMP
agent is running and the OIDs of the variables you want to retrieve.
// Call SNMPGetAction and pass the name of the SNMP data type that contains
// configuration information required to perform the SNMP GET
TypeName = "SNMP_PACKED";
Count = 0;
Example 2
The following example shows how to retrieve a set of SNMP variables by calling SNMPGetAction and
explicitly overriding the default host name, port, and other configuration values set in the SNMP data type.
Example 2 using IPL.
// Call SnmpGetAction and pass the name of the SNMP data type that contains
// configuration information required to perform the SNMP GET
TypeName = "SNMP_PACKED";
HostId = "192.168.1.1";
Port = 161;
VarIdList = {".1.3.6.1.2.1.1.5.0", ".1.3.6.1.2.1.1.6.0"};
Community = "private";
Timeout = 15;
Count = 0;
// Call SnmpGetAction and pass the name of the SNMP data type that contains
// configuration information required to perform the SNMP GET
TypeName = "SNMP_PACKED";
HostId = "192.168.1.1";
Port = 161;
VarIdList = [".1.3.6.1.2.1.1.5.0", ".1.3.6.1.2.1.1.6.0"];
Community = "private";
Timeout = 15;
SnmpGetAction(TypeName, HostId, Port, VarIdList, Community,
Timeout, null, null, null, null, null, null,null);
// Print the results of the SNMP GET to the policy log
Count = 0;
while (Count < Length(ValueList)) {
Log(ValueList[Count]);
Count = Count + 1;
}
Example 3
The following example shows how to retrieve a set of SNMP variables using SNMP v3 authentication.
Example 3 using IPL.
// Call SnmpGetAction and pass the name of the SNMP data type that contains
// configuration information required to perform the SNMP GET
TypeName = "SNMP_PACKED";
HostId = "192.168.1.1";
Port = 161;
VarIdList = {".1.3.6.1.2.1.1.5.0", ".1.3.6.1.2.1.1.6.0"};
Community = "private";
Timeout = 15;
Version = 3;
UserId = "snmpusr";
AuthProtocol = "MD5_AUTH";
AuthPassword = "snmppwd";
ContextId = "ctx";
Count = 0;
// Call SnmpGetAction and pass the name of the SNMP data type that contains
// configuration information required to perform the SNMP GET
TypeName = "SNMP_PACKED";
HostId = "192.168.1.1";
Port = 161;
VarIdList = [".1.3.6.1.2.1.1.5.0", ".1.3.6.1.2.1.1.6.0"];
Community = "private";
Timeout = 15;
Version = 3;
UserId = "snmpusr";
AuthProtocol = "MD5_AUTH";
AuthPassword = "snmppwd";
ContextId = "ctx";
SnmpGetAction(TypeName, HostId, Port, VarIdList, Community,
Timeout, Version, UserId, AuthProtocol, AuthPassword, null, ContextId, null);
// Print the results of the SNMP GET to the policy log
Count = 0;
while (Count < Length(ValueList)) {
Log(ValueList[Count]);
Count = Count + 1;
}
SNMPGetNextAction
The SnmpGetNextAction function retrieves the next SNMP variables in the variable tree from the specified
agent.
It stores the resulting OIDs in a variable named VarIdList, the resulting values in a variable named
ValueList. The function sends a series of SNMP GETNEXT commands to the specified agent where each
command specifies a single OID for which the next variable in the tree is to be retrieved.
When you call SnmpGetNextAction, you pass an SNMP data type and, for SNMP v3, any authorization
parameters that are required. To override the agent and variable information specified in the SNMP data
type, you can also optionally pass a host name, a port number, a list of OIDs, and other information
needed to retrieve the data.
Syntax
The following is the syntax for SnmpGetNextAction:
Parameters
The SnmpGetNextAction function has the following parameters.
TypeName String Name of the SNMP data type that specifies the host name, port,
OIDs, and other information needed to retrieve the SNMP data.
HostId String Optional. Host name or IP address of the system where the SNMP
agent is running. Overrides value specified in the SNMP data type.
Port Integer Optional. Port where the SNMP agent is running. Overrides value
specified in the SNMP data type.
VarIdList Array Optional. Array of strings containing the OIDs of SNMP variables to
retrieve from the agent. Overrides values specified in the SNMP data
type.
Community String Optional. Name of the SNMP read community string. Default is
public.
Timeout Integer Optional. Number of seconds to wait for a response from the SNMP
agent at first try. As the IBM SNMP API sends subsequent retries, it
uses the following incremental strategy: The second message is sent
in twice the time of the first message, the third message is sent in
twice the time of the second message, and so forth.
The default value for the Timeout property is 15 seconds. The total
amount of time to wait for the SNMP agent to respond before timing
out is determined by the Timeout value and the number of retries
that SNMP API makes.
If Timeout is set to 1 and retries is set to 3, the actual timeout is
15 seconds this is the initial 1 second wait after the first try, plus
the cumulative wait times after three subsequent retries, namely:
2+4+8).
If Timeout is set to 5 and retries is set to 3, the actual timeout is 75
seconds.
If Timeout is set to 15 and retries is set to 3, the actual timeout is
225 seconds.
Note: The default retries is 3. You can set this value
using the impact.snmp.session.retries property in the
$IMPACT_HOME/etc/<ServerName>_server.props file. For
example, the following entry sets retries to 2:
impact.snmp.session.retries=2
If Timeout is set to 1 and retries is set to 2, the actual timeout is 7
seconds.
If Timeout is set to 1 and retries is set to 1, the actual timeout is 3
seconds.
Version Integer Optional. SNMP version number. Possible values are 1, 2 and 3.
Default is 2.
AuthProtocol String Optional. For use with SNMP v3 authentication only. Possible values
are. MD5, MD5_AUTH, NO_AUTH, SHA, SHA_AUTH. NO_AUTH is the
default.
AuthPassword String Optional. For use with SNMP v3 authentication only. Authentication
password associated with the specified SNMP User ID.
PrivProtocol String Optional. Privacy policy to be used with this function. Possible values
are. DES, AES, None. None is the default.
Note: This parameter does not form a part of the function call. It
must be defined before the call to the function.
PrivPassword String Optional. For use with SNMP v3 authentication only. Privacy
password associated with the specified SNMP User ID.
ContextId String Optional. For use with SNMP v3 authentication only. Authentication
context ID.
ContextName String Optional. For use with SNMP v3 authentication only. Authentication
context name.
Error handling
If the SNMP operation fails, the Impact policy engine throws an SnmpDSAException. You can handle this
exception using the Handle() function:
Example 1
The following example shows how to retrieve SNMP variables in the variable tree by calling
SNMPGetNextAction and passing the name of an SNMP data type as an input parameter. In this
example, the SNMP data type is named SNMP_PACKED. The data type configuration specifies the host
name and port where the SNMP agent is running and the OIDs of the variables whose subsequent values
in the tree you want to retrieve.
TypeName = "SNMP_PACKED";
Count = 0;
TypeName = "SNMP_PACKED";
HostId = "192.168.1.1";
Port = 161;
VarIdList = {".1.3.6.1.2.1.1.5.0", ".1.3.6.1.2.1.1.6.0"};
Community = "private";
Timeout = 15;
Count = 0;
Example 3
The following example shows how to retrieve subsequent SNMP variables in the variable tree using SNMP
v3 authentication.
Example 3 using IPL.
TypeName = "SNMP_PACKED";
HostId = "192.168.1.1";
Port = 161;
VarIdList = {".1.3.6.1.2.1.1.5.0", ".1.3.6.1.2.1.1.6.0"};
Community = "private";
Timeout = 15;
Version = 3;
UserId = "snmpusr";
AuthProtocol = "MD5_AUTH";
AuthPassword = "snmppwd";
ContextId = "ctx";
Count = 0;
SNMPSetAction
The SnmpSetAction function sets variable values on the specified SNMP agent.
This function operates by sending an SNMP SET command to the specified agent.
When you call SNMPSetAction, you pass an SNMP data type, the host name, and port of the agent, an
array of OIDs, and the array of values that you want to set. If you are using SNMP v3, you can also include
information required to authenticate as an SNMP user.
Note: If you are running an snmpset and an snmpget in the same policy, do not reuse the ValueList
variable in the same policy due to the special usage of ValueList.
Syntax
The following is the syntax for SNMPSetAction:
Parameters
The SNMPSetAction function has the following parameters.
TypeName String Name of the SNMP data type that specifies the host name,
port, OIDs, and other information needed to set the SNMP
data.
HostId String Optional. Host name or IP address of the system where the
SNMP agent is running. Overrides value specified in the SNMP
data type.
Port Integer Optional. Port where the SNMP agent is running. Overrides
value specified in the SNMP data type.
VarIdList Array Array of strings containing the OIDs of SNMP variables to set
on the agent. Overrides values specified in the SNMP data
type.
ValueList Array Array of objects containing the values you want to set. You
must specify these values in the same order that the OIDs
appear either in the SNMP data type or in the VarIdList
variable.
Note: Integer values must not be supplied within quotes, or
they will be treated as strings.
Version Integer Optional. SNMP version number. Possible values are 1, 2 and
3. Default is 2.
AuthProtocol String Optional. For use with SNMP v3 authentication only. Possible
values are. MD5, MD5_AUTH, NO_AUTH, SHA, SHA_AUTH.
NO_AUTH is the default.
PrivProtocol String Optional. Privacy policy to be used with this function. Possible
values are. DES, AES, None. None is the default.
Note: This parameter does not form a part of the function call.
It must be defined before the call to the function.
PrivPassword String Optional. For use with SNMP v3 authentication only. Privacy
password associated with the specified SNMP User ID.
Error handling
If the SNMP operation fails, the Impact policy engine throws an SnmpDSAException. You can handle this
exception using the Handle() function:
Example 1
The following example shows how to set SNMP variables by calling SNMPSetAction and passing the
name of an SNMP data type, an array of OIDs, and an array of values as input parameters. In this example,
the SNMP data type is named SNMP_PACKED.
Example 1 using IPL.
TypeName = "SNMP_PACKED";
HostId = "192.168.1.1";
Port = 161;
VarIdList = {".1.3.6.1.2.1.1.4.0", ".1.3.6.1.2.1.1.5.0"};
ValueList = {"Value_01", "Value_02"};
Example 2
The following example shows how to set SNMP variables using SNMP v3 authentication.
TypeName = "SNMP_PACKED";
HostId = "192.168.1.1";
Port = 161;
VarIdList = { ".1.3.6.1.2.1.1.4.0", ".1.3.6.1.2.1.1.5.0"};
ValueList = {"Value_01", "Value_02"};
Community = "private";
Timeout = 15;
Version = 3;
UserId = "snmpusr";
AuthProtocol = "MD5_AUTH";
AuthPassword = "snmppwd";
ContextId = "ctx";
SnmpTrapAction
The SnmpTrapAction function sends a trap (for SNMP v1) or a notification (for SNMP v2) to an SNMP
manager. Sending traps or notifications is not supported for SNMP v3.
Syntax
The following is the syntax for SnmpTrapAction:
Parameters
The SnmpTrapAction function has the following parameters.
HostId String Host name or IP address of the system where the SNMP
manager is running.
ValueList Array Optional. Array of strings containing the values you want to
send to the manager. You must specify these values in the
same order that the OIDs appear in the VarIdList variable.
Community String Optional. Name of the SNMP write community string. Default
is public.
Version Integer Optional. SNMP version number. Possible values are 1 and 2.
Default is 2.
SysUpTime Integer Optional for SNMP v1. Required for SNMP v2. Number of
milliseconds since the system started. Default is the current
system time in milliseconds.
SnmpTrapOid String Required for SNMP v2. SNMP trap OID. (The OID that
identifies the trap.)
Example 1
The following example shows how to send an SNMP v1 trap to a manager using SnmpTrapAction.
// Call SnmpTrapAction
HostId = "localhost";
Port = 162;
Version = 1;
Community = "public";
SysUpTime = 1001;
Enterprise = ".1.3.6.1.2.1.11";
GenericTrap = 3;
SpecificTrap = 0;
VarIdList = {".1.3.6.1.2.1.2.2.1.1.0", "sysDescr"};
ValueList = {"2", "My system"};
Example 2
The following example shows how to send an SNMP v2 notification to a manager using
SnmpTrapAction. SNMP v2 requires that you specify an SNMP trap OID when you call this function.
// Call SnmpTrapAction
HostId = "localhost";
For more information about ITNM hardware and software requirements, see Tivoli
Network Manager IP Edition at http://www-01.ibm.com/support/knowledgecenter/SSSHRK/landingpage/
product_welcome_itnm.html.
Procedure
1. After you set up the DSA and restarted the server, you must edit the precisiondsa.properties
file, which you can find in the directory $IMPACT_HOME/dsa/precisiondsa.
2. The following image shows an example of the ITNM DSA properties file. Edit the information as
required to connect to the ITNM Listener Daemon, following the instructions in the file.
Procedure
1. From the Project selection list, select the ITNM project.
2. Click the Services tab.
3. The ITNMEvent Listener service is displayed.
4. Enter the required information in new the Event Listener configuration window.
5. If you want to view the preconfigured settings, right click the service and click Edit.
• Listener Filter Leave this field blank
• Policy To Execute shows the ITNMSampleListenerPolicy that runs when an event is received
from the IBM Tivoli Network Manager application.
con.micromuse.dsa.precisiondsa.
PrecisionEventFeedSource
• Direct Mode Source Name this field is prepopulated with a unique name that identifies the data
source, for example, ITNMServer
6. Close the ITNMEvent Listener service tab.
7. To run the service, in the Services tab, select the ITNMEvent Listener service and click the Start
Service icon to receive events from IBM Tivoli Network Manager.
For information about IBM Tivoli Network Manager, see the IBM Tivoli Network Manager
documentation available from the following link, https://www.ibm.com/support/knowledgecenter/en/
SSSHRK/product_welcome_itnm.html.
This command prints out the Description field string that was on the ITNM record returned by the
query.
ExtraInfo field
Some fields that are returned by the query to IBM Tivoli Network Manager contain a hierarchy with
sub fields. One example in IBM Tivoli Network Manager 3.8 and 3.9 is the ExtraInfo field in the
master.entityByName table, which has sub fields such as m_BaseName and DNSName.
If you log the complex field as
you get a print out of the fields in ExtraInfo in a long String, like the following example.
Individual fields in ExtraInfo can be extracted by using string parsing in the policy.
In the example the m_BaseName field could be obtained by extracting the portion of the string between
m_BaseName and the following comma using this command:
Argument Description
Subject This argument specifies on what service the OQL query has been sent to.
For MODEL, the value is RIVERSOFT.3.0.MODEL.QUERY.
Query This is the actual query to be sent to the subject described in the previous row. If
this component exists, than all the records from the subject will be retrieved.
Make sure that the OQL query contains NO " ' " characters.
Timeout This is the timeout value for getting the results back. It uses the value in the
precisiondsa properties file if you do not specify the timeout value in the filter.
GetByFilter
The GetByFilter function retrieves data items from a data type by using a filter as the query condition.
To retrieve data items using a filter condition, you call GetByFilter and pass the data type name and
the filter string as input parameters. The syntax for the filter string varies depending on whether the data
type is an internal, SQL database, LDAP, or Mediator data type.
GetByFilter returns an array of references to the retrieved data items. If you do not assign the returned
array to a variable, the function assigns it to the built-in DataItems variable and sets the value of the Num
variable to the number of data items in the array.
You can use GetByFilter with internal, SQL database, and LDAP data types. You can also use
GetByFilter with some Mediator data types.
Important: When data items are assigned to the built-in DataItem variable, they are not immediately
updated but are stored in a queue to optimize the number of calls to the database. So, for example, if
you update multiple fields in the DataItems variable there will only be one call to update the underlying
database, when a function call is made. To force all queued updates, call the CommitChanges() function in
your policy. The CommitChanges() function does not take any arguments.
Syntax
The GetByFilter function has the following syntax:
Parameters
The GetByFilter function has the following parameters.
Filter String Filter expression that specifies which data items to retrieve from the data
type.
CountOnly Boolean Pass a false value for this parameter. Provided for compatibility with
earlier versions only.
Return value
Array of references to the retrieved data items. Optional.
Examples
The following example shows how to retrieve data items from an internal or SQL database data type.
DataType = "Admin";
Filter = "Level = 'Supervisor' AND Location LIKE 'NYC.*'";
CountOnly = false;
The following example shows how to retrieve data items from an LDAP data type.
DataType = "Customer";
Filter = "(|(facility=NYC)(facility=NNJ))";
CountOnly = false;
The following example shows how to retrieve data items from a Mediator data type.
DataType = "SWNetworkElement";
Filter = "ne_name = 'DSX1 PNL-01 (ORP)'";
CountOnly = false;
Policy Variables
After an event is received, the policy assigned to it is invoked with the variables described in Table 44 on
page 158. The variables are stored in the EventContainer and must be referenced in the policy using
the EventContainer or @ notation. See the ITNMSampleListenerPolicy for an example.
Variable Description
ActionName This variable describes the type of action that is in the update. The possible
values are:
• "REC_DELETE"
• "REC_UPDATE"
• "REC_NEW"
• "DontKnow"
FieldNames This variable gives the names of the fields that are in the CRIV_Record that
is received from ITNM. Since the field names returned in this record are
not known before the policy is executed, a string concatenation of all these
fieldNames, with a delimiter of "##", is used. This is a sample value in the
FieldNames variable:
##Field1##Field2##Field3##field4 and so on.
Sample policies
The DSA provides the following sample policies:
• ITNMSampleListenerPolicy
• ITNMSamplePolicy
ITNMSampleListenerPolicy
ITNMSampleListenerPolicy.ipl shows how to use the ITNM DSA to read data from an ITNM
Listener. The policy reads the contents of an ITNM formatted string and then prints the data to the Policy
log.
ITNMSamplePolicy
ITNMSamplePolicy.ipl shows how to use the ITNM DSA to read data from an ITNM database. The
policy reads the contents of an ITNM formatted string and then prints the data to the Policy log.
The socket DSA is a data source adaptor that provides an interface between Tivoli Netcool/Impact and a
socket server.
Socket server
A socket server is a program that acts as a mediator between a third-party entity and the socket DSA.
You can implement a custom socket server or you can expand and use the sample socket server that
is provided with the DSA. The socket server uses the Berkeley socket protocol to communicate with
Netcool/Impact via a network. The socket server is a required part of a socket DSA solution. For more
information about implementing a custom socket server, see “Implementing a custom socket server” on
page 167.
Data model
The socket DSA data model consists of a data source and set of data types that you define. You must
define one data type for each type of data that you plan to exchange between the socket DSA and the
socket server. For more information, see “Socket DSA data model” on page 160.
Process
At run time, Netcool/Impact uses the socket DSA to send queries to the socket server for information that
is stored or provided by a corresponding third-party entity. The socket server then makes a request for to
the entity for the data. When the socket server receives a reply, it forwards the information back to the
DSA. The DSA then populates the socket DSA data types with the data.
Property Description
Note: If you want to enable trace logging, you will need to update the
impactserver.log4j.properties file using the following steps:
a. Change the following line:
logger.rolling.level = INFO
to:
logger.rolling.level = DEBUG
b. Add the socketdsa package to the list:
logger.socketdsa.name = com.micromuse.dsa.socketdsa
logger.socketdsa.level= TRACE
Seconds = GetDate();
log("Starting TestSocketDSA with type SocketData at " + LocalTime(Seconds, "HH:mm::ss"));
Type = "SocketData";
Types = {"SocketData"};
// GetByFilter testing
// First, no filter (should get all the items)
log("Testing GetByFilter -- finding all");
Filter = "";
CountOnly = false;
All = GetByFilter(Type, Filter, CountOnly);
i = 0;
while (i < Num) {
i = i + 1;
log("All[" + i + "] => " + All[i-1].FirstName);
// Save All DataItems for later on when we test the Links.
SocketDataItem = All[i-1];
}
// Provide a filter this time.
log("Testing GetByFilter -- finding Carl");
Filter = "FirstName = 'Carl'";
CountOnly = false;
Carl = GetByFilter(Type, Filter, CountOnly);
if (Num == 1) {
log("Found Carl! => " + Carl[0].FirstName + " " + Carl[0].LastName + " and his Hobby is: " + Carl[0].Hobby);
} else {
log("Error: Didn’t find Carl!");
}
log("Testing GetByFilter -- finding Nick (bogus entry)");
Filter = "FirstName = 'Nick'";
CountOnly = false;
Nick = GetByFilter(Type, Filter, CountOnly);
if (Num == 1) {
log("Yikes We found something! => " + Nick[0]);
} else {
log("Great! We didn’t find Nick!");
}
Seconds = GetDate();
log ("Starting TestSocketDSA with type SocketData at " + LocalTime(Seconds, "HH:mm::ss"));
Type = "SocketData";
Types = {"SocketData"};
// Test GetByKey
log ("Testing GetByKey with existing key == Kate");
Key = "Kate";
MaxNum = 1;
Kate = GetByKey(Type, Key, MaxNum);
if (Kate == NULL) {
log("Error: Didn’t find Cindy! Num is " + Num);
Seconds = GetDate();
log("Starting TestSocketDSA with type SocketData at " + LocalTime(Seconds, "HH:mm::ss"));
Type = "SocketData";
Types = {"SocketData"};
// GetByFilter testing
// First, no filter (should get all the items)
log("Testing GetByFilter -- finding all");
Filter = "";
CountOnly = false;
All = GetByFilter(Type, Filter, CountOnly);
i = 0;
while (i < Num) {
i = i + 1;
log("All[" + i + "] => " + All[i-1].FirstName);
// Save All DataItems for later on when we test the Links.
SocketDataItem = All[i-1];
}
// Provide a filter this time.
log("Testing GetByFilter -- finding Carl");
Filter = "FirstName = 'Carl'";
CountOnly = false;
Carl = GetByFilter(Type, Filter, CountOnly);
if (Num == 1) {
log("Found Carl! => " + Carl[0].FirstName + " " + Carl[0].LastName + " and his Hobby is: " + Carl[0].Hobby);
} else {
log("Error: Didn’t find Carl!");
}
log("Testing GetByFilter -- finding Nick (bogus entry)");
Filter = "FirstName = 'Nick'";
CountOnly = false;
Nick = GetByFilter(Type, Filter, CountOnly);
if (Num == 1) {
log("Yikes We found something! => " + Nick[0]);
} else {
log("Great! We didn’t find Nick!");
}
Seconds = GetDate();
log ("Starting TestSocketDSA with type SocketData at " + LocalTime(Seconds, "HH:mm::ss"));
Sending data
To send data to the socket server, you call AddDataItem and pass the name of a socket DSA data type
and a context that contains a set of name/value pairs.
When Netcool/Impact encounters the call to AddDataItem, it passes the data type name and the set of
name/value pairs to the socket DSA. The socket DSA sends these to the socket server. The socket server
then analyzes the request and uses the data in the name/value pairs to perform an operation such as
adding a new row to a database or sending a message to a messaging system.
The following example shows how to send data to the sample socket server distributed with the DSA. The
code that handles requests to send data is located in the UserDataInterface.pm file.
Procedure
The DSA properties file contains settings for the host name and port of the socket server. This file is
named socketdsa.properties and is located in the $IMPACT_HOME/dsa/socketdsa directory. You
must make sure that the properties in this file reflect the actual location of the server.
Server.pl
Server.pl contains the main server framework and the function required to communicate with the
socket DSA. You can run Server.pl with version 5.8 and later of the Perl interpreter. You will also
require Java 1.7 or above. The Server.pl script is designed to work as provided. No additional
customization is required. You can, however, rewrite this script to better suit your needs. To customize the
sample socket server, change the UserDataInterface.pm module.
Server.pl uses the Net::Server module to communicate across a network with the DSA.
Net::Server is a freely available Perl module that provides the core function required to build a server
that communicates with other applications using Internet protocols. Specifically, Server.pl requires the
following modules:
• Net::Server::PreFork;
• Net::Server::Proto::TCP;
• Switch;
• Getopt::Long;
For more information about Net::Server, see http://seamons.com/net_server.html.
Server.pl contains the Netcool/Impact-facing function of the sample server. To handle requests from
the socket DSA to return data from or add new data to a data source, it uses calls to functions defined in
the UserDataInterface.pm module.
At initialization, Server.pl binds to the port address specified by the $portnum variable. The default
port address is 22180.
After initialization, Server.pl waits for incoming messages from the socket DSA on the specified port.
The socket DSA initiates each message exchange by sending the string hi to the port where the server is
running. When the server receives the string, it replies with an identical hi message.
The server then waits to receive a request from the socket DSA. Each request starts with a message that
contains the name of the operation to perform. The operation names correspond directly to the function
names GetByFilter, GetByKey, GetByLinks, and AddDataItem. Server.pl responds to this initial
message by requesting additional information from the socket DSA based on the parameters that are
required to perform the operation. The parameters correspond to the parameters passed to the function
from within a Netcool/Impact policy.
For example, when brokering a request for the GetByFilter operation, Server.pl asks the socket DSA
for the name of the data type and the filter string. Server.pl assigns the contents of the replies from the
DSA to the $typename and $filter variables.
When Server.pl has received the parameters required by a particular operation, it calls the
corresponding function defined in UserDataInterface.pm and passes the parameter data that it
received from the socket DSA. UserDataInterface.pm assembles the result set for the request and
returns it to Server.pl, which in turn sends the results back to the DSA.
Server.pl sends the results back to the socket DSA as sets of name/value pairs, where each set
represents a data item and each name/value pair represents a data item field. The format of the results
is a series of messages, where each name and value is sent as a distinct message and an empty string is
sent to signify the end of a data item.
UserDataInterface.pm
UserDataInterface.pm is a Perl module that contains the data source-facing function of the sample
socket server. This module is responsible for acquiring the information requested by the socket DSA from
the underlying vendor software, device or system, and for passing on new information that originated with
Tivoli Netcool/Impact.
Procedure
1. Before you run Server.pl, you must modify the first line of the file so that it specifies the location on
the file system where Perl is installed. If you do not modify the first line, you must explicitly invoke the
Perl interpreter when you run the script.
2. You must also set the PERL5LIB environment variable so that it includes the directory where you
installed the sample server.
For example, if you installed the server in /usr/local/socketdsa/SocketDSAServer/
Server.pl, you can set this variable in bash or sh by entering the following command at a command
prompt:
The directory that you specify must be two levels up from Server.pl.
3. To run Server.pl, enter the following command at a command line prompt:
where port_number is the port where you want the sample socket server to run. If you do not specify
a port, the server uses 22180, which is the default.
You can also run Server.pl by explicitly invoking the Perl compiler as follows:
Procedure
• To test the socket server, enter the following command at a command-line prompt on the system
where you are running Tivoli Netcool/Impact:
java -cp [$Impact_home]/wlp/usr/servers/NCI_A/apps/NCI_A.ear/nci.jar
com.micromuse.dsa.socketdsa.TestClient hostname port
Where hostname is the name of the system where the socket server is running and port is the port
number used by the server.
• To test the availability of a socket server, enter the following string at the command line:
hi
The test client sends this string to the socket server and prints the response. If the socket server is
running correctly, the response will be a hi string identical to the one sent from the command line.
What to do next
You can perform additional testing by entering additional strings at the command line, following the
command sequence documented in the code comments in Server.pl.
Creating a socket
At startup, the custom socket server must create a new socket and bind to the port that it will use for
communication with the socket DSA. You specify this port in the DSA properties file when you configure
the DSA, as described in “Configuring the socket DSA” on page 160.
Procedure
After you created a new socket, the socket server must listen at the port for a connection from the socket
DSA. When a connection arrives, the server must create a new socket to use for communication specific
to that connection.
Procedure
After the DSA establishes a connection, it sends the greeting string hi to the socket server. The socket
server must reply with its own identical hi message in order for handshaking to be complete.
sendtype Requests the name of the data type associated with the operation. This
is the DataType parameter specified in the call to the GetByFilter
function in a Netcool/Impact policy. The DSA returns a string that
contains the data type name.
sendfilter Requests the filter string associated with the operation. This is the
Filter parameter specified in the call to the GetByFilter function
in a Netcool/Impact policy. The DSA returns a string that contains the
filter.
The following table shows the contents of the messages that the socket server must send to the socket
DSA to request the parameters for a GetByKey operation.
sendtype Requests the name of the data type associated with the operation.
This is the DataType parameter specified in the call to the GetByKey
function in a Netcool/Impact policy. The DSA returns a string that
contains the data type name.
sendkey Requests the filter string associated with the operation. This is the Key
parameter specified in the call to the GetByKey function in a Netcool/
Impact policy. The DSA returns a string that contains the filter.
The following table shows the contents of the messages that the socket server must send to the socket
DSA to request the parameters for a GetByLinks operation.
sendfromtype Requests the name of the source data type associated with the
operation. This is the data type of the first element in the DataItems
parameter specified in the call to the GetByLinks function in a
Netcool/Impact policy. The DSA returns a string that contains the data
type name.
sendfromkey Requests the filter string associated with the operation. This is the Key
parameter specified in the call to the GetByKey function in a Netcool/
Impact policy. The DSA returns a string that contains the filter.
sendtotype Requests the name of the target data type associated with the
operation. This is the data type of the first element in the DataTypes
parameter specified in the call to the GetByLinks function in a
Netcool/Impact policy. The DSA returns a string that contains the data
type name.
sendfilter Requests the filter string associated with the operation. This is the
LinkFilter parameter specified in the call to the GetByLinks function
in the Netcool/Impact policy. The DSA returns a string that contains the
filter.
The following table shows the contents of the messages that the socket server must send to the socket
DSA to request the parameters for a AddDataItem operation. Note that AddDataItem returns a set of
name/value pairs to the Netcool/Impact server that represent the contents of the new data item added.
sendtype Requests the name of the data type associated with the operation. This
is the DataType parameter specified in the call to the AddDataItem
function in a Netcool/Impact policy. The DSA returns a string that
contains the data type name.
sendattributes Requests the attributes of the data item associated with the operation.
These are a series of name/value pairs that represent the member
variables in the ContentToCopy parameter specified in the call to
AddDataItem. The DSA returns a series of names and values, each
of which is a separate string. The DSA indicates that there are no more
attributes in the data item by sending an empty string.
Procedure
After the socket server requests the parameters from the socket DSA, it can perform operations to
retrieve data from or add data to the underlying software, device or system. For example, you can use the
information sent by the socket DSA to query an external database or to send a message on a message
system.
Procedure
After the socket server has performed the requested operation, it can return the results to the DSA. The
results must be returned as a series of messages that describe the contents of the data items resulting
from the operation. The first message in this series is a string that contains the number of data items that
will be returned. Following this are sets of messages that contain name/value pairs that represent data
item fields. The socket server indicates the end of each data item by sending a newline character.
For more details, refer to the sample socket implementation and to the inline comments in the socket
server code.
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 give you any license to these patents. You can
send license inquiries, in writing, to:
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 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 might 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
2Z4A/101
11400 Burnet Road
Austin, TX 78758 U.S.A.
Trademarks
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business
Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be
trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at
“Copyright and trademark information” at www.ibm.com/legal/copytrade.shtml.
Adobe, Acrobat, PostScript and all Adobe-based trademarks are either registered trademarks or
trademarks of Adobe Systems Incorporated in the United States, other countries, or both.
Linux is a trademark of Linus Torvalds 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.
UNIX is a registered trademark of The Open Group in the United States and other countries.
Other product and service names might be trademarks of IBM or other companies.
Index 177
G M
GetByFilter 156 making requests 36
GetByFilter output parameters 23 manuals
see publications ix
Mediator DSAs 3
H message body string or context 93
handing incoming messages from a JMS message listener 96 message integrity 74
handling a retrieved message 95 message properties context 91
I N
integration with third party Web services 69 non-repudiation 74
ITNM DSA data type 155 notation
ITNMSampleListenerPolicy 158 environment variables xiv
ITNMSamplePolicy 158 path names xiv
typeface xiv
nternational character support 41
J
JMS O
data source 86
JMS data source 88 obtaining WSDL files 44
JMS DSA online publications
creating a message properties context 95 accessing ix
creating message body string or context 93 OpenJMS 86
creating message properties context 91 Oracle
handing incoming messages from a JMS message enabling Kerberos authentication 9
listener 96 ordering publications x
handling a retrieved message 95
overview 85 P
retrieving JMS messages from a topic or queue 94
sending messages to JMS topic or queue 91 path names
setting up OpenJMS 86 notation xiv
setting up the JMS DSA 85 Performing handshaking with the DSA 168
writing JMS DSA policies 90 Performing operations requested by the DSA 170
JMS DSA policies plain text password 73
writing 90 policies
JNDI properties 88 sample 66
using editor 69
using wizard 67
K Policy Variables 157
Kafka problem determination and resolution xii
data source 103, 104 process 58
Kafka DSA proxy server RESTful DSA data sources 35
writing Kafka DSA policies 109 proxy server settings 35
Kafka DSA policies publications
writing 109 accessing online ix
ordering x
L
R
LDAP data sources
creating 37 ReceiveJMSMessage 94
LDAP DSA Requesting operation parameters from the socket DSA 168
data items 38 RESTful API 33
data model 37 RESTful data model DSA 33
data types 38 RESTful DSA 33
international character support 41 RESTful DSA data model 33
overview 37 RESTful DSA data source 33, 35, 36
policies 39 retrieving data 25, 29
referrals 40 retrieving JMS messages from a topic or queue 94
retrieving data 39, 40 Retrieving packed OID data with SNMP functions 134
supported LDAP servers 37 Returning operation results to the DSA 170
Listening for operation requests from the socket DSA 168 run Policy 63
Index 179
Web services DSA (continued) XML XSD files 111
functions 46
integration with third party Web services 69
obtaining WSDL files 44
overview 43
policies 55
running the WSDL compiler script 44
sample client 66
sample policies 66
sending messages 55
SOAP endpoints 62
Web services listener 58, 60
WSDL file 63, 65
WSListenerResult 61
Web services listener
process 58
runtime parameters 60
setting up 58
writing policies 60
Web services security
enabling 71
encryption 75, 78, 80
message integrity and non-repudiation with signature
74
sign and encrypt messages 77
user name token authentication 72, 73
WebSphere MQ 97
writing
Web services listener policies 60
Writing policies to receive events from ITNM 157
Writing policies using the ITNM DSA 156
WSDL 59
WSDL file
message 63, 65
WSDL files 45
WSInvokeDL 50
WSListenerException 65
WSListenerResult 61
WSListenerResult variable 61
WSNewArray 48
WSNewEnum 55
WSNewObject 47
WSNewSubObject 48
WSSetDefaultPKGName 46
X
XML configuration files 112
XML documents 111
XML DSA
create data types scripts 113
data type mapping 112
overview 111
reading XML data 117
sample policies 119
XML configuration files 112
XML data types
creating 113
setting up mappings 114
XML documents 111
XML DTD files 111
XML mapping 112
XML XSD files 111
XML DTD files 111