diff --git a/juniper-macros.j2 b/juniper-macros.j2 index 342777e..a8a9b26 100644 --- a/juniper-macros.j2 +++ b/juniper-macros.j2 @@ -250,7 +250,15 @@ interfaces { {% macro snmpsection(device, snmp) %} snmp { +{% if device.rack and device.rack.site %} location "{{ device.rack.site.name }} Rack {{ device.rack.name }}"; +{% elif device.rack and device.site %} + location "{{ device.site.name }} Rack {{ device.rack.name }}"; +{% elif device.site %} + location "{{ device.site.name }}" +{% elif device.rack %} + location "{{ device.rack.name }}" +{% endif %} contact "{{ snmp['contact'] }}"; community {{ snmp['community'] }} { authorization read-only;