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

EEM optical transceiver power warnings

bryan totten
Level 1
Level 1

i am wanting a script that will generate a syslog message for both tx/rx transciever power warnings and alarms.  I would like to use the command "show inter transceiver" which generates output similiar to the output below (also see the attached output  file)

switch6504#show inter transceiver

port          temp          volts          current          optical tx power          optical rx power

Te3/7        34.1          0.00          41.8 --            -2.0 - -                          -5.1 -

Note: A single hyphen after number is a warning and a double hyphen is an alarm

I am wanting the EEM script to generate a syslog message for both the warning or alarm of tx/rx power.  Two different syslog messages:

1) syslog  = "$interface has an optical tx/rx power alarm"

2) syslog = "$interface  has an optical tx/rx power warning"

I am only concerned about tx/rx power.  I would like for the script to run every 30 minutes. If there is a warning/alarm on an interface to send a syslog once every 24hours while conditions are still met.

I have started the script (see attachment) and would appreciate any assistance.

thanks!!

1 Accepted Solution

Accepted Solutions

Joe Clarke
Cisco Employee
Cisco Employee

Give this one a try.

View solution in original post

8 Replies 8

Joe Clarke
Cisco Employee
Cisco Employee

Give this one a try.

Joe,

thanks for your help!  question:  is this only looking at the last two columns of data in the show output command (only tx optical power and rx optical power)? 

thanks again!

No, it looks at the last three really.  It needs to in order to determine if we have a '-' or "--" for either tx or rx power.  It's probably not the prettiest, but I think it will work.

Joe,

i am reading the "tcl scripting for cisco ios"  book and using it to fully understand this script that you wrote.  Could please explain the catch commands like the one below:

if [catch {cli_open} result] {

   error $result $errorInfo

} else {

    array set cli1 $result

}

thanks!!

This opens the CLI session so that commands can be run on the device.  It essentially allocates a VTY for EEM to use.

Joe,

thanks for all your efforts.   its amazing the power of tcl script.

Hi Joseph

   If I need to get  transceiver Tx and Rx power , and transfer into a SNMP MIB , Then let SNMP base NMS to query value , How to do that ?

Please start a new thread on the community for this question.

Review Cisco Networking for a $25 gift card