cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4394
Views
0
Helpful
0
Replies

Show interfaces transceiver - quick method (loop throw all interfaces with test)

Petr Kriz
Level 1
Level 1

Hello,

I try send informations about Tx and Rx about interfaces transceiver via syslog messages.

If I write command on CLI show interfaces transceiver the result running between 30-60 seconds with result (it's right):

....some headers...
mA: milliamperes, dBm: decibels (milliwatts).

Optical Optical
Temperature Voltage Tx Power Rx Power
Port (Celsius) (Volts) (dBm) (dBm)
--------- ----------- ------- -------- --------
Gi1/1/1 38.6 3.32 2.2 -12.0
Gi1/1/2 35.3 3.28 3.3 -14.5


SW01#

If I run the command show interfaces transceiver OR show interfaces transceiver | incl [0-9]/[0-9] the result running between 30-60 seconds too. And Event manager do not wait for result this long time if I run this query in EEM.

If I try run the query force the interface on CLI sh interfaces Gig 1/1/1 transceiver the result is extereme quick - this is right (exists monitor): 

Optical Optical
Temperature Voltage Tx Power Rx Power
Port (Celsius) (Volts) (dBm) (dBm)
--------- ----------- ------- -------- --------
Gi1/1/1 38.6 3.32 2.2 -12.0

If I try run the query force the interface on CLI sh interfaces Gig 1/0/12 transceiver the result is extereme quick - this is right (not exist monitor): 

Diagnostic Monitoring is not implemented.

I want write a EMM, where I go throw all physical interfaces (not VLANs and not Loopbacks) and on every interface I want run the force query and test result. If diagnostic monitor is implement, I want send syslog message.

Can you please help me with syntax? 
Green are my comments for you

event manager session cli username "tool_event_manager"
event manager applet PK_SHOWINTTRANS
event timer watchdog time 120 maxrun 120
action 001 syslog msg "PK_SHOWINTTRANS begin"
action 010 cli command "enable"
action 020 cli command "show interfaces transceiver | incl [0-9]/[0-9]"     // Read all interfaces on switch
action 030 foreach line "$_cli_result" "\n"         // Go throw all found interfaces in previous result
action 031 if $line eq "Ethernet"                    // If line (found interface) contains word Ethernet - it is physical interface
action 032 syslog msg "$line"             // send syslog message
action 033 end
action 060 syslog msg "PK_SHOWINTTRANS end"
!

Thank you and best regards,
 Petr

0 Replies 0