summaryrefslogtreecommitdiff
path: root/data/templates
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-08-01 07:44:16 +0200
committerGitHub <noreply@github.com>2024-08-01 07:44:16 +0200
commitcab6560949ac1a9ba1862faa959734bad6e9a064 (patch)
tree979bc2c01ffbcdb3d30ca65303232dcf9caebe01 /data/templates
parentcb1834742f4ed01d99d6396af8339dd59788ef65 (diff)
parentab331fab9e92a69e68080d413bf926db14ac354b (diff)
downloadvyos-1x-cab6560949ac1a9ba1862faa959734bad6e9a064.tar.gz
vyos-1x-cab6560949ac1a9ba1862faa959734bad6e9a064.zip
Merge pull request #3919 from sever-sever/T5657
T5657: Add VRF support for zabbix-agent
Diffstat (limited to 'data/templates')
-rw-r--r--data/templates/zabbix-agent/10-override.conf.j25
1 files changed, 4 insertions, 1 deletions
diff --git a/data/templates/zabbix-agent/10-override.conf.j2 b/data/templates/zabbix-agent/10-override.conf.j2
index 7c296e8fd..f6bd6500d 100644
--- a/data/templates/zabbix-agent/10-override.conf.j2
+++ b/data/templates/zabbix-agent/10-override.conf.j2
@@ -1,3 +1,4 @@
+{% set zabbix_command = 'ip vrf exec ' ~ vrf ~ ' ' if vrf is vyos_defined else '' %}
[Unit]
After=
After=vyos-router.service
@@ -5,9 +6,11 @@ ConditionPathExists=
ConditionPathExists=/run/zabbix/zabbix-agent2.conf
[Service]
+User=
+User=root
EnvironmentFile=
ExecStart=
-ExecStart=/usr/sbin/zabbix_agent2 --config /run/zabbix/zabbix-agent2.conf --foreground
+ExecStart={{ zabbix_command }}/usr/sbin/zabbix_agent2 --config /run/zabbix/zabbix-agent2.conf --foreground
WorkingDirectory=
WorkingDirectory=/run/zabbix
Restart=always