TT#71030 Fix influxdb checks conditionals for when it is present

InfluxDB is going to be running either when it is the current monitoring
backend, or when it is not but its data has not yet been migrated. We
want to check both cases so make sure the service is there and contains
data.

Change-Id: I45c71f41b6e2106b1ecf3a2665f669c920e59074
mr9.2
Guillem Jover 6 years ago
parent 9c29b707bb
commit 92029bad5f

@ -230,10 +230,10 @@ port:
# InfluxDb Query
tcp:8086:
listening: true
listening: [% monitoring.backend == 'influxdb' || monitoring.influxdb_migrated == 'no' ? 'true' : 'false' %]
ip: ["[% ha_int_ips.0 %]"]
# InfluxDb Backup/Restore RPC
tcp:8088:
listening: true
listening: [% monitoring.backend == 'influxdb' || monitoring.influxdb_migrated == 'no' ? 'true' : 'false' %]
ip: ["127.0.0.1"]

@ -9,8 +9,8 @@
ha_ips = out.merge(ha_ips);
-%]
command:
[% IF monitoring.backend == 'influxdb' || monitoring.influxdb_migrated == 'no' -%]
[% IF monitoring.backend == 'influxdb' -%]
influx -execute 'show databases':
exit-status: 0
stdout:
@ -20,7 +20,9 @@ command:
- "/^telegraf$/"
stderr: []
timeout: 10000
[% ELSE -%]
[% END -%]
[% IF monitoring.backend == 'prometheus' -%]
promtool query instant http://[% ha_ips.0 || 'localhost' %]:[% prometheus.port || 9090 %] '{__name__=~".+"}':
exit-status: 0
stdout:

Loading…
Cancel
Save