diff --git a/juniper-macros.j2 b/juniper-macros.j2 index b84bd7b..37952d7 100644 --- a/juniper-macros.j2 +++ b/juniper-macros.j2 @@ -305,6 +305,20 @@ routing-options { {%- endmacro %} +{% macro sflowsection(device) %} +{% if device['config_context']['sflow'] %} + sflow { +{% for collector in device['config_context']['sflow']['collectors'] %} + collector {{ collector }}; +{% endfor %} +{% for interface in device['config_context']['sflow']['interfaces'] %} + interface {{ interface }}; +{% endfor %} + } +{% endif %} +{%- endmacro %} + + {% macro vlanssection(vlans,device) %} vlans { {# This next line selects all of the VLANs which are configured on this device #} diff --git a/juniper-vxlan.j2 b/juniper-vxlan.j2 index b742e91..4106ef8 100644 --- a/juniper-vxlan.j2 +++ b/juniper-vxlan.j2 @@ -41,6 +41,7 @@ protocols { lldp { interface all; } +{{ junos.sflowsection(device) }} } {% if device_role['name'] == 'Leaf' %} switch-options {