02-23-2010 09:21 AM
Hello,
I was reffered to this discussion board by cisco support. We are troubleshooting an issue with cisco 7609 and need to create TCL script that does the following.
Tracks interface status and on down state executes 'show log' , 'show tech' ..... all the output needs to be saved into a file
In additon show commands needs to be executed from SIP-200 card ('attach 4' is the command to get there)
I created EEM applet but it turned out that to get to SIP-200 card TCL script is required.
Thanks
Solved! Go to Solution.
03-10-2010 05:08 PM
02-23-2010 11:50 AM
What version of IOS does this need to run on? Exactly what commands need to be run on the Sup and on the line card?
02-23-2010 12:36 PM
Version 12.2(33)SRD3
Sup commands:
A. show log
B. show controllers serial 4/0/0/3:0 [5 times, pause 15 seconds between outputs]
C.show interface serial 4/0/0/3:0 [5 times, pause 15 seconds between outputs]
D. show hqf interface [5 times, pause 15 seconds between outputs]
E. show policy-map interface serial 4/0/0/3:0 [5 times, pause 15 seconds between outputs]
F. show tech
From SIP-200 [In this order]:
=============================
A. show platform software camp [5 times, pause 15 seconds between outputs]
B. show proc cpu [5 times, pause 15 seconds between outputs]
C. show platform software ibc [5 times, pause 15 seconds between outputs]
D. show plat hard egos counters [5 times, pause 15 seconds between outputs]
E. show platform hardware spi4 spa0 [5 times, pause 15 seconds between outputs]
F. show interfaces [5 times, pause 15 seconds between outputs]
G. show controllers [5 times, pause 15 seconds between outputs]
H. sh platform hardware hyperion all [5 times, pause 15 seconds between outputs]
I. sh platform hardware hyperion counters [5 times, pause 15 seconds between outputs]
J. sh platform hardware hyperion errors [5 times, pause 15 seconds between outputs]
K. sh platform hardware hyperion packet [5 times, pause 15 seconds between outputs]
L. sh platform hardware sonet [5 times, pause 15 seconds between outputs]
M. sh platform hardware iofpga [5 times, pause 15 seconds between outputs]
N. sh platform hardware ssa brief [5 times, pause 15 seconds between outputs]
O. sh platform hardware ssa counters [5 times, pause 15 seconds between outputs]
P. sh platform hardware ssa status [5 times, pause 15 seconds between outputs]
Q. sh platform hardware eos brief [5 times, pause 15 seconds between outputs]
R. sh platform hardware eos counters [5 times, pause 15 seconds between outputs]
S. sh platform hardware eos status [5 times, pause 15 seconds between outputs]
Thanks
02-24-2010 08:12 PM
I believe this script will do what you want. You will need to set some EEM environment variables before you can use it.
# check_intf : Name of the interface to watch.
#
# check_intf_file : Full patch to the file into which the command output
# will be saved.
#
# check_intf_mod : Module from which additional CLI output will be collected.
For example:
event manager environment check_intf Serial4/0/0/3:0
event manager environment check_intf_file disk0:/cli_output.txt
event manager environment check_intf_mod 4
The policy must then be copied to the switch. I typically create a directory called "policies" on one of the local flash file systems (e.g. disk0:/policies). After creating the directory, copy the sl_check_intf.tcl policy into this directory. Finally, after configuring the environment variables above, configure the following:
event manager directory user policy disk0:/policies
event manager policy sl_check_intf.tcl
02-25-2010 06:52 AM
Thank you, Joe. I will try this.
02-25-2010 05:24 PM
02-26-2010 01:57 PM
Thanks Joe. I also need to remove a service policy once all show commands are done.
I tried adding a script into your file, but .....
Could you help me with that. Here are the commands:
conf t
interface serial 4/0/0/3:0
no service-policy output Parent
Thanks,
02-27-2010 09:57 AM
03-02-2010 02:49 PM
Joe,
I tested the script few times. The ouput fie has only the results of show commands from the privilage mode.
'show policy-map interface serial 4/0/0/3:0' is the last one (5 times)
'Show tech' and commands from the module are not there.
Thanks,
03-02-2010 05:42 PM
Do you see any messages in show logg? I allowed this policy to run for an hour, so I don't think it's being terminated before the show tech. If you can, collecting the output of "debug event manager tcl cli" would be helpful.
03-03-2010 08:57 AM
03-03-2010 08:58 AM
You're using the wrong version of the script. Make sure you download the LAST version in this thread. I changed the attach approach to "remote command". Check the script to make sure you see "remote command" and not "attach".
03-03-2010 11:46 AM
I checked and file was correct. Just in case I deleted it and uploaded again. Checked the contect of the file on the router and it has 'remote command'. Tested it again and got the same result. Do I need to re-register the script or do something else to activate the new script?
Thanks
03-03-2010 12:23 PM
Yes, you must always re-register EEM Tcl policies when you make a change. Simply copying the new policy file to the device is not sufficient. Just unconfigure the policy, and reconfigure it, and that will sufficiently re-register it.
03-03-2010 02:17 PM
Got it. It's running the new script now. But still cannot get output from the module 4. Here is what debug command shows :
.
.
2083110: 21w5d: %HA_EM-6-LOG: sl_check_intf.tcl : DEBUG(cli_lib) : IN : 7600rtr#remote command module 4 show platform hardware sonet | append sup-bootdisk:ser4003_shut.txt
2083111: 21w5d: %HA_EM-6-LOG: sl_check_intf.tcl : DEBUG(cli_lib) : OUT : $atform hardware sonet | append sup-bootdisk:ser4003_shut.txt
2083112: 21w5d: %HA_EM-6-LOG: sl_check_intf.tcl : DEBUG(cli_lib) : OUT : Cannot remote to module 4
.
.
I tried running 'remote command module 4 show ..' manualy from the privilieage mode and got the same error "cannot remote to module 4"
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: