diff --git a/salt/soc/defaults.map.jinja b/salt/soc/defaults.map.jinja index 742d3d0dc..ff23914ec 100644 --- a/salt/soc/defaults.map.jinja +++ b/salt/soc/defaults.map.jinja @@ -2,7 +2,12 @@ {% from 'vars/globals.map.jinja' import GLOBALS %} {% from 'docker/docker.map.jinja' import DOCKER -%} {%- set INFLUXDB_TOKEN = salt['pillar.get']('secrets:influx_token') %} +{% if salt['docker.pid']('so-influxdb') > 0 %} {%- set METRICS_LINK = salt['cmd.run']('so-influxdb-manage dashboardpath "Security Onion Performance"') %} +{% else %} +{% set METRICS_LINK = '' %} +{% endif %} + {% for module, application_url in GLOBALS.application_urls.items() %} {% do SOCDEFAULTS.soc.server.modules[module].update({'hostUrl': application_url}) %} @@ -20,7 +25,7 @@ {% do SOCDEFAULTS.soc.server.modules.influxdb.update({'hostUrl': 'https://' ~ GLOBALS.influxdb_host ~ ':8086'}) %} {% do SOCDEFAULTS.soc.server.modules.influxdb.update({'token': INFLUXDB_TOKEN}) %} {% for tool in SOCDEFAULTS.soc.server.client.tools %} -{% if tool.name == "toolInfluxDb" %} +{% if tool.name == "toolInfluxDb" and METRICS_LINK | length > 0 %} {% do tool.update({'link': METRICS_LINK}) %} {% endif %} {% endfor %}