Difference between revisions of "Subagent:DB2"

From NetXMS Wiki
Jump to navigation Jump to search
Line 94: Line 94:
As you can see, the parameters are the same as the ones from the INI configuration.  
As you can see, the parameters are the same as the ones from the INI configuration.  


Each database declaration must be placed in the db2sub tag and enclosed in a db2 tag. Db2 tag must have a numerical id which has to be a positive integer greater than 0.
Each database declaration must be placed in the ''db2sub'' tag and enclosed in the ''db2'' tag. The ''db2'' tag must have a numerical id which has to be a positive integer greater than 0.

Revision as of 12:59, 6 November 2013


Summary

NetXMS subagent for DB2 monitoring is designed to provide a way to extract various parameters known as Data Collection Items (DCI) from an instance or several instances of DB2 database.

Configuration

DB2 subagent can be configured in two ways. The first one would be a simple INI file and the second one would be an XML configuration file. Please note that to use the XML configuration, you first need to declare the XML file in the DB2 section of the INI configuration file. The details are below.

INI configuration

The configuration section in INI file looks like the following:

SubAgent          = db2.nsm

*DB2
DBName            = dbname
DBAlias           = dbalias
UserName          = dbuser
Password          = mypass123
QueryInterval     = 60
ReconnectInterval = 30
Parameters
Parameter Format Description Default Value
DBName string The name of the database to connect to -
DBAlias string The alias of the database to connect to -
UserName string The name of the user for the database to connect to -
Password string The password for the database to connect to -
QueryInterval milliseconds The interval to perform queries with 60
ReconnectInterval milliseconds The interval to try to reconnect to the database if the connection was lost or could not be established 30

XML configuration

XML configuration allows the monitoring of several database instances.

To be able to use the XML configuration file, you first need to specify the file to use in the DB2 section of the INI file. The syntax is as follows:

SubAgent          = db2.nsm

*DB2
ConfigFile        = /myhome/configs/db2.xml

Note that all other entries in the DB2 will be ignored.

Parameters
Parameter Format Description Default Value
ConfigFile string The path to the XML configuration file -

The XML configuration file itself should look like this:

<config>
    <db2sub>
        <db2 id="1">
            <dbname>dbname</dbname>
            <dbalias>dbalias</dbalias>
            <username>dbuser</username>
            <password>mypass123</password>
            <queryinterval>60</queryinterval>
            <reconnectinterval>30</reconnectinterval>
        </db2>
        <db2 id="2">
            <dbname>dbname1</dbname>
            <dbalias>dbalias1</dbalias>
            <username>dbuser1</username>
            <password>mypass456</password>
            <queryinterval>60</queryinterval>
            <reconnectinterval>30</reconnectinterval>
        </db2>
    </db2sub>
</config>

As you can see, the parameters are the same as the ones from the INI configuration.

Each database declaration must be placed in the db2sub tag and enclosed in the db2 tag. The db2 tag must have a numerical id which has to be a positive integer greater than 0.