diff --git a/templates/821_network-ports-ngcp.yaml.tt2 b/templates/821_network-ports-ngcp.yaml.tt2 index 2a3d410..84aa5de 100644 --- a/templates/821_network-ports-ngcp.yaml.tt2 +++ b/templates/821_network-ports-ngcp.yaml.tt2 @@ -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"] diff --git a/templates/910_service-monitoring.yaml.tt2 b/templates/910_service-monitoring.yaml.tt2 index 7926793..2a9c0c4 100644 --- a/templates/910_service-monitoring.yaml.tt2 +++ b/templates/910_service-monitoring.yaml.tt2 @@ -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: