# InfluxDB

# Introducción

**Ver**. 08-12-2021  
  
Con este plug-in podremos ver los stats de InfluxDB

<div id="bkmrk-tipo%3A-plug-in-de-ser"><div>**Tipo**: Plug-in de servidor o agente</div></div>

# Matriz de compatibilidad

<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;">**Sistemas donde se ha probado**</td><td style="width: 50%; height: 28px;">CentOS 7, Fedora

</td></tr><tr style="height: 28px;"><td style="width: 50%; height: 28px;">**Sistemas donde debería funcionar**</td><td style="width: 50%; height: 28px;">Cualquier sistema linux

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

# Pre requisitos

Se requiere:

- InfluxDB
- Python3 y la librería influxdb
- Tener el **Data Server** de Pandora FMS habilitado
- Tener el **Plugin Server** de Pandora FMS habilitado

# Configuración

Será necesario tener instalado python 3.

**CentOS o fedora**

```
yum install python3
```

**Debian**

```
apt-get install python3
```

A su vez necesitaremos pip

**CentOS o fedora**

```
yum install python3-pip
```

**Debian**

```
apt install python3-pip
```

También necesitaremos la librería influxdb de python :

```
pip3 install influxdb
```

El plugin cogerá los stats que se pueden ver ejecutando la 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)

Acorde a la documentación de InfluxDB:

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

# Parámetros generales del plugin

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

Si la ejecución es correcta veremos un 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)

# Parámetros específicos del plugin

El plugin contiene los siguientes parámetros:

<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;">Nombre del host (obligatorio)</td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">--port &lt;puerto&gt;</td><td style="width: 50%; height: 29px;">Número de puerto (8086 por defecto)</td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">--user &lt;user&gt;</td><td style="width: 50%; height: 29px;">Nombre de user (si es requerido)</td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">--password &lt;password&gt;</td><td style="width: 50%; height: 29px;">Password (si es requerido)</td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">-g GROUP, --group GROUP</td><td style="width: 50%; height: 29px;">Grupo de destino de Pandora FMS (opcional)</td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">--data\_dir DATA\_DIR</td><td style="width: 50%; height: 29px;">Directorio de datos de Pandora FMS. **Por defecto** es /var/spool/pandora/data\_in/ (opcional)</td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">--as\_agent\_plugin</td><td style="width: 50%; height: 29px;">Es opcional, si quieres que el plugin sea de agente y te meta los módulos en el agente de pandora, ejecuta esto con un 1 (opcional)</td></tr></tbody></table>

# Ejecución manual

Si se ejecuta correctamente veremos un 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)

Con as\_agent\_plugin a 1 veremos el xml por terminal.

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

# Configuración en PandoraFMS

**Instalación desde consola**

Para el registro del plugin, desde la consola, se debe ir al apartado "registrar plugin".

[![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)

Daremos a seleccionar archivo.

[![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)

Seleccionaremos el fichero pspz2 que contiene el 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)

Se nos mostrará un mensaje indicando que se ha registrado correctamente.

[![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)

Una vez registrado el plugin, lo veremos en el apartado plugins.

[![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)

Pinchando en el título del plugin se podrá acceder al menu de este.

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

En macros aparecerán todas las que tiene el plugin, recuerda que no todas son obligatorias, solo las que así se especifican.

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

Abajo se le podrá asignar el valor requerido a cada variable.

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

# Módulos generados por el plugin

Se crearan los siguientes agentes con los siguientes módulos :

**<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>

Agentes

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

Modulos (influxDB\_Runtime)

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