create file for telegraf to read node config details

This commit is contained in:
m0duspwnens
2021-07-06 13:06:03 -04:00
parent a5067718d2
commit dc1363aaf5
3 changed files with 15 additions and 3 deletions

View File

@@ -20,11 +20,9 @@
"iteration": 1625018989654,
"links": [],
"panels": [
{% for panel in PANELS -%}
{%- import_json "grafana/panels/" ~ panel ~ ".json.jinja" as panel %}
{{ panel | json }} {%- if not loop.last %},{% endif %}
{{ panel | json }} {% if not loop.last %},{% endif %}
{% endfor -%}
],

View File

@@ -42,6 +42,14 @@ tgrafconf:
- template: jinja
- source: salt://telegraf/etc/telegraf.conf
#this file will be read by telegraf to send node details(management interface, monitor interface, etc)
# into influx so that grafan can build dashboards using queries
node_tab:
file.managed:
- name: /opt/so/conf/telegraf/node_tab.json
- source: salt://telegraf/node_tab.json.jinja
- template: jinja
so-telegraf:
docker_container.running:
- image: {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-telegraf:{{ VERSION }}

View File

@@ -0,0 +1,6 @@
{% for tabtype in ['managertab', 'managersearchtab', 'standalonetab', 'sensorstab', 'nodestab', 'evaltab'] %}
{% set node_type_data = salt['pillar.get'](tabtype, False) %}
{% if node_type_data %}
{{ node_type_data | json }}
{% endif %}
{% endfor %}