06-29-2021 09:55 PM
Hello,
We are getting interface discards on some of out ports on our nexus switches. Unfortunately, our monitoring tool could not generate the graph of the top 10 devices with discards.
I am trying to generate the output manually by just filtering the interfaces only with discard values.
The result removed the "0 input discard" and "0 output discard" but it still showed the other interfaces that are not necessary to the output or my expected result.
Here are the commands I tried.
This one removes the "0 input/output discard" but still includes the unnecessary interfaces that don't have input/output discards. The Output is on Discard 2 attachment.
show interface | exclude "0 input discard" | exclude "0 output discard" | include ignore-case "Port-Channel|Ethernet|discard"
This one shows the interfaces and discards including the 0 input/output discards. The sample is on Discard 1 attachment
show interface | include ignore-case "discard|Ethernet"
Solved! Go to Solution.
06-29-2021 11:13 PM
Hi @clavister
So you want to display only the interfaces with in/out discards, right?
I would suggest you try filtering the "show int counters errors" output since it is much simpler and has better structure.
Since you want to make a graph, I suppose you are not doing the parsing manually. So you can also take advantage of the NXOS built-in programmability features. For example, use " | json " at the end of a command, and you will get the output in json format.
If you really want to go the "hard way" and filter the show interface, you can try this:
show interface | exclude " 0 input discard" | exclude " 0 output discard" | grep "port\-cha\|Ethernet[1-9]\|discard" | grep -B 1 discard
The command will basically display 1 line before discard line which is either another discard value, either the corresponding interface.
Also, I made some adjustments on the cmd to not display the "Hardware" lines.
Cheers,
Sergiu
06-29-2021 11:13 PM
Hi @clavister
So you want to display only the interfaces with in/out discards, right?
I would suggest you try filtering the "show int counters errors" output since it is much simpler and has better structure.
Since you want to make a graph, I suppose you are not doing the parsing manually. So you can also take advantage of the NXOS built-in programmability features. For example, use " | json " at the end of a command, and you will get the output in json format.
If you really want to go the "hard way" and filter the show interface, you can try this:
show interface | exclude " 0 input discard" | exclude " 0 output discard" | grep "port\-cha\|Ethernet[1-9]\|discard" | grep -B 1 discard
The command will basically display 1 line before discard line which is either another discard value, either the corresponding interface.
Also, I made some adjustments on the cmd to not display the "Hardware" lines.
Cheers,
Sergiu
07-05-2021 05:09 AM - edited 07-05-2021 05:41 AM
this is quite helpful.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: