Files
chittick_projects/sophos-xgs-ansible/roles/sophos_snmp_logging/templates/snmp_config.json.j2
Jake Kasper 4f1e8d3add Claude 1
2025-12-09 09:33:48 -06:00

36 lines
1.2 KiB
Django/Jinja

<Request>
<Login>
<Username>{{ sophos_api_username }}</Username>
<Password>{{ sophos_api_password }}</Password>
</Login>
<Set operation="update">
<SNMP>
<Status>{{ 'Enable' if sophos_snmp.enabled | default(false) else 'Disable' }}</Status>
<Version>{{ sophos_snmp.version | default('v2c') }}</Version>
{% if sophos_snmp.version | default('v2c') == 'v2c' %}
<Community>{{ sophos_snmp.community }}</Community>
{% endif %}
<Location>{{ sophos_snmp.location | default('') }}</Location>
<Contact>{{ sophos_snmp.contact | default('') }}</Contact>
{% if sophos_snmp.allowed_networks is defined %}
<AllowedNetworks>
{% for network in sophos_snmp.allowed_networks %}
<Network>{{ network }}</Network>
{% endfor %}
</AllowedNetworks>
{% endif %}
{% if sophos_snmp.trap_destinations is defined %}
<TrapDestinations>
{% for trap in sophos_snmp.trap_destinations %}
<Destination>
<Host>{{ trap.host }}</Host>
<Port>{{ trap.port | default(162) }}</Port>
<Community>{{ trap.community }}</Community>
</Destination>
{% endfor %}
</TrapDestinations>
{% endif %}
</SNMP>
</Set>
</Request>