Commit 44e5127a authored by Jérome Perrin's avatar Jérome Perrin

grafana: only start telegraf once influxdb is started

Otherwise telegraf start but does not create database and does not send
data:

```
2018-01-17T03:44:54Z I! Database creation failed: Post
https://[2001:67c:1254:e:....]:8086/query?q=CREATE+DATABASE+%22telegraf%22: dial tcp [2001:67c:1254:e:....]:8086: getsockopt: connection refused
2018-01-17T03:44:54Z I! Starting Telegraf v1.6.0~90b6b760
2018-01-17T03:44:54Z I! Loaded outputs: influxdb
2018-01-17T03:44:54Z I! Loaded inputs: inputs.cpu inputs.mem inputs.disk inputs.diskio inputs.system
2018-01-17T03:44:54Z I! Tags enabled: host=f114dfe44f75
2018-01-17T03:44:54Z I! Agent Config: Interval:10s, Quiet:false, Hostname:"f114dfe44f75", Flush Interval:10s
2018-01-17T03:45:10Z E! InfluxDB Output Error: Response Error: Status Code [404], expected [204], [database not found: "telegraf"]
2018-01-17T03:45:10Z E! Error writing to output [influxdb]: Could not write to any InfluxDB server in cluster
``
parent 659f3226
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
[instance-profile] [instance-profile]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = f9b717fa7c761686134be24c42cb9b77 md5sum = 39bbc8593d030634f51af8baa80b23ed
[influxdb-config-file] [influxdb-config-file]
filename = influxdb-config-file.cfg.in filename = influxdb-config-file.cfg.in
......
...@@ -154,8 +154,9 @@ port = ${grafana:port} ...@@ -154,8 +154,9 @@ port = ${grafana:port}
[telegraf] [telegraf]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
extra-config-dir = ${directory:telegraf-extra-config-dir} extra-config-dir = ${directory:telegraf-extra-config-dir}
# telegraf needs influxdb to be already listening before starting
command-line = command-line =
nice -19 chrt --idle 0 ionice -c3 {{ telegraf_bin }} --config ${telegraf-config-file:rendered} --config-directory ${:extra-config-dir} bash -c '${influxdb-listen-promise:path} && nice -19 chrt --idle 0 ionice -c3 {{ telegraf_bin }} --config ${telegraf-config-file:rendered} --config-directory ${:extra-config-dir}'
wrapper-path = ${directory:service}/telegraf wrapper-path = ${directory:service}/telegraf
[telegraf-config-file] [telegraf-config-file]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment