Step 1: Find switch ports that are down
sh ip int br | i down
This lets us see the ports that are either admin down, or line down (no cable plugged in or PC off). However just because a PC is off at the time we check does not mean the port is free to be used. A user could be away on holiday or a PC/Printer is only booted once a week/month for a specific task.
Now we need to look at some other things
sh int | inc line protocol is|Last input
Look for ports that are down and last output is old. Last input is almost always "never".
Copy output to file
Run regular expression on it
^GigabitEthernet.*down,.*[\r\n].*[^/r/n]output\s\d.*
Find all
Copy and paste into new file
Good command:
show int | i proto.*notconnect|proto.*administratively down|Last in.* [6-9]w|Last in.*[0-9][0-9]w|[0-9]y|disabled|Last input never, output never, output hang never
Other method
Take a list of the interface counters per port
Clear the counters
Wait a few weeks and take the counters again
Then compare with winmerge or other diff tool
clear counters
show interfaces | include (FastEthernet|GigabitEthernet|TenGigabitEthernet).*input packets
show interfaces | include (GigabitEthernet|TenGigabitEthernet)|Last input|packets input
No comments:
Post a Comment