Skip to content

Commit

Permalink
T5657: Add VRF support for zabbix-agent
Browse files Browse the repository at this point in the history
To start the service under VRF requires starting under User=root
otherwise it had issues with cgroups
  • Loading branch information
sever-sever committed Jul 31, 2024
1 parent 0dc248a commit ab331fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion data/templates/zabbix-agent/10-override.conf.j2
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{% set zabbix_command = 'ip vrf exec ' ~ vrf ~ ' ' if vrf is vyos_defined else '' %}
[Unit]
After=
After=vyos-router.service
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@
</properties>
<defaultValue>3</defaultValue>
</leafNode>
#include <include/interface/vrf.xml.i>
</children>
</node>
</children>
Expand Down

0 comments on commit ab331fa

Please sign in to comment.