Overview
This solution gathers port status information for fabric extender ports using Forward Networks' Network Query Engine (NQE). This custom query enables the extraction of port status that isn't available by default. By creating a decorator around the query, it becomes easy to identify when fabric extender ports are down, allowing for quicker troubleshooting. This approach provides access to valuable data and reduces the time needed to detect and address port issues.
Benefits
- Improved visibility: Gain access to detailed fabric extender port status that is not typically modeled by default, providing critical insights for network management.
- Faster troubleshooting: Quickly identify and address issues with fabric extender ports through custom queries and decorators, reducing time spent on diagnosing problems.
- Enhanced network monitoring: Automate the process of monitoring port status with NQE, ensuring consistent oversight of network health and potential port failures.
How it works
This query parses the show FEX details to gather state information of Fabric Extender ports and their respective port status. So in this case, we will get the status of the Port Channel (Po12) and associated ports (Eth3/3 | Eth3/4). To do this, we’ll use custom commands to gather the ports and their status and then add decorators to make it easy to identify the affected ports.
sampleBlock="""
FEX: 100 Description: FEX0100 state: Online
FEX version: 4.2(1)N1(1) 4Switch version: 4.2(1)N1(1)]
FEX Interim version: 4.2(1)N1(0.309)
Switch Interim version: 4.2(1)N1(0.309)
Extender Model: N5K-C5110T-BF-1GE, Extender Serial: JAF1237ABSE
Part No: 73-12009-02
Card Id: 70, Mac Addr: 00:0d:ec:b1:13:02, Num Macs: 64
Module Sw Gen: 12594 Switch Sw Gen: 21]
post level: complete
pinning-mode: static Max-links: 1
Fabric port for control traffic: Eth3/3
Fabric interface state:
Po12 - Interface Up. State: Active
Eth3/3 - Interface Up. State: Active
Eth3/4 - Interface Up. State: Active
Fex Port State Fabric Port Primary Fabric
Eth100/1/1 Up Po12 Po12
Eth100/1/2 Up Po12 Po12
Eth100/1/3 Up Po12 Po12
Eth100/1/4 Up Po12 Po12
Eth100/1/5 Up Po12 Po12
Eth100/1/6 Up Po12 Po12
Eth100/1/7 Up Po12 Po12
Eth100/1/8 Up Po12 Po12
Eth100/1/9 Up Po12 Po12
Eth100/1/10 Up Po12 Po12
Eth100/1/11 Up Po12 Po12
Eth100/1/12 Up Po12 Po12
Eth100/1/13 Up Po12 Po12
Eth100/1/14 Up Po12 Po12
Eth100/1/15 Up Po12 Po12
Eth100/1/16 Up Po12 Po12
Eth100/1/17 Up Po12 Po12
Eth100/1/18 Up Po12 Po12
Eth100/1/19 Up Po12 Po12
Eth100/1/20 Up Po12 Po12
Eth100/1/21 Up Po12 Po12
Eth100/1/22 Up Po12 Po12
Eth100/1/23 Up Po12 Po12
""";
pattern = ```
Fabric interface state:
{poInt:string} - Interface {intStatus:string} State: {intState:string}
```;
foreach block in csampleBlock]
let fexConfig=parseConfigBlocks(OS.NXOS, block)
let matches=blockMatches(fexConfig, pattern)
foreach match in matches
let intStatus = replace(match.data.intStatus, ".", "")
select {
poInt: match.data.poInt,
intStatus: intStatus,
intState: match.data.intState
}
Check out these other posts using custom commands and decorators: