db2 remoto

Plugin with which you can monitor DB2 databases, being able to execute customized queries.

Introduction

Ver. 13-12-2022

Plug-in with which you can monitor DB2 databases, being able to execute customized queries.


Type: Server plug-in

Compatibility matrix

Systems where tested

CentOS 7, Fedora, rocky linux

Systems where it should work

Cualquier sistema linux 

Pre requisites

Parameters

Parameters

--hostname Ip or host 
--uid Name of the user who will perform the queries
--password Password of the user who will perform the queries
--port Default 50000
--database Database name
--protocol Default : TCPIP
--default_metrics Default metrics, deactivate by setting to 0
--conf Link to the conf containing the queries

Parameters pandora

--tentacle_port Tentacle port (default 41121) (optional)
--tentacle_address Ip of the tentacle server to send the data to (optional)
-g,--group Pandora FMS target group (optional)
--data_dir Pandora FMS data directory. By default it is /var/spool/pandora/data_in/ (optional)
--as_agent_plugin It is optional, if you want the plugin to be an agent plugin and put the modules in the pandora agent, execute this with a 1 (optional)

Manual execution

python3 pandora_db2.py --hostname <host> --uid <user> --database <database> --password <password> --conf <path conf> --as_agent_plugin 1

The data returned by the query would be returned in list format in the module, for example this query:

image-1670952605685.png

the xml would look like this:

image-1670952615083.png

Configuration in pandora fms

As server plugin

Manual installation

Go to servers > plugins:

image-1629974405286.png

Click on add:

image-1629974430627.png

We put in name and the description that is preferred.

We put as command the execution with the path of the plugin:

/path_pandora_db2.py

Remember that the recommended path for the use of the server plugins is: /usr/share/pandora_server/util/plugin/

And in plugin parameters we will introduce these followed by the macro "_field<N>_", the connection parameters --hostname, --uid, --database and --password are mandatory, by default the plugin has enabled the extraction of some metrics, these can be disabled by setting the --default_metrics parameter to 0. The port and protocol can be changed if the default is not used.

Remember that you can give a custom name to the agents with the --agent_name parameter

 

Once this is done, we will click on "create".

Once this is done, the only thing left to do is to call it, so we will go to some agent's view and create an add-in module:

 

image-1646741530197.png

We will give it a name and in the section "plugin" we will put the one we have just configured.

Once this is done, click on create.

If the module is shown with 1, it means that it is running correctly.

 

Modulos generated by the plugin

The plugin will create an agent, with modules for the defined custom queries.

In turn, if the --default_metrics option is not set to 0, it will create an agent with the following modules:

no_of_bufferpools
total_logical_reads
total_physical_reads
data_logical_reads
data_physical_reads
index_logical_reads
xda_logical_reads
log_utilization_percent
total_log_used_kb
total_log_available_kb