From 7c71e956e8e1779acd82b130ea149ec761520953 Mon Sep 17 00:00:00 2001
From: Christian Poessinger <christian@poessinger.com>
Date: Sun, 1 May 2022 19:15:31 +0200
Subject: telegraf: T4353: fix Jinja2 linting errors

---
 data/templates/monitoring/override.conf.j2         |  7 +++
 data/templates/monitoring/override.conf.tmpl       |  7 ---
 data/templates/monitoring/syslog_telegraf.j2       |  5 ++
 data/templates/monitoring/syslog_telegraf.tmpl     |  5 --
 .../monitoring/systemd_vyos_telegraf_service.j2    | 16 ++++++
 .../monitoring/systemd_vyos_telegraf_service.tmpl  | 16 ------
 data/templates/monitoring/telegraf.j2              | 60 ++++++++++++++++++++++
 data/templates/monitoring/telegraf.tmpl            | 60 ----------------------
 8 files changed, 88 insertions(+), 88 deletions(-)
 create mode 100644 data/templates/monitoring/override.conf.j2
 delete mode 100644 data/templates/monitoring/override.conf.tmpl
 create mode 100644 data/templates/monitoring/syslog_telegraf.j2
 delete mode 100644 data/templates/monitoring/syslog_telegraf.tmpl
 create mode 100644 data/templates/monitoring/systemd_vyos_telegraf_service.j2
 delete mode 100644 data/templates/monitoring/systemd_vyos_telegraf_service.tmpl
 create mode 100644 data/templates/monitoring/telegraf.j2
 delete mode 100644 data/templates/monitoring/telegraf.tmpl

(limited to 'data')

diff --git a/data/templates/monitoring/override.conf.j2 b/data/templates/monitoring/override.conf.j2
new file mode 100644
index 000000000..f8f150791
--- /dev/null
+++ b/data/templates/monitoring/override.conf.j2
@@ -0,0 +1,7 @@
+[Unit]
+After=vyos-router.service
+ConditionPathExists=/run/telegraf/vyos-telegraf.conf
+[Service]
+Environment=INFLUX_TOKEN={{ authentication.token }}
+CapabilityBoundingSet=CAP_NET_RAW CAP_NET_ADMIN CAP_SYS_ADMIN
+AmbientCapabilities=CAP_NET_RAW CAP_NET_ADMIN
diff --git a/data/templates/monitoring/override.conf.tmpl b/data/templates/monitoring/override.conf.tmpl
deleted file mode 100644
index f8f150791..000000000
--- a/data/templates/monitoring/override.conf.tmpl
+++ /dev/null
@@ -1,7 +0,0 @@
-[Unit]
-After=vyos-router.service
-ConditionPathExists=/run/telegraf/vyos-telegraf.conf
-[Service]
-Environment=INFLUX_TOKEN={{ authentication.token }}
-CapabilityBoundingSet=CAP_NET_RAW CAP_NET_ADMIN CAP_SYS_ADMIN
-AmbientCapabilities=CAP_NET_RAW CAP_NET_ADMIN
diff --git a/data/templates/monitoring/syslog_telegraf.j2 b/data/templates/monitoring/syslog_telegraf.j2
new file mode 100644
index 000000000..cdcbd92a4
--- /dev/null
+++ b/data/templates/monitoring/syslog_telegraf.j2
@@ -0,0 +1,5 @@
+# Generated by /usr/libexec/vyos/conf_mode/service_monitoring_telegraf.py
+
+$ModLoad omuxsock
+$OMUxSockSocket /run/telegraf/telegraf_syslog.sock
+*.notice :omuxsock:
diff --git a/data/templates/monitoring/syslog_telegraf.tmpl b/data/templates/monitoring/syslog_telegraf.tmpl
deleted file mode 100644
index cdcbd92a4..000000000
--- a/data/templates/monitoring/syslog_telegraf.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-# Generated by /usr/libexec/vyos/conf_mode/service_monitoring_telegraf.py
-
-$ModLoad omuxsock
-$OMUxSockSocket /run/telegraf/telegraf_syslog.sock
-*.notice :omuxsock:
diff --git a/data/templates/monitoring/systemd_vyos_telegraf_service.j2 b/data/templates/monitoring/systemd_vyos_telegraf_service.j2
new file mode 100644
index 000000000..234ef5586
--- /dev/null
+++ b/data/templates/monitoring/systemd_vyos_telegraf_service.j2
@@ -0,0 +1,16 @@
+[Unit]
+Description=The plugin-driven server agent for reporting metrics into InfluxDB
+Documentation=https://github.com/influxdata/telegraf
+After=network.target
+
+[Service]
+EnvironmentFile=-/etc/default/telegraf
+User=telegraf
+ExecStart=/usr/bin/telegraf -config /run/telegraf/vyos-telegraf.conf -config-directory /etc/telegraf/telegraf.d $TELEGRAF_OPTS
+ExecReload=/bin/kill -HUP $MAINPID
+Restart=on-failure
+RestartForceExitStatus=SIGPIPE
+KillMode=control-group
+
+[Install]
+WantedBy=multi-user.target
diff --git a/data/templates/monitoring/systemd_vyos_telegraf_service.tmpl b/data/templates/monitoring/systemd_vyos_telegraf_service.tmpl
deleted file mode 100644
index 234ef5586..000000000
--- a/data/templates/monitoring/systemd_vyos_telegraf_service.tmpl
+++ /dev/null
@@ -1,16 +0,0 @@
-[Unit]
-Description=The plugin-driven server agent for reporting metrics into InfluxDB
-Documentation=https://github.com/influxdata/telegraf
-After=network.target
-
-[Service]
-EnvironmentFile=-/etc/default/telegraf
-User=telegraf
-ExecStart=/usr/bin/telegraf -config /run/telegraf/vyos-telegraf.conf -config-directory /etc/telegraf/telegraf.d $TELEGRAF_OPTS
-ExecReload=/bin/kill -HUP $MAINPID
-Restart=on-failure
-RestartForceExitStatus=SIGPIPE
-KillMode=control-group
-
-[Install]
-WantedBy=multi-user.target
diff --git a/data/templates/monitoring/telegraf.j2 b/data/templates/monitoring/telegraf.j2
new file mode 100644
index 000000000..cf33eec4e
--- /dev/null
+++ b/data/templates/monitoring/telegraf.j2
@@ -0,0 +1,60 @@
+# Generated by /usr/libexec/vyos/conf_mode/service_monitoring_telegraf.py
+
+[agent]
+  interval = "15s"
+  round_interval = true
+  metric_batch_size = 1000
+  metric_buffer_limit = 10000
+  collection_jitter = "5s"
+  flush_interval = "15s"
+  flush_jitter = "0s"
+  precision = ""
+  debug = false
+  quiet = false
+  logfile = ""
+  hostname = ""
+  omit_hostname = false
+[[outputs.influxdb_v2]]
+  urls = ["{{ url }}:{{ port }}"]
+  insecure_skip_verify = true
+  token = "$INFLUX_TOKEN"
+  organization = "{{ authentication.organization }}"
+  bucket = "{{ bucket }}"
+[[inputs.cpu]]
+    percpu = true
+    totalcpu = true
+    collect_cpu_time = false
+    report_active = false
+[[inputs.disk]]
+    ignore_fs = ["devtmpfs", "devfs"]
+[[inputs.diskio]]
+[[inputs.mem]]
+[[inputs.net]]
+[[inputs.system]]
+[[inputs.netstat]]
+[[inputs.processes]]
+[[inputs.kernel]]
+[[inputs.interrupts]]
+[[inputs.linux_sysctl_fs]]
+[[inputs.systemd_units]]
+[[inputs.conntrack]]
+  files = ["ip_conntrack_count","ip_conntrack_max","nf_conntrack_count","nf_conntrack_max"]
+  dirs = ["/proc/sys/net/ipv4/netfilter","/proc/sys/net/netfilter"]
+[[inputs.ethtool]]
+  interface_include = {{ interfaces_ethernet }}
+[[inputs.ntpq]]
+  dns_lookup = true
+[[inputs.internal]]
+[[inputs.nstat]]
+[[inputs.syslog]]
+  server = "unixgram:///run/telegraf/telegraf_syslog.sock"
+  best_effort = true
+  syslog_standard = "RFC3164"
+[[inputs.exec]]
+  commands = [
+    "{{ custom_scripts_dir }}/show_firewall_input_filter.py",
+    "{{ custom_scripts_dir }}/show_interfaces_input_filter.py",
+    "{{ custom_scripts_dir }}/vyos_services_input_filter.py"
+  ]
+  timeout = "10s"
+  data_format = "influx"
diff --git a/data/templates/monitoring/telegraf.tmpl b/data/templates/monitoring/telegraf.tmpl
deleted file mode 100644
index cf33eec4e..000000000
--- a/data/templates/monitoring/telegraf.tmpl
+++ /dev/null
@@ -1,60 +0,0 @@
-# Generated by /usr/libexec/vyos/conf_mode/service_monitoring_telegraf.py
-
-[agent]
-  interval = "15s"
-  round_interval = true
-  metric_batch_size = 1000
-  metric_buffer_limit = 10000
-  collection_jitter = "5s"
-  flush_interval = "15s"
-  flush_jitter = "0s"
-  precision = ""
-  debug = false
-  quiet = false
-  logfile = ""
-  hostname = ""
-  omit_hostname = false
-[[outputs.influxdb_v2]]
-  urls = ["{{ url }}:{{ port }}"]
-  insecure_skip_verify = true
-  token = "$INFLUX_TOKEN"
-  organization = "{{ authentication.organization }}"
-  bucket = "{{ bucket }}"
-[[inputs.cpu]]
-    percpu = true
-    totalcpu = true
-    collect_cpu_time = false
-    report_active = false
-[[inputs.disk]]
-    ignore_fs = ["devtmpfs", "devfs"]
-[[inputs.diskio]]
-[[inputs.mem]]
-[[inputs.net]]
-[[inputs.system]]
-[[inputs.netstat]]
-[[inputs.processes]]
-[[inputs.kernel]]
-[[inputs.interrupts]]
-[[inputs.linux_sysctl_fs]]
-[[inputs.systemd_units]]
-[[inputs.conntrack]]
-  files = ["ip_conntrack_count","ip_conntrack_max","nf_conntrack_count","nf_conntrack_max"]
-  dirs = ["/proc/sys/net/ipv4/netfilter","/proc/sys/net/netfilter"]
-[[inputs.ethtool]]
-  interface_include = {{ interfaces_ethernet }}
-[[inputs.ntpq]]
-  dns_lookup = true
-[[inputs.internal]]
-[[inputs.nstat]]
-[[inputs.syslog]]
-  server = "unixgram:///run/telegraf/telegraf_syslog.sock"
-  best_effort = true
-  syslog_standard = "RFC3164"
-[[inputs.exec]]
-  commands = [
-    "{{ custom_scripts_dir }}/show_firewall_input_filter.py",
-    "{{ custom_scripts_dir }}/show_interfaces_input_filter.py",
-    "{{ custom_scripts_dir }}/vyos_services_input_filter.py"
-  ]
-  timeout = "10s"
-  data_format = "influx"
-- 
cgit v1.2.3