# db2 remoto # 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 testedCentOS 7, Fedora, rocky linux
Systems where it should workCualquier sistema linux
# Pre requisites - Pandora FMS Data Server enabled - Pandora FMS Plugin Server enabled - Have python3 installed - have the ibm\_db library installed # Parameters **Parameters**
--hostnameIp or host
--uidName of the user who will perform the queries
--passwordPassword of the user who will perform the queries
--portDefault 50000
--databaseDatabase name
--protocolDefault : TCPIP
--default\_metricsDefault metrics, deactivate by setting to 0
--confLink to the conf containing the queries
**Parameters pandora**
--tentacle\_portTentacle port (default 41121) (optional)
--tentacle\_addressIp of the tentacle server to send the data to (optional)
-g,--groupPandora FMS target group (optional)
--data\_dirPandora FMS data directory. By default it is /var/spool/pandora/data\_in/ (optional)
--as\_agent\_pluginIt 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 --uid --database --password --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](https://pandorafms.com/guides/public/uploads/images/gallery/2022-12/scaled-1680-/image-1670952605685.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-12/image-1670952605685.png) the xml would look like this: [![image-1670952615083.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-12/scaled-1680-/image-1670952615083.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-12/image-1670952615083.png) # Configuration in pandora fms As server plugin Manual installation Go to servers > plugins: [![image-1629974405286.png](https://pandorafms.com/guides/public/uploads/images/gallery/2021-08/scaled-1680-/image-1629974405286.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2021-08/image-1629974405286.png) Click on add: [![image-1629974430627.png](https://pandorafms.com/guides/public/uploads/images/gallery/2021-08/scaled-1680-/image-1629974430627.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2021-08/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](https://pandorafms.com/guides/public/uploads/images/gallery/2022-03/scaled-1680-/image-1646741530197.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-03/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