Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (12 sloc) 602 Bytes
import pyeapi
import pprint
node = pyeapi.connect_to('sw1')
crc_errors = (node.enable('show interfaces counters errors')[0]['result']['interfaceErrorCounters'])
discards = node.enable('show interfaces counters discards')[0]['result']['interfaces']
for k,v in crc_errors.items():
if v['fcsErrors'] != 0:
print('Interface {}: {} CRC errors'.format(k,v['fcsErrors']))
print('########################################')
for k,v in discards.items():
if v['outDiscards'] != 0:
print('Interface {}: {} Output discards, {} Input discards').format(k,v['outDiscards'],v['inDiscards'])
You can’t perform that action at this time.