Below script can be used to check the error counter from switch ports on EXOS. on the second line script will gather the information of rxerror in clear text from switch CLI. By while structure, script will extract each value of line, port, crc, overrun error, etc., and will create the log in case the number of error is bigger than 0.
disable clipaging
set var CLI.OUT " "
show port rxerror no-refresh
set var flr_list $TCL(split ${CLI.OUT} "\n") /* sperate the output per line */
set var len $TCL(llength $flr_list) /* count the length of line */
set var total ($len - 7)
set var cnt 0
set var cnt2 4
while ($cnt < $total) do
set var line $TCL(lindex $flr_list $cnt2)
set var port $TCL(lindex $line 0)
set var crc $TCL(lindex $line 2)
set var over $TCL(lindex $line 3)
set var under $TCL(lindex $line 4)
set var flag $TCL(lindex $line 5)
set var jabber $TCL(lindex $line 6)
set var align $TCL(lindex $line 7)
set var lost $TCL(lindex $line 8)
if ($crc != 0) then
create log entry CRC_ERROR_DETECTED_CRC_PORT:$port
create log entry CRC_ERROR_DETECTED_CRC_COUNT:$crc
endif
if ($over != 0) then
create log entry OVERRUN_ERROR_DETECTED_OVERRUN_PORT:$port
create log entry OVERRUN_ERROR_DETECTED_OVERRUN_COUNT:$over
endif
if ($under != 0) then
create log entry UNDERRUN_ERROR_DETECTED_UNDERRUN_PORT:$port
create log entry UNDERRUN_ERROR_DETECTED_UNDERRUN_COUNT:$under
endif
if ($flag != 0) then
create log entry FLAG_ERROR_DETECTED_FLAG_PORT:$port
create log entry FLAG_ERROR_DETECTED_FLAG_COUNT:$flag
endif
if ($jabber != 0) then
create log entry JABBER_ERROR_DETECTED_JABBER_PORT:$port
create log entry JABBER_ERROR_DETECTED_JABBER_COUNT:$flag
endif
if ($align != 0) then
create log entry ALIGN_ERROR_DETECTED_ALIGN_PORT:$port
create log entry ALIGN_ERROR_DETECTED_ALIGN_COUNT:$align
endif
if ($lost != 0) then
create log entry LOST_ERROR_DETECTED_LOST_PORT:$port
create log entry LOST_ERROR_DETECTED_LOST_COUNT:$lost
endif
set var cnt ($cnt +1)
set var cnt2 ($cnt2 +1)
endwhile
clear counters ports
No comments:
Post a Comment