- // Delete old profile from Aliveness Manager
- IfTunnel ifTunnelOld = interfaceOld.getAugmentation(IfTunnel.class);
- if(ifTunnelNew.getMonitorInterval() != ifTunnelOld.getMonitorInterval()) {
- LOG.debug("deleting older monitor profile for interface {}", interfaceName);
- long profileId = allocateProfile(alivenessMonitorService, FAILURE_THRESHOLD, ifTunnelOld.getMonitorInterval(), MONITORING_WINDOW, EtherTypes.Lldp);
- MonitorProfileDeleteInput profileDeleteInput = new MonitorProfileDeleteInputBuilder().setProfileId(profileId).build();
- alivenessMonitorService.monitorProfileDelete(profileDeleteInput);
- }
- }
+ stopLLDPMonitoring(alivenessMonitorService, dataBroker, interfaceOld);
+ if(ifTunnelNew.isMonitorEnabled()) {
+ startLLDPMonitoring(alivenessMonitorService, dataBroker, interfaceNew);
+
+ // Delete old profile from Aliveness Manager
+ IfTunnel ifTunnelOld = interfaceOld.getAugmentation(IfTunnel.class);
+ if(ifTunnelNew.getMonitorInterval() != ifTunnelOld.getMonitorInterval()) {
+ LOG.debug("deleting older monitor profile for interface {}", interfaceName);
+ long profileId = allocateProfile(alivenessMonitorService, FAILURE_THRESHOLD, ifTunnelOld.getMonitorInterval(), MONITORING_WINDOW, EtherTypes.Lldp);
+ MonitorProfileDeleteInput profileDeleteInput = new MonitorProfileDeleteInputBuilder().setProfileId(profileId).build();
+ alivenessMonitorService.monitorProfileDelete(profileDeleteInput);