11-21-2013 11:16 AM
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!!
Solved! Go to Solution.
11-24-2013 03:51 PM
11-24-2013 03:51 PM
12-17-2013 01:13 PM
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!
12-17-2013 03:04 PM
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.
02-10-2014 09:08 PM
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!!
02-11-2014 08:12 AM
This opens the CLI session so that commands can be run on the device. It essentially allocates a VTY for EEM to use.
02-17-2014 11:40 AM
Joe,
thanks for all your efforts. its amazing the power of tcl script.
04-23-2014 08:48 AM
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 ?
04-23-2014 10:25 AM
Please start a new thread on the community for this question.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide