Influxdb + Telegraf + Grafana

Hello,

I’m currently using Prometheus with Grafana to capture server metrics and display on a nice Grafana Dashboard. However some dashboards you can import are built round Influxdb and Telegraf.

So I’ve installed Influx DB and then installed the Telegraf agent on a couple of VMs and the data is not being pulled into Grafana, all I see is the server name.

How can I check if the InfluxDB is receiving the data from the 2 servers?

Telegraf log file:

2019-09-18T09:41:00Z D! [outputs.influxdb] Wrote batch of 17 metrics in 27.28973ms
2019-09-18T09:41:00Z D! [outputs.influxdb] Buffer fullness: 6 / 10000 metrics
2019-09-18T09:41:04Z D! [agent] Stopping service inputs
2019-09-18T09:41:04Z D! [agent] Input channel closed
2019-09-18T09:41:04Z I! [agent] Hang on, flushing any cached metrics before shutdown
2019-09-18T09:41:04Z D! [outputs.influxdb] Wrote batch of 6 metrics in 1.72249ms
2019-09-18T09:41:04Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
2019-09-18T09:41:04Z D! [agent] Closing outputs
2019-09-18T09:41:04Z D! [agent] Stopped Successfully

Thanks

Looks like at least some data is being written successfully.

You can explore the data in Grafana just by creating a new panel and editing the query, at a bare minimum you need to click on measurement and field(value) and select one of the choices.

Another option is to use the influx command to take a look from a terminal:

$ influx
Connected to http://localhost:8086 version 1.7.8
InfluxDB shell version: 1.7.8
> use telegraf
Using database telegraf
> show measurements
name: measurements
name
----
cpu
> select * from cpu where time > now() - 1m;

Measurements are coming through to Influx, I just get get Grafana to show them:

1569078730000000000 cpu-total svr-confluence 0           0                99.24736578011152 0.05017561465144254 0         0          0.050175614651469275 0           0.3010536879083878  0.35122930256092666
1569078730000000000 cpu0      svr-confluence 0           0                99.39698492464723 0                   0         0          0.10050251256267649  0           0.20100502512521015 0.30150753768781524
1569078730000000000 cpu1      svr-confluence 0           0                99.19759277875312 0.10030090270840554 0         0          0                    0           0.4012036108343972  0.3009027081249427
>
>
>
>
> show measurements
name: measurements
name
----
cpu
disk
diskio
kernel
mem
processes
swap
system
>

Lists in Grafana

I just can’t seem to get the metrics displayed, using any query.

Pick cpu and then on the SELECT line click on value in the field(value) box, there should be another dropdown with the available field names. After you pick one I believe at that point you should see some data.

Hello guys,
I have similar insallation but when I use “show measurements” function in the terminal I have no response.
Here is the result, does it mean no data is registered in the database ?

SHOW MEASUREMENTS
SHOW MEASUREMENTS

Here is the log of telegraf:
2019-11-29T22:11:00Z I! [inputs.mqtt_consumer] Connected [tcp://127.0.0.1:1883]
2019-11-29T22:33:16Z I! [inputs.mqtt_consumer] Connected [tcp://127.0.0.1:1883]
2019-11-29T22:34:57Z I! Loaded inputs: mqtt_consumer
2019-11-29T22:34:57Z I! Loaded aggregators:
2019-11-29T22:34:57Z I! Loaded processors:
2019-11-29T22:34:57Z I! Loaded outputs: influxdb
2019-11-29T22:34:57Z I! Tags enabled: host=VM-BrokerABBFR
2019-11-29T22:34:57Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:“VM-BrokerABBFR”, Flush Interval:10s
2019-11-29T22:34:57Z I! [inputs.mqtt_consumer] Connected [tcp://127.0.0.1:1883]
2019-12-01T00:02:26Z I! [agent] Hang on, flushing any cached metrics before shutdown
2019-12-01T00:03:24Z I! Loaded inputs: mqtt_consumer
2019-12-01T00:03:24Z I! Loaded aggregators:
2019-12-01T00:03:24Z I! Loaded processors:
2019-12-01T00:03:24Z I! Loaded outputs: influxdb
2019-12-01T00:03:24Z I! Tags enabled: host=VM-BrokerABBFR
2019-12-01T00:03:24Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:“VM-BrokerABBFR”, Flush Interval:10s
2019-12-01T00:03:24Z I! [inputs.mqtt_consumer] Connected [tcp://127.0.0.1:1883]
2019-12-01T21:09:45Z I! [agent] Hang on, flushing any cached metrics before shutdown
2019-12-01T21:09:51Z I! Loaded inputs: mqtt_consumer
2019-12-01T21:09:51Z I! Loaded aggregators:
2019-12-01T21:09:51Z I! Loaded processors:
2019-12-01T21:09:51Z I! Loaded outputs: influxdb
2019-12-01T21:09:51Z I! Tags enabled: host=VM-BrokerABBFR
2019-12-01T21:09:51Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:“VM-BrokerABBFR”, Flush Interval:10s
2019-12-01T21:09:51Z I! [inputs.mqtt_consumer] Connected [tcp://127.0.0.1:1883]
2019-12-01T21:13:46Z I! [agent] Hang on, flushing any cached metrics before shutdown
2019-12-01T21:13:49Z I! Loaded inputs: mqtt_consumer
2019-12-01T21:13:49Z I! Loaded aggregators:
2019-12-01T21:13:49Z I! Loaded processors:
2019-12-01T21:13:49Z I! Loaded outputs: influxdb
2019-12-01T21:13:49Z I! Tags enabled: host=VM-BrokerABBFR
2019-12-01T21:13:49Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:“VM-BrokerABBFR”, Flush Interval:10s
2019-12-01T21:13:49Z I! [inputs.mqtt_consumer] Connected [tcp://127.0.0.1:1883]

Doesn’t look like anything is being collected, if you run Telegraf with --debug it will log how many metrics are sent. I also recommend enabling the internal input plugin, which will send metrics about Telegraf activity to InfluxDB.