10.5. Monitoring DB2 Databases.

What should you configure in osagent.conf.xml to monitor your DB2 databases ?

10.5.1. Checks for monitoring DB2 Databases

  • Checking running background processes with PROC

  • Checking open sockets on port xxx with SOCKETS

  • Checking the db2diag-log with LOGS

  • Checking your DMS tablespaces with DB2TS

  • Checking the number of active applications DB2APPLICATIONS

  • Checking if a coonect to database works DB2CONNECT

  • Checking free space in SMS Tablespaces with DISK

10.5.2. Example configuration for monitoring DB2 Databases

			
<!-- ... -->
  <DISK>
  <!-- The db2 SMS-Tablespaces -->
    <FS>
      <FSNAME>^/db2/db2xxx/SYSCATSPACE$</FSNAME>
      <ERRORLEVEL>ERROR</ERRORLEVEL>
      <DESCRIPTION>This is the file system with db2 data files (SYSCAT-Tablespace). 
        Maybe you want to re-size this file system.</DESCRIPTION>
      <VALUE>95</VALUE>
      <FORMULA>PERCENT</FORMULA>
    </FS>

    <FS>
      <FSNAME>^/db2/db2xxx/TEMPSPACE$</FSNAME>
      <ERRORLEVEL>ERROR</ERRORLEVEL>
      <DESCRIPTION>This is the file system with db2 data files (TEMPSPACE-Tablespace). 
        Maybe you want to re-size this file system.</DESCRIPTION>
      <VALUE>95</VALUE>
      <FORMULA>PERCENT</FORMULA>
    </FS>
				

    <!-- More filesystems to check -->
  </DISK>

  <PROC>
  <!-- DB2 Background processes -->
    <PROCESS>
      <PROCNAME>db2sysc|db2pfchr|db2ckpwd|db2wdog</PROCNAME>
      <CHECKPOINTNAME>DB2-Server</CHECKPOINTNAME>
      <ERRORLEVEL>ERROR</ERRORLEVEL>
      <DESCRIPTION>Some/All db2 background processes are not running! 
        Please check this. You should take a look to db2diag.log.</DESCRIPTION>
      <NUMBER>4</NUMBER><!-- 4 Background processes -->
    </PROCESS>

    <PROCESS>
      <PROCNAME>db2jd</PROCNAME>
      <ERRORLEVEL>ERROR</ERRORLEVEL>
      <DESCRIPTION>The DB2 JDBC Listener isn't running.
        Please check this. You should check this.</DESCRIPTION>
    </PROCESS>

  </PROC>

  <LOGS>				
    <LOGFILE>
      <LOGFILENAME>/home/db2aqr01/db2dump/db2diag.log</LOGFILENAME>
      <LOGTYPE>UDB</LOGTYPE>
      <LOGFILTER>
        <REGEX>Starting a full database backup</REGEX>
        <REGEX>Starting a full database restore</REGEX>
        <REGEX>Backup Complete</REGEX>
        <REGEX>Database manager has started</REGEX>
        <REGEX>Database manager has stopped</REGEX>
        <REGEX>data protection  sqlpghck Probe</REGEX>
        <REGEX>oper system services  sqloclose Probe:110</REGEX>
        <REGEX>Load CPU parallelism is</REGEX>
        <REGEX>Starting LOAD phase at</REGEX>
        <REGEX>Completed LOAD phase at</REGEX>
        <REGEX>Starting BUILD phase at</REGEX>
        <REGEX>Completed BUILD phase at</REGEX>
        <REGEX>Starting DELETE phase at</REGEX>
        <REGEX>Completed DELETE phase at</REGEX>
        <REGEX>DIA0001E</REGEX>
      </LOGFILTER>
      <LOGFILTER>
        <REGEX>.*</REGEX>
        <PRIORITY>1000</PRIORITY>
        <ERRORLEVEL>ERROR</ERRORLEVEL>
      </LOGFILTER>
  </LOGS>

  <SOCKETS>
    <CHECK4SOCKET>
      <INTERFACE>0.0.0.0</INTERFACE>
      <PORT>60000</PORT>
      <ERRORLEVEL>ERROR</ERRORLEVEL>
      <DESCRIPTION>DB2 isn't listening on socket *:60000. Is db2 not
      running ?</DESCRIPTION>
    </CHECK4SOCKET>
  <SOCKETS>

  <DB2TS>

    <TABLESPACE>
      <DB2PROFILE>/home/db2aqr01/sqllib/db2profile</DB2PROFILE>
      <DB2ALIAS>DB2AQR</DB2ALIAS>
      <TABLESPACENAME>.*</TABLESPACENAME>
      <ERRORLEVEL>WARNING</ERRORLEVEL>
      <VALUE>80</VALUE>
      <FORMULA>PERCENT</FORMULA>
      <DESCRIPTION>The DMS tablespaces for the db2aqr database are
      getting full. Consider resizing.</DESCRIPTION>
    </TABLESPACE>
    <TABLESPACE>
      <DB2PROFILE>/home/db2aqr01/sqllib/db2profile</DB2PROFILE>
      <DB2ALIAS>DB2AQR</DB2ALIAS>
      <TABLESPACENAME>.*</TABLESPACENAME>
      <ERRORLEVEL>ERROR</ERRORLEVEL>
      <VALUE>90</VALUE>
      <FORMULA>PERCENT</FORMULA>
      <DESCRIPTION>The DMS tablespaces for the db2aqr database are
      getting full. You should resize them ASAP.
      </DESCRIPTION>
    </TABLESPACE>

  </DB2TS>

  <!-- monitor all applications -->
  <DB2APPLICATIONS>
    <DATABASE>
      <DB2PROFILE>/home/osmart/sqllib/db2profile</DB2PROFILE>
      <DB2ALIAS>osmart</DB2ALIAS>
      <THRESHOLD>
        <PERCENT>70</PERCENT>
        <ERRORLEVEL>WARNING</ERRORLEVEL>
        <DESCRIPTION>if permits, increase MAXAGENTS parameter</DESCRIPTION>
      </TRERSHOLD>
      <THRESHOLD>
        <PERCENT>90</PERCENT>
        <ERRORLEVEL>ERROR</PERCENT>
        <DESCRIPTION>increase MAXAGENTS asap to avoid application errors</DESCRIPTION>
      </THRESHOLD>
    </DATABASE>
  </DB2APPLICATIONS>

  <!-- check, if a connect to the "osmart" database is possible -->
  <DB2CONNECT>
    <DATABASE>
      <DB2PROFILE>/home/osmart/sqllib/db2profile</DB2PROFILE>
      <DB2ALIAS>osmart</DB2ALIAS>
    </DATABASE>
    <DATABASE>
      <DB2PROFILE>/home/osmart2/sqllib/db2profile</DB2PROFILE>
      <DB2ALIAS>osmart2</DB2ALIAS>
    </DATABASE>
  </DB2CONNECT>


  <!-- ... -->