# InfluxDB

# Introduction

**Ver**. 08-12-2021  
  
With this plug-in can see InfluxDB stats

<div id="bkmrk-tipo%3A-server-plugin"><div>**Tipo**: Server plugin</div></div>

# Compatibility matrix

<table border="1" id="bkmrk-sistemas-donde-se-ha" style="border-collapse: collapse; width: 100%; height: 84px;"><tbody><tr style="height: 28px;"><td style="width: 50%; height: 28px;">**Systems where it has been tested**</td><td style="width: 50%; height: 28px;">CentOS 7, Fedora, Debian

</td></tr><tr style="height: 28px;"><td style="width: 50%; height: 28px;">**Systems where it should work**</td><td style="width: 50%; height: 28px;">Any linux system

</td></tr></tbody></table>

# Pre requisites

Required:

- Python3 installed
- The influx db module installed.
- Have Pandora FMS Data Server enabled.
- Have Pandora FMS Plugin Server enabled.

# Configuration

 Python 3.

**CentOS o fedora**

```
yum install python3
```

**Debian**

```
apt-get install python3
```

PIP

**CentOS o fedora**

```
yum install python3-pip
```

**Debian**

```
apt install python3-pip
```

Influxdb library

```
pip3 install influxdb
```

The plugin will take the stats that can be viewed by executing the query: "show stats". :

