# Plugin Docker

# Introduction

**Ver**. 230821  
This agent plugin is used to monitor the statistics of a Docker environment.  
Type: mixed plugin

# Compatibility matrix

This plugin has been developed using Docker version 18.03.1-ce, build 9ee9f40.

# Prerequisites

- **Requires** to be launched from a machine with **docker installed.**
- It can be launched from remote machines using docker\_machine.

# Configuration

General plugin settings

```
## Launch a pre-command before invoke docker commands
docker = Docker
## Module interval
module_interval = 1
## Module_tags = docker,stats
module_group = Docker
## Execution mode
## global: Will generate modules that summarize the performance of all Docker containers as a whole.
## container: It will generate individual modules for each running container (CPU, Memory, Net In/Out, Block In/Out per container).
mode = global
```

**docker**  
Location of the complete docker binary, if it exists in the system PATH you can leave the default value ‘docker’.

**module\_interval**  
Is a multiplicative factor of the agent interval value. It defines the interval of module execution. It will prevent the modules from going unknown if we have to the plugin execution interval is greater than the agent one.

**module\_group**  
Defines the module group in which the modules generated by the plugin will be classified. It should be previously defined in Pandora FMS.

**mode**

It will generate modules that summarize the performance of all the Docker containers as a whole and container It will generate individual modules for each container in execution (CPU, Memory, Net In/Out, Block In/Out by container).

# Manual execution

To run the plug-in, configure the configuration file according to the instructions above preceding.

```
./docker_stats --conf docker_stats.conf
```

When executed as an **agent plugin**, it will return an XML:

[![image.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/scaled-1680-/oczimage.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/oczimage.png)

# Scheduled execution

It can be executed as module\_plugin in an agent, or from the system cron.

# Modules generated by the plugin

Having 2 modes, the default **global** mode will combine the information of all active containers, while in the **container** mode, it separates in different modules the information of each container.

We have to add in the plugin by clicking on the **plugin** tab

[![image.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/scaled-1680-/Y5himage.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/Y5himage.png)

Then we add the new plugin and click on **add**

[![image.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/scaled-1680-/Xj7image.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/Xj7image.png)

To finish, click on the **update plugin** button

[![image.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/scaled-1680-/wi8image.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/wi8image.png)

This will successfully add the plugin.

Another way to add it is to go to the remote configuration tab

[![image.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/scaled-1680-/xJfimage.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/xJfimage.png)

and add the plugin with the name **module\_plugin** plus the location of the binary plus the conf file

Example

```
module_plugin /usr/share/pandora_agent/plugins/docker_stats --conf /usr/share/pandora_agent/plugins/docker_stats.conf
```

[![image.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/scaled-1680-/nn8image.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/nn8image.png)

Finally, click on the **update** button to register the change.

Modules generated by **Global** mode

<table border="1" id="bkmrk-docker-blocks-in-doc" style="border-collapse: collapse; width: 100%;"><tbody><tr><td style="width: 50.0562%;">Docker blocks in</td><td style="width: 50.0562%;">Docker writing blocks</td></tr><tr><td style="width: 50.0562%;">Docker blocks in</td><td style="width: 50.0562%;">Docker writing blocks Incremental</td></tr><tr><td style="width: 50.0562%;">Docker blocks out</td><td style="width: 50.0562%;">Docker reading blocks</td></tr><tr><td style="width: 50.0562%;">Docker blocks out</td><td style="width: 50.0562%;">Docker reading blocks Incremental</td></tr><tr><td style="width: 50.0562%;">Docker cpu usage</td><td style="width: 50.0562%;">Docker CPU usage</td></tr><tr><td style="width: 50.0562%;">Docker memory usage</td><td style="width: 50.0562%;">Docker RAM usage</td></tr><tr><td style="width: 50.0562%;">Docker network input</td><td style="width: 50.0562%;">Docker input traffic</td></tr><tr><td style="width: 50.0562%;">Docker network input Incremental</td><td style="width: 50.0562%;">Docker input traffic Incremental</td></tr><tr><td style="width: 50.0562%;">Docker network output</td><td style="width: 50.0562%;">Docker output traffic</td></tr><tr><td style="width: 50.0562%;">Docker network output</td><td style="width: 50.0562%;">Docker output traffic Incremental</td></tr><tr><td style="width: 50.0562%;"><span dir="ltr" role="presentation">Docker State</span></td><td style="width: 50.0562%;"> 1 if the docker is active 0 if it is not active</td></tr><tr><td style="width: 50.0562%;"><span dir="ltr" role="presentation">Docker Container running</span></td><td style="width: 50.0562%;"> Number of active containers</td></tr></tbody></table>

[![image.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/scaled-1680-/NVoimage.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/NVoimage.png)

Modules generated by **container** mode

[![image.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/scaled-1680-/BEEimage.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/BEEimage.png)