Common Module - Fix Telegraf ES input for nodes

This commit is contained in:
Mike Reeves
2018-11-27 12:27:17 -05:00
parent a2e83a9e5f
commit 154e1e6bcc
2 changed files with 10 additions and 0 deletions

View File

@@ -288,6 +288,7 @@ dashboard-master:
- defaults:
SERVERNAME: {{ SN }}
MANINT: {{ SNDATA.manint }}
MONINT: {{ SNDATA.manint }}
CPUS: {{ SNDATA.totalcpus }}
UID: {{ SNDATA.guid }}
@@ -325,6 +326,7 @@ dashboard-{{ SN }}:
- defaults:
SERVERNAME: {{ SN }}
MANINT: {{ SNDATA.manint }}
MONINT: {{ SNDATA.manint }}
CPUS: {{ SNDATA.totalcpus }}
UID: {{ SNDATA.guid }}

View File

@@ -12,7 +12,10 @@
# Environment variables can be used anywhere in this config file, simply prepend
# them with $. For strings the variable must be within quotes (ie, "$STR_VAR"),
# for numbers and booleans they should be plain (ie, $INT_VAR, $BOOL_VAR)
{%- set MASTER = grains['master'] %}
{% set NODEIP = salt['pillar.get']('node:mainip', '') %}
# Global tags can be specified here in key="value" format.
[global_tags]
@@ -571,6 +574,11 @@
# # servers = ["http://user:pass@localhost:9200"]
servers = ["http://{{ MASTER }}:9200"]
{% endif %}
{% if grains['role'] == 'so-node'}
[[inputs.elasticsearch]]
servers = ["http://{{ NODEIP }}:9200"]
{% endif %}
#
# ## Timeout for HTTP requests to the elastic search server(s)
# http_timeout = "5s"