mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-16 22:12:48 +01:00
create and manage metrics_link in a file for soc
This commit is contained in:
@@ -117,6 +117,14 @@ influxdb-setup:
|
||||
- file: influxdb_curl_config
|
||||
- docker_container: so-influxdb
|
||||
|
||||
metrics_link_file:
|
||||
file.managed:
|
||||
- name: /opt/so/saltstack/local/salt/influxdb/metrics_link.txt
|
||||
- contents: {{ salt['cmd.run']('so-influxdb-manage dashboardpath "Security Onion Performance"') }}
|
||||
- require:
|
||||
- docker_container: so-influxdb
|
||||
- cmd: influxdb-setup
|
||||
|
||||
# Install cron job to determine size of influxdb for telegraf
|
||||
get_influxdb_size:
|
||||
cron.present:
|
||||
|
||||
0
salt/influxdb/metrics_link.txt
Normal file
0
salt/influxdb/metrics_link.txt
Normal file
@@ -2,13 +2,7 @@
|
||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||
{% from 'docker/docker.map.jinja' import DOCKER -%}
|
||||
{% set INFLUXDB_TOKEN = salt['pillar.get']('secrets:influx_token') %}
|
||||
{% set METRICS_LINK = '' %}
|
||||
{% if salt['docker.exists']('so-influxdb') %}
|
||||
{% if salt['docker.pid']('so-influxdb') > 0 %}
|
||||
{% set METRICS_LINK = salt['cmd.run']('so-influxdb-manage dashboardpath "Security Onion Performance"') %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% import_text 'influxdb/metrics_link.txt' as METRICS_LINK %}
|
||||
|
||||
{% for module, application_url in GLOBALS.application_urls.items() %}
|
||||
{% do SOCDEFAULTS.soc.server.modules[module].update({'hostUrl': application_url}) %}
|
||||
|
||||
Reference in New Issue
Block a user