InfluxDB

Plugin for monitoring InfluxDB

Introduction

Ver. 08-12-2021

With this plug-in can see InfluxDB stats

Tipo: Server plugin

Compatibility matrix

Systems where it has been tested

CentOS 7, Fedora, Debian

Systems where it should work

Any linux system 

Pre requisites

Required:

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

According to InfluxDB documentation:

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

Specific parameters

The plugin have this parameters:

Parameter Description
--host <host> hostname (required)
--port <puerto> Port number (8086 default)
--user <user> Username (if needed)
--password <password> Password (if needed)
-g GROUP, --group GROUP Pandora FMS target group (optional)
--data_dir DATA_DIR Pandora FMS data directory. By default it is /var/spool/pandora/data_in/ (optional)
--as_agent_plugin 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)

Manual execution

If executed correctly we will see a 1 .

image-1639070927355.png

With as_agent_plugin set to 1 we will see the xml via terminal.

image-1639070977296.png

Modules generated by the plugin

The following agents will be created with the following modules :

INFLUXDB_Runtime

Alloc
Frees
HeapAlloc
HeapIdle
HeapInUse
HeapObjects
HeapReleased
HeapSys
Lookups
Mallocs
NumGC
NumGOroutine
PauseTotalNS
Sys
TotalAlloc

INFLUXDB_queryExecutor

queriesActive
queriesExecuted
queriesFInished
queryDurationNs
recoveredPanics

INFLUXDB_Httpd

authFail
clientError
fluxQueryReq
fluxQueryReqDurationNS
pingReq
PointWrittenDropped
PointWrittenFail
PointWrittenOK
PromReadReq
PromWriteReq
queryReq
queryReqDurationNS
queryRespBytes
recoveredPanics
req
reqActive
reqDurationNS
serverError
statusReq
ValuesWrittenOK
writeReq
writeReqActive
writeReqBytes
writeReqDurationNS

INFLUXDB_Write

pointReq
poinReqLocalr
req
subWriteDrop
subWriteOk
WriteDrop
WriteError
WriteOk
WriteTimeout

INFLUXDB_Subscriber_cq

createFailures
pointsWritten
queryFail
queryOk
writeFailures

módulos influxdb.png

Configuration in Pandora

Installation from the console

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

register_plugin.png

Click on select file.

register_plugin2.png

Select the pspz2 file that contains the plugin

register1_influxdb.png

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

register2_influxdb.png

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

serversingles.png

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

register3_influxdb.png

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

register4_influxdb.png

Below you can assign the required value to each variable.

register5_influxdb.png