diff --git a/states/telegraf/defaults.yaml b/states/telegraf/defaults.yaml index af28594..6ca83f9 100644 --- a/states/telegraf/defaults.yaml +++ b/states/telegraf/defaults.yaml @@ -35,6 +35,17 @@ telegraf: - '"squashfs"' diskio: name: "diskio" + httpjson: + name: "httpjson" + params: + name: "ipinfo" + interval: "15m" + servers: + - '"https://ipinfo.io"' + response_timeout: "5s" + method: "GET" + tag_keys: + - '"ip"' kernel: name: "kernel" kernel_vmstat: @@ -72,4 +83,4 @@ telegraf: syslog: name: "syslog" params: - server: "udp://:6514" \ No newline at end of file + server: "udp://:6514" diff --git a/states/telegraf/telegraf.conf.j2 b/states/telegraf/telegraf.conf.j2 index a7cdd39..49f818c 100644 --- a/states/telegraf/telegraf.conf.j2 +++ b/states/telegraf/telegraf.conf.j2 @@ -11,7 +11,7 @@ flush_interval = "10s" flush_jitter = "0s" precision = "" - hostname = "" + hostname = "{{ salt['grains.get']('fqdn') }}" omit_hostname = false [[outputs.influxdb]] @@ -27,4 +27,4 @@ {{ paramname }} = {% if paramvalue is sameas True or paramvalue is sameas False %}{{ paramvalue|string|lower }}{% elif paramvalue is iterable and paramvalue is not string %}[{{ paramvalue|join(",") }}]{% else %}"{{ paramvalue }}"{% endif %} {%- endfor %} {%- endif %} -{% endfor %} \ No newline at end of file +{% endfor %}