updated telegraf state
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Paul 2024-03-20 14:32:46 +01:00
parent e7229ae189
commit 2931ebd8bf
5 changed files with 53 additions and 46 deletions

View File

@ -9,13 +9,17 @@ telegraf-config-dir:
- watch_in:
- service: telegraf-service
{% for cfg, value in telegraf.config.items() %}
telegraf-config-file:
file.managed:
- name: /etc/telegraf/telegraf.conf
- name: /etc/telegraf/{{ cfg }}.conf
- source: salt://telegraf/templates/telegraf.conf.j2
- user: root
- group: root
- mode: 600
- template: jinja
- context:
config: {{ value }}
- watch_in:
- service: telegraf-service
- service: telegraf-{{ cfg }}-service
{% endfor %}

View File

@ -8,41 +8,42 @@ telegraf:
os: linux
arch: amd64
config:
outputs:
influxdb:
urls:
- '"http://localhost:8086"'
username: username
password: password
database: telegraf
inputs:
cpu:
percpu: true
totalcpu: true
collect_cpu_time: false
report_active: false
disk:
ignore_fs:
- '"tmpfs"'
- '"devtmpfs"'
- '"devfs"'
- '"iso9660"'
- '"overlay"'
- '"aufs"'
- '"squashfs"'
- '"fuse.rclone"'
diskio:
kernel:
kernel_vmstat:
mem:
net:
netstat:
postfix:
processes:
swap:
sensors:
smart:
system:
systemd_units:
syslog:
server: "udp://:6514"
main:
outputs:
influxdb:
urls:
- '"http://localhost:8086"'
username: username
password: password
database: telegraf
inputs:
cpu:
percpu: true
totalcpu: true
collect_cpu_time: false
report_active: false
disk:
ignore_fs:
- '"tmpfs"'
- '"devtmpfs"'
- '"devfs"'
- '"iso9660"'
- '"overlay"'
- '"aufs"'
- '"squashfs"'
- '"fuse.rclone"'
diskio:
kernel:
kernel_vmstat:
mem:
net:
netstat:
postfix:
processes:
swap:
sensors:
smart:
system:
systemd_units:
syslog:
server: "udp://:6514"

View File

@ -2,7 +2,7 @@
{%- from "telegraf/map.jinja" import telegraf with context %}
telegraf-service-file:
file.managed:
- name: /etc/systemd/system/telegraf.service
- name: /etc/systemd/system/telegraf@.service
- source: salt://telegraf/templates/telegraf.service.j2
- user: root
- group: root
@ -10,7 +10,9 @@ telegraf-service-file:
- watch_in:
- service: telegraf-service
telegraf-service:
{% for cfg, value in telegraf.config.items() %}
telegraf-{{ cfg }}-service:
service.running:
- name: telegraf
- name: telegraf@{{ cfg }}
- enable: true
{% endfor %}

View File

@ -20,12 +20,12 @@
hostname = "{{ salt['grains.get']('fqdn') }}"
omit_hostname = false
{% for name, value in telegraf.config.outputs.items() -%}
{% for name, value in config.outputs.items() -%}
[[outputs.{{ name }}]]
{{ cfg(value) }}
{% endfor %}
{% for name, value in telegraf.config.inputs.items() -%}
{% for name, value in config.inputs.items() -%}
[[inputs.{{ name }}]]
{{ cfg(value) }}
{% endfor -%}

View File

@ -7,7 +7,7 @@ After=network.target
[Service]
EnvironmentFile=-/etc/default/telegraf
ExecStart=/usr/local/bin/telegraf --config /etc/telegraf/telegraf.conf
ExecStart=/usr/local/bin/telegraf --config /etc/telegraf/%i.conf
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
RestartForceExitStatus=SIGPIPE