create rps and cqs

This commit is contained in:
m0duspwnens
2021-03-10 15:20:11 -05:00
parent c1e4c4cb30
commit 75012cdcba
3 changed files with 85 additions and 19 deletions

View File

@@ -105,6 +105,8 @@ commonpkgs:
- python3-m2crypto - python3-m2crypto
- python3-mysqldb - python3-mysqldb
- git - git
- patch
heldpackages: heldpackages:
pkg.installed: pkg.installed:
- pkgs: - pkgs:
@@ -140,6 +142,7 @@ commonpkgs:
- lvm2 - lvm2
- openssl - openssl
- git - git
- patch
heldpackages: heldpackages:
pkg.installed: pkg.installed:

View File

@@ -0,0 +1,33 @@
influxdb:
retention_policies:
autogen:
default: True
duration: 1h
so_long_term:
default: False
duration: 30d
downsample:
so_long_term:
resolution: 30m
measurements:
- cpu
- disk
- diskio
- docker_container_cpu
- docker_container_mem
- docker_container_net
- elasticsearch_indices
- elasticsearch_jvm
- esteps
- healthcheck
- influxsize
- mem
- net
- pcapage
- processes
- redisqueue
- stenodrop
- suridrop
- system
- zeekcaptureloss
- zeekdrop

View File

@@ -5,6 +5,8 @@
{% set MANAGER = salt['grains.get']('master') %} {% set MANAGER = salt['grains.get']('master') %}
{% set VERSION = salt['pillar.get']('global:soversion', 'HH1.2.2') %} {% set VERSION = salt['pillar.get']('global:soversion', 'HH1.2.2') %}
{% set IMAGEREPO = salt['pillar.get']('global:imagerepo') %} {% set IMAGEREPO = salt['pillar.get']('global:imagerepo') %}
{% import_yaml 'influxdb/defaults.yaml' as default_settings %}
{% set influxdb = salt['grains.filter_by'](default_settings, default='influxdb', merge=salt['pillar.get']('influxdb', {})) %}
{% if grains['role'] in ['so-manager', 'so-managersearch', 'so-eval', 'so-standalone'] and GRAFANA == 1 %} {% if grains['role'] in ['so-manager', 'so-managersearch', 'so-eval', 'so-standalone'] and GRAFANA == 1 %}
@@ -57,30 +59,31 @@ append_so-influxdb_so-status.conf:
- name: /opt/so/conf/so-status/so-status.conf - name: /opt/so/conf/so-status/so-status.conf
- text: so-influxdb - text: so-influxdb
set_autogen_retention_policy: {% for rp in influxdb.retention_policies.keys() %}
{{rp}}_retention_policy:
influxdb_retention_policy.present: influxdb_retention_policy.present:
- name: autogen - name: {{rp}}
- database: telegraf - database: telegraf
- duration: 1h - duration: {{influxdb.retention_policies[rp].duration}}
- replication: 1 - replication: 1
- default: True - default: {{influxdb.retention_policies[rp].get('default', 'False')}}
- ssl: True - ssl: True
- unsafeSsl: True
- require: - require:
- docker_container: so-influxdb - docker_container: so-influxdb
{% endfor %}
set_so_long_term_retention_policy: {% for dest_rp in influxdb.downsample.keys() %}
influxdb_retention_policy.present: {% for measurement in influxdb.downsample[dest_rp].measurements %}
- name: so_long_term so_downsample_{{measurement}}_cq:
influxdb_continuous_query.present:
- name: so_downsample_{{measurement}}_cq
- database: telegraf - database: telegraf
- duration: 2h - query: SELECT mean(*) INTO "{{dest_rp}}"."{{measurement}}" FROM "{{measurement}}" GROUP BY time({{influxdb.downsample[dest_rp].resolution}})
- replication: 1
- default: False
- ssl: True - ssl: True
- unsafeSsl: True
- require: - require:
- docker_container: so-influxdb - docker_container: so-influxdb
{% endfor %}
{% endfor %}
{% endif %} {% endif %}
@@ -92,9 +95,36 @@ set_so_long_term_retention_policy:
{% endif %} {% endif %}
#influxdb: influxdb:
# retention_policies: retention_policies:
# autogen: autogen:
# duration: 1h default: True
# so_long_term: duration: 1h
# duration: 2h so_long_term:
default: False
duration: 2h
downsample:
so_long_term:
resolution: 30m
measurements:
- cpu
- disk
- diskio
- docker_container_cpu
- docker_container_mem
- docker_container_net
- elasticsearch_indices
- elasticsearch_jvm
- esteps
- healthcheck
- influxsize
- mem
- net
- pcapage
- processes
- redisqueue
- stenodrop
- suridrop
- system
- zeekcaptureloss
- zeekdrop