$('a[name]').remove(); $('#ic-homepage__footer').before('

'); $("#tabs").tabs({ selected: 1 }); $("#ic-homepage__ic-tips").append( quickTipHTML() ); unhideOneProductTip(); $("#ic-homepage__product-tips").wrapInner('

'); $("#ic-homepage__feed-tips").wrapInner('

'); });

IBM Tivoli Monitoring > Version 6.3 > User's Guides > Agent Builder User's Guide IBM Tivoli Monitoring, Version 6.3


Monitor data from Java Database Connectivity (JDBC)

Configure your agent to receive data from a JDBC data source.


Use the JDBC data source to collect data from Agent Builder databases. Each JDBC data source that you define runs an SQL query to collect data from the database. Each column that is returned by the query is a Tivoli Monitoring attribute in the JDBC data source. The JDBC data provider supports the following Database servers:

Agent Builder does not include the JDBC drivers for these databases. The JDBC drivers are a set of JAR files that are provided by the vendor that are necessary to establish a JDBC connection to the database. For convenience, here are links to where those drivers can be downloaded:

An important thing to remember is that the JDBC data provider can remotely monitor your Database servers. A Java runtime environment and JDBC driver JAR files for the database server you are connecting to must be on the system where the agent runs.

The following versions of Java are supported:


Procedure

  1. On the Agent Initial Data Source page (Figure 1) or the Data Source Location page, click Data from a server in the Monitoring Data Categories area.

    Figure 1. Adding JDBC data

  2. In the Data Sources area, click JDBC.

  3. Click Next.

  4. On the JDBC Information area in the JDBC Information page (Figure 2), click Browse to connect to a database and build your SQL Query.

    Use the JDBC Browser to connect to a database and view its tables so you can build an SQL query that collects the data you need. When you select a table and columns, a query is generated for you. You can modify and test the query that is generated to make sure the data that is returned is what you need.

    You can also manually create the JDBC data source without clicking Browse. To manually create the data source, specify the query and click Next. You must define the first attribute for this data source in the wizard. Other attributes can be added to the data source later.

    With the JDBC data provider, you can run SQL queries and stored procedures against a database to collect monitoring data. When you specify an SQL query to collect data, you can include a where clause in your SQL statement to filter the data that is returned. The SQL statement can also join data from multiple tables. In addition to SQL select statements, the JDBC data provider can run stored procedures. For information about running stored procedures, see (Stored procedures).

    Figure 2. JDBC Information page

  5. The first time the Browser opens, the Java Database Connectivity (JDBC) Browser window (Figure 3) indicates that no connections are selected. You must add a connection. Click Add and follow the Steps to add a connection. If you already defined a connection, that connection is used and you can proceed to Step (6).

    The Status field shows the status of the current connection.

    Figure 3. JDBC Browser window

    Use the following steps to add a connection:

    1. On the JDBC Connections page (Figure 4), click JDBC Connection, and click Next.

      Figure 4. Database Connection Wizard: JDBC Connectionspage

    2. On the Connection Properties page (Figure 5), complete the fields as follows:

      Connection Name

      Name of the JDBC connection. Type a unique name for this connection. You use this name to reference the connection in the browser.

      Database Type

      Type of database. Select the database product to which you are connecting. For example, to connect to the IBM DB2 database, select DB2.

      User Name

      Must be defined with at least read access to the database, but does not have to be the database administrator

      Password

      Must be defined with at least read access to the database, but does not have to be the database administrator

      Host name

      Host name on which the database server is running. With JDBC, you can monitor remote databases so you are not restricted to monitoring databases on the local system.

      Port

      Port on the host name on which the database server is listening.

      Database

      Name of the database to which to connect.

      Jar Directory

      Directory containing the JDBC JAR files used to connect to the database. Type the path name, or click Browse to locate the directory.

    3. Optional: Select the Save the password in the Agent Builder workspace check box if you want to save the password for this connection.

    4. Optional: Select the Set as agent configuration defaults check box if you want the defaults for this application server type to be copied from these properties. If you are building the agent on a system that is similar to your monitored systems, it is advisable to check this box. If you do not check this box, the user who configures the agent sees an empty field. The user must then determine the values for all of the information without default values.

      Figure 5. Database Connections Wizard: Connection Properties page

    5. Click Test Connection to create a connection to the database that uses the configuration parameters you specified. A message on the Connection Properties page indicates whether the connection succeeds.

    6. When you have a working connection, click Finish.

  6. In the Java Database Connectivity (JDBC) Browser window (Figure 6), a connection is made to the configured database. The tables that are contained in the database are shown in the Database Tables area. Select a database table to see the columns that are contained in that table in the Columns in the selected table area.

    1. Click the binoculars icon to search for a table in the Database Tables list.

    2. All tables are shown by default. You can filter the tables that are shown by selecting a different filter option. The available filter options are shown in (Table 1).


      Filter options

      Filter option Description
      All Show all tables
      User Show only user tables
      System Show only system tables
      View Show only database views

    Figure 6. Java Database Connectivity (JDBC) Browser window

    Select only columns if you want to retrieve specific columns. If you select the table, it automatically builds a query that gathers all of the columns from the table.

    You can select columns in the following ways:

    • Select the table and get the default query for all columns.

    • Select columns to get only those columns.

  7. Optional: Click Test on the Java Database Connectivity (JDBC) Browser window to test and modify the SQL statement. The Run the SQL statement window opens.

    1. Enter or modify the SQL statement in the SQL statement field.

    2. Click Run to run the SQL statement. The results are displayed in the Results area. Continue to modify and test the statement until you are satisfied with the data that is returned.

    3. Click OK to save the statement and return to the JDBC Information window.

  8. Optional: Click Test on the JDBC Information window, (Figure 7) to test the attribute group in a more realistic agent environment. For more information about testing JDBC attribute groups, see Test JDBC attribute groups

  9. Optional: You can create a filter to limit the data that is returned by this attribute group by clicking Advanced. For more information about filtering data from an attribute group, see Filtering attribute groups

  10. On the JDBC Information page (Figure 7), Operating Systems section, select the operating systems, and click Next. See Specify operating systems for information about which operating systems to select.

    Click Insert Configuration Property to select a property to insert. See ( Customize agent configuration).

    Figure 7. JDBC Information page

  11. On the Select key attributes page, select key attributes or indicate that this data source produces only one data row. See (Selecting key attributes).

  12. To test a data source that you previously defined, in the Agent Editor window, select the Data Sources tab and select a JDBC data source. In the JDBC Attribute Group Information area, click Test. For more information about testing, see (Test JDBC attribute groups).

    Figure 8. Data Source Definition page Attribute Group Information

  13. To view the configuration sections that were automatically generated, click the Insert Configuration Property tab of the Agent Editor (Figure 9). You can change the labels or default values for these properties to match the defaults that the user sees when they initially configure the agent.

    Figure 9. Runtime Configuration Information page, Configuration for Java virtual machine (JVM)

  14. Optional: Complete the Attribute Information page by using (Table 1). Do this step if you chose to manually create the JDBC data source without clicking Browse in step (4).

    Figure 10. Attribute Information page

    The Agent Builder JDBC data source supports collecting data from most SQL types. The information in (Table 2) describes the type of attribute that is created by the JDBC Browser when it detects a column of one of these types. These data types are the supported types for use with a monitoring agent.


    Supported SQL data types for use with a monitoring agent

    SQL data type IBM Tivoli Monitoring attribute that is created
    BIGINT This data type is a 64-bit gauge value in IBM Tivoli Monitoring. If you select IBM Tivoli Monitoring V6.2 compatibility, it is a 32-bit gauge.
    DECIMALDOUBLEFLOATNUMERICREAL These SQL Types are created as 64-bit gauge attributes in IBM Tivoli Monitoring. If the database metadata contains a scale value, that value is used; otherwise, the scale is set to 1. If you select IBM Tivoli Monitoring V6.2 compatibility, the attribute is a 32-bit gauge.
    BITINTEGERSMALLINTTINYINT The following SQL types are created as 32-bit gauge attributes in IBM Tivoli Monitoring.
    BOOLEAN This value is a 32-bit gauge in IBM Tivoli Monitoring with enumerations for TRUE and FALSE.
    TIMESTAMP Data in columns of this type are converted to a 16-byte IBM Tivoli Monitoring time stamp attribute.
    TIMEDATECHARLONGVARCHARVARCHAR These SQL types are all treated as string attributes by the browser. The column size is used as the attribute size up to 256, which is the default string attribute size for the JDBC browser.

    If you collect data from a data type that is not listed, a string attribute is used by default. The agent also tries to collect the data from the database as a string.



+

Search Tips   |   Advanced Search