Skip to main content

vlan456 is configured with VRRP group 456, for the below query, length of vrrpFhrpGroupsCount is returned as 0

configuration snippet:
interface vlan456
 no shutdown
 ip address 10.7.0.1/26
 ip pim sparse-mode
 ip igmp version 3
 !
 vrrp-group 456
  priority 110
  virtual-address 10.7.0.7
!

for the below query,

@query

get_vrrp_details(host_pattern: String) =

    foreach device in network.devices

        where matches(device.name, toUpperCase(host_pattern))

            foreach interface in device.interfaces

            where isPresent(interface.routedVlan)

            let routedVlan = interface.routedVlan

            let ipv4 = routedVlan.ipv4

            let fhrp = ipv4.fhrp

            let vrrp = fhrp.vrrp

            select {

            deviceName: device.name,

            interfaceName: interface.name,

            vlan: routedVlan.vlan,

            hsrpFhrpGroupsCount: length(fhrp.hsrp.fhrpGroups),

            vrrpFhrpGroupsCount: length(fhrp.vrrp.fhrpGroups)  

            };

 

length of  vrrpFhrpGroupsCount is retured as 0.

Could you please let me know what am i missing?

@javeedf  I was able to replicate this and get it working with the following. Possible the top where clause is not filtering as you expect. 

Try 

`where matches(toLowerCase(device.name), toLowerCase(host_pattern))`

get_vrrp_details(host_pattern: String) =
foreach device in network.devices
where matches(toLowerCase(device.name), toLowerCase(host_pattern))
foreach interface in device.interfaces
where isPresent(interface.routedVlan)
let routedVlan = interface.routedVlan
let ipv4 = routedVlan.ipv4
let fhrp = ipv4.fhrp
let vrrp = fhrp.vrrp
where length(fhrp.vrrp.fhrpGroups) > 0 || length(fhrp.hsrp.fhrpGroups) > 0
select {
deviceName: device.name,
interfaceName: interface.name,
vlan: routedVlan.vlan,
fhrp,
vrrp,
hsrpFhrpGroupsCount: length(fhrp.hsrp.fhrpGroups),
vrrpFhrpGroupsCount: length(fhrp.vrrp.fhrpGroups)
};

 


thank you for your response,

This issue is seen specifically on Dell OS10. have you tried with Dell OS10?

sorry I missed to mention in my question


@javeedf That may be a different issue, can you please open a support case?


Reply