[![image-1639070190355.png](https://pandorafms.com/guides/public/uploads/images/gallery/2021-12/scaled-1680-/image-1639070190355.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2021-12/image-1639070190355.png)

According to InfluxDB documentation:

[https://docs.influxdata.com/platform/monitoring/influxdata-platform/tools/show-stats/](https://docs.influxdata.com/platform/monitoring/influxdata-platform/tools/show-stats/)

# General parameters

```
python3 pandora_influxdb.py --host <name host> --port <number port> --user <user -- password <password> [ -g <group> ] [ --data_dir <data dir> ] [ --as_agent_plugin 1]
```

If the execution is correct we will see a 1.

[![image-1639070588781.png](https://pandorafms.com/guides/public/uploads/images/gallery/2021-12/scaled-1680-/image-1639070588781.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2021-12/image-1639070588781.png)

# Specific parameters

The plugin have this parameters:

<table border="1" id="bkmrk-par%C3%A1metro-descripci%C3%B3" style="border-collapse: collapse; width: 100%; height: 289px;"><tbody><tr style="height: 29px;"><td style="width: 50%; height: 29px;">**Parameter**</td><td style="width: 50%; height: 29px;">**Description**</td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">--host &lt;host&gt;</td><td style="width: 50%; height: 29px;">hostname (required)</td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">--port &lt;puerto&gt;</td><td style="width: 50%; height: 29px;">Port number (8086 default)</td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">--user &lt;user&gt;</td><td style="width: 50%; height: 29px;">Username (if needed)</td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">--password &lt;password&gt;</td><td style="width: 50%; height: 29px;">Password (if needed)</td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">-g GROUP, --group GROUP</td><td style="width: 50%; height: 29px;">Pandora FMS target group (optional)</td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">--data\_dir DATA\_DIR</td><td style="width: 50%; height: 29px;">Pandora FMS data directory. By default it is /var/spool/pandora/data\_in/ (optional)</td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">--as\_agent\_plugin</td><td style="width: 50%; height: 29px;">It's 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)</td></tr></tbody></table>

# Manual execution

If executed correctly we will see a 1 .

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

With as\_agent\_plugin set to 1 we will see the xml via terminal.

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

# Configuration in Pandora

**Installation from the console**

To register the plugin, from the console, go to the "register plugin" section.

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

Click on select file.

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

Select the pspz2 file that contains the plugin

[![register1_influxdb.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-04/scaled-1680-/register1-influxdb.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-04/register1-influxdb.png)

A message will be displayed indicating that you have successfully registered.

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

Once the plugin is registered, we will see it in the plugins section.

[![ver plugin.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/scaled-1680-/1WYver-plugin.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/1WYver-plugin.png)

Clicking on the plugin title will take you to the plugin menu.

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

In macros will appear all those that have the plugin, remember that not all are obligatory, only those that are specified.

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

Below you can assign the required value to each variable.

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

# Modules generated by the plugin

The following agents will be created with the following modules :

**<span class="bolder pandora_upper" title="InfluxDB_Httpd">INFLUXDB\_Runtime</span>**

<table border="1" id="bkmrk-alloc-frees-heapallo" style="border-collapse: collapse; width: 100%; height: 290px;"><tbody><tr style="height: 29px;"><td style="width: 100%; height: 29px;">Alloc</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">Frees</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">HeapAlloc</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">HeapIdle</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">HeapInUse</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">HeapObjects</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">HeapReleased</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">HeapSys</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">Lookups</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">Mallocs</td></tr></tbody></table>

<table border="1" id="bkmrk-numgc-numgoroutine-p" style="border-collapse: collapse; width: 100%;"><tbody><tr><td style="width: 100%;">NumGC</td></tr><tr><td style="width: 100%;">NumGOroutine</td></tr><tr><td style="width: 100%;">PauseTotalNS</td></tr><tr><td style="width: 100%;">Sys</td></tr><tr><td style="width: 100%;">TotalAlloc</td></tr></tbody></table>

**<span class="bolder pandora_upper" title="InfluxDB_Httpd">INFLUXDB\_queryExecutor</span>**

<table border="1" id="bkmrk-queriesactive-querie" style="border-collapse: collapse; width: 100%;"><tbody><tr><td style="width: 100%;">queriesActive</td></tr><tr><td style="width: 100%;">queriesExecuted</td></tr><tr><td style="width: 100%;">queriesFInished</td></tr><tr><td style="width: 100%;">queryDurationNs</td></tr><tr><td style="width: 100%;">recoveredPanics</td></tr></tbody></table>

**<span class="bolder pandora_upper" title="InfluxDB_Httpd">INFLUXDB\_Httpd</span>**

<table border="1" id="bkmrk-authfail-clienterror" style="border-collapse: collapse; width: 100%; height: 290px;"><tbody><tr style="height: 29px;"><td style="width: 100%; height: 29px;">authFail</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">clientError</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">fluxQueryReq</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">fluxQueryReqDurationNS</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">pingReq</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">PointWrittenDropped</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">PointWrittenFail</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">PointWrittenOK</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">PromReadReq</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">PromWriteReq</td></tr></tbody></table>

<table border="1" id="bkmrk-queryreq-queryreqdur" style="border-collapse: collapse; width: 100%; height: 290px;"><tbody><tr style="height: 29px;"><td style="width: 100%; height: 29px;">queryReq</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">queryReqDurationNS</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">queryRespBytes</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">recoveredPanics</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">req</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">reqActive</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">reqDurationNS</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">serverError</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">statusReq</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">ValuesWrittenOK</td></tr></tbody></table>

<table border="1" id="bkmrk-writereq-writereqact" style="border-collapse: collapse; width: 100%;"><tbody><tr><td style="width: 100%;">writeReq</td></tr><tr><td style="width: 100%;">writeReqActive</td></tr><tr><td style="width: 100%;">writeReqBytes</td></tr><tr><td style="width: 100%;">writeReqDurationNS</td></tr></tbody></table>

**<span class="bolder pandora_upper" title="InfluxDB_Httpd">INFLUXDB\_Write</span>**

<table border="1" id="bkmrk-pointreq-poinreqloca" style="border-collapse: collapse; width: 100%; height: 261px;"><tbody><tr style="height: 29px;"><td style="width: 100%; height: 29px;">pointReq</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">poinReqLocalr</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">req</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">subWriteDrop</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">subWriteOk</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">WriteDrop</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">WriteError</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">WriteOk</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">WriteTimeout</td></tr></tbody></table>

**<span class="bolder pandora_upper" title="InfluxDB_Httpd">INFLUXDB\_Subscriber\_cq</span>**

<table border="1" id="bkmrk-createfailures-point" style="border-collapse: collapse; width: 100%;"><tbody><tr><td style="width: 100%;">createFailures</td></tr><tr><td style="width: 100%;">pointsWritten</td></tr><tr><td style="width: 100%;">queryFail</td></tr><tr><td style="width: 100%;">queryOk</td></tr><tr><td style="width: 100%;">writeFailures</td></tr></tbody></table>

Agents

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

Modules (influxDB\_Runtime)

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