OcNOS-SP : Ansible Guide : Ansible User Guide : SNMP Configuration
SNMP Configuration
Template File for SNMP
ocnos_snmp.j2
snmp-server enable snmp vrf {{ snmp.vrf }}
snmp-server view {{ snmp.viewname }} {{ snmp.oid }} included vrf management
snmp-server community {{ snmp.communame }} group network-admin vrf management
{% if snmp.community is defined %}
snmp-server community {{ snmp.community }} group network-operator vrf management
{% endif %}
{% if snmp.hosttest is defined %}
snmp-server host {{ snmp.hosttest }} traps version 2c test udp-port 161 vrf management
{% endif %}
snmp-server host {{ snmp.hostpub }} traps version 2c public udp-port 162 vrf management
{% for traps in snmp.traps -%}
snmp-server enable traps {{ traps.daemon }}
{% endfor -%}
Parameter File for SNMP
sw2.yml
 
Snmp
Set SNMP service
Traps
globally enable snmp traps
- daemon: bgp
Enable bgp notification trap in global configuration mode
- daemon: isis
Enable isis notification trap in global configuration mode
- daemon: pwdelete
Enable pwdelete notification trap in global configuration mode
- daemon: pw
Enable pw notification trap in global configuration mode
- daemon: mpls
Enable mpls notification trap in global configuration mode
- daemon: ospf
Enable ospf notification trap in global configuration mode
- daemon: rsvp
Enable rsvp notification trap in global configuration mode
vrf: management
Configure vrf name as < snmp-server enable snmp vrf management> to enable snmp
viewname: all
Globally Configure viewname as < snmp-server view all.1 included vrf management>
oid: .1
Specify the OID-Tree in global configs
community: test
Configure community name as test
communame: public
Configure community name as public
hosttest: 10.12.6.247
Configure snmp-server host 10.12.6.247 traps version 2c public udp-port 161 vrf management command globlly
hostpub: 10.12.47.72
Configure snmp-server host 10.12.47.72 traps version 2c public udp-port 162 vrf management command globlly
Last modified date: 06/08/2023