Difference between revisions of "Subagent:DB2"

3,120 bytes added ,  12:53, 6 November 2013
DB2 subagent page created
(Created page with "{{DISPLAYTITLE:DB2 Monitoring Subagent}} =Summary=")
 
(DB2 subagent page created)
Line 1: Line 1:
{{DISPLAYTITLE:DB2 Monitoring Subagent}}
{{DISPLAYTITLE:DB2 Monitoring Subagent}}
=Summary=
=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:
<syntaxhighlight lang="ini">
SubAgent          = db2.nsm
*DB2
DBName            = dbname
DBAlias          = dbalias
UserName          = dbuser
Password          = mypass123
QueryInterval    = 60
ReconnectInterval = 30
</syntaxhighlight>
{| class="wikitable"
|+ 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:
<syntaxhighlight lang="ini">
SubAgent          = db2.nsm
*DB2
ConfigFile        = /john/configs/db2.xml
</syntaxhighlight>
Note that all other entries in the DB2 will be ignored.
{| class="wikitable"
|+ Parameters
|-
! Parameter !! Format !! Description !! Default Value
|-
| ConfigFile || ''string'' || The path to the XML configuration file || ''-''
|-
|}
The XML configuration file itself should look like this:
<syntaxhighlight lang="xml">
<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>
</syntaxhighlight>
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.
Anonymous user