This is an enterprise plugin for DB2 monitoring. It is able to check the status of an instance connection and report it back to pandora. For more information visit the following webpage: http://pandorafms.com/index.php?sec=Library&sec2=repository&lng=es&action=view_PUI&id_PUI=396
3. 1 DB2 SERVER MONITORING
Introduction
This plugin permits general DB2 server monitoring done manually or automatically. It uses the
general DB2 client administration utilities. .
Operations executed by the plugin:
• Obtain data of the availability of the DB2 server. When set with a type of test and
aditionally name of the object to monitor from all the tests being done. It is given a general
sentence to verify if the result is correct.
To do those tests it's necessary to have de DB2 utility, the credentials of the database to
monitor and the path of DB2 binaries set into the system or the agent path.
• Verification of the availability of the database. Activation, connection and verification of
the status of the database instance to monitor, with or without credentials.
• Verification of the availability in one instance of database applications.
- Check the status of the connection of every aplication asociated with an instance of the
database.
- Data of a filesystem or a physical device showing the amount of free disc.
- Log file parsing uing the log parsing plugin of Pandora FMS,setting the path of the plugin.
- Obtain data of the availability of a DB2 server using the wsadmin application (Needs to be
configured correctly before being used). Data that can be obtained:
◦ DB2 Connection Status
◦ DB2 Application Status
◦ DB2 Total Connected Application Count
◦ DB2 Total Disconnected Application Count
◦ DB2 Active Application Count
The plugin has a configuration file where all these tests can be configured. There is no limit to the
number of tests that can be done of the data mentioned above. Every module includes an extended
description of its meaning and general use.
1.2 Compatibility Matrix
Systems where it has been used • Solaris 10 SPARC V9 con DB2 10.1
4. Systems where it can be used
• Same system or superior
• Any DB2 capable of extracting snapshots of
the different monitor switches of a single
instance.
1.3 Prerequisites
A single configuration file will be created for each server with the following values needed to set
manually:
• The name of the process to monitor.
• The name of the volume to monitor.
• The log or the chain to test in case of senteces search in a log file.
• User with priveledges and connection with the database are needed in order to obtain DB2
information.
1.4 DB2 Configuration
In order to configure correctly the system include the variables, path to the DB2 libraries and
binaries and the instance to connect to.
DB2INSTANCE=db2inst1
LD_LIBRARY_PATH=/export/home/db2inst1/sqllib/lib64:/export/home/db2inst1/sqllib/lib3
2
PATH=/usr/bin:/export/home/db2inst1/sqllib/bin:/export/home/db2inst1/sqllib/adm:/exp
ort/home/db2inst1/sqllib/misc:/export/home/db2inst1/sqllib/db2tss/bin
CLASSPATH=/export/home/db2inst1/sqllib/java/db2java.zip:/export/home/db2inst1/sqllib
/java/db2jcc.jar:/export/home/db2inst1/sqllib/java/sqlj.zip:/export/home/db2inst1/sq
llib/function:/export/home/db2inst1/sqllib/java/db2jcc_license_cu.jar:.
2. PLUGIN CONFIGURATION
Once the plugin and the configuration file, with the values to monitor, is copied to the disk the plugin
call should be included in the pandora_agent.conf file.
The pandora_agent.conf file is the Pandora agent configuration file, where all local agent plugins
shoul be included.
In Linux systems:
/etc/pandora/pandora_agent.conf
5. In Windows systems:
c:program filespandora_agentpandora_agent.conf
Once located the following should be written in order to issue the call of the plugin in Unix
systems.
module_plugin /etc/pandora/collections/fc_x/Pandora_Plugin_DB2_vx.yrz.pl
/etc/pandora/collections/fc_x/$HOSTNAME-db2.conf 2> plugin_error.log
It's important to redirect the errors to /dev/null or to a log because the execution of the DB” tests
requiere a connection with It's interface in order to extract the information with can end up at
stderr. If an error occurs and the redirection of data isn't activated would mean a data loss n del
plugin o el fallo en la ejecución due to the conflict between these data and the XML information
extracted to be processed by the Data Server en Pandora.
6. 3 PLUGIN USE
This example is based upon Filecollections and deployment policies monitoring a DB2 8.5 server
running on Solaris 10 using SPARC v9.
3.1 Configuration Tokens
The configuration Tokens are the following:
logparser <path_to_log>
Uses the logparser included in the path. To use the log option It's necessary to configure this token.
logparser /etc/pandora/plugins/grep_log
volume <web_server>;<X>
Disk monitoring, obtaining the amount of free disk in %.
volume main_server;/opt
process <module_name>;<process_path>
Returns information about the process. Once the name of the module in Pandora and the name of
the system process is set it would return the status, use of memory (all instancies) and total CPU use
(all instancies).
process webserver;webservd -d /opt/oracle/webserver7/admin-server
log <path_to_log>;<regexp to match>
Parses a log file, creating a module named log_test, looking for the sentence “error”. To use this
option the token “logparser” should be configured.
log /tmp/error.log;log_test;error
db2_stats
db2;<check_type>;<instance_name>;<database_name>;<app_name>;<system_username>;<
db2_username>;<db2_password>
Obtains values of the DB2 server status using the DB2 client interface. Currently the supported tests
are:
– check_dbconnect (Obtains information and status of the DB2 connection with a single
instance of the database)
– check_application (Obtains information about a single application when named, all
aplictaions when * is set or general information of the total amount of applications
connected or disconnected)
– db2_stats db2;check_application;db2instl;SAMPLE;db2stmm;db2instl;;
7. 3.2 Creation of configuration files
Create a file named :
zbea-db2.conf
It's content is the following:
logparser /var/opt/pandora/etc/pandora/plugins/grep_log
log /tmp/db2backup.log;DB2_BackupStatus;successful
db2_stats db2;check_dbconnect;db2instl;SAMPLE;;db2instl;;
#db2_stats db2;check_application;db2instl;SAMPLE;db2stmm;db2instl;;
db2_stats db2;check_application;db2instl;SAMPLE;*;db2instl;;
db2_stats db2;check_application;db2instl;SAMPLE;;db2instl;;
Using * in a check_application test obtains information of every single application being ran
in a single instance of the database.
Create the FC called “DB2” with fc_1355338194 ID and copy the plugin and scripts it
depends on.
3.3 Policies Creation
Create a local module with the following policy:
8. Link the file collection to the policy.
Aply the policy and wait for the modules to appear.
Now use massive operations and change the thresholds for some of the results like use of CPU:
Alerts can be asigned to all modules PROCESS_STATUS eventhough all of them have the same
name.