Summary
Support SNMP trap for VRRP events.
This is an example configuration
set high-availability vrrp snmp set service snmp trap-source '10.0.0.1' set service snmp trap-target 10.0.0.2 community 'public'
Enabling snmp for vrrp it works only for snmp polling, but for traps, it is not working. We have been able to include the trap feature on vrrp by enabling it at template level: /usr/share/vyos/templates/high-availability/keepalived.conf.j2, like this:
# Global definitions configuration block
global_defs {
enable_traps --> added
dynamic_interfaces
script_user rootThen restart the keepalived process: sudo systemctl restart keepalived, as we can see after performing a failover on both devices, we now see SNMP traps sent:
19:50:04.753356 eth1 Out IP 10.0.0.1.53724 > 10.0.0.2.162: V2Trap(146) .1.3.6.1.2.1.1.3.0=150656 .1.3.6.1.6.3.1.1.4.1.0=.1.3.6.1.4.1.9586.100.5.2.10.0.2 .1.3.6.1.4.1.9586.100.5.2.3.1.2="test" .1.3.6.1.4.1.9586.100.5.2.3.1.4=1 .1.3.6.1.4.1.9586.100.5.2.3.1.5=1 .1.3.6.1.4.1.9586.100.5.1.2.0="vyos" 19:50:09.953116 eth1 Out ARP, Request who-has 10.0.0.2 tell 10.0.0.1, length 28 19:50:09.954019 eth1 In ARP, Reply 10.0.0.2 is-at 0c:cc:e2:aa:00:00, length 46
Use case
With SNMP traps supported for VRRP, this will allow to follow the VRRP events and keep the HA status monitored.