08-05-2014 12:50 PM
I am trying to auto deploy many routers and am attempting to use Prime Infrastructure.
Here is what i have so far that works:
1- New router connected to network, boots and gets DHCP with tftp address
2- New router connects to Prime and uses deployed plug and play profile
2a- this erases the flash, downloads the required IOS and reboots to activate
2b- Pushes down a config file that contains an EEM applet as well as running a copy command to download a TCL file
What doesnt work:
The applet doesnt run. When I run "show event manager history events" it shows the applet with a status of abort?
Here is the applet. What I am trying to do is remove all of the CNS configuration from the config (as the router will be deployed at a customer site) as well as run a TCL script. :
event manager applet Remove_CNS
event syslog pattern "logged command:ntp server" period 1 maxrun 60
action 1.0 wait 300
action 1.1 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "no cns trusted-server all-agents prime.example.com"
action 3.1 cli command "no cns trusted-server all-agents prime"
action 3.2 cli command "no cns trusted-server all-agents 10.0.101.1"
action 3.3 cli command "no cns id hardware-serial"
action 3.4 cli command "no cns id hardware-serial event"
action 3.5 cli command "no cns id hardware-serial image"
action 3.6 cli command "no cns event prime-infra 11013 keepalive 120 2 reconnect-time 10"
action 3.7 cli command "no cns config partial 10.0.101.1 80"
action 3.8 cli command "no cns exec 80"
action 3.9 cli command "no cns image server http://10.0.101.1/cns/HttpMsgDispatcher status http://10.0.101.1/cns/HttpMsgDispatcher"
action 4.0 cli command "no ip host prime.example.com 10.0.101.1"
action 4.1 cli command "no ip host prime10.0.101.1"
action 4.2 cli command "interface g0/1"
action 4.3 cli command "no ip add"
action 4.4 cli command "shut"
action 4.5 cli command "end"
action 4.6 cli command "tclsh flash:cimc.tcl"
action 4.8 cli command "conf t"
action 5.0 cli command "no event manager applet Remove_CNS"
Solved! Go to Solution.
08-05-2014 07:45 PM
smolz,
Your applet appears to have a max run time of 60 seconds and the first action is to wait 300 seconds. I think this may be where it is aborting.
Seeing as you already have a tclsh script running on your device, you can include the configuration adjustments in that script by using the ios_config command in tclsh.
ios_config "no cns trusted-server all-agents prime.example.com"
ios_config "no cns trusted-server all-agents prime"
ios_config "no cns trusted-server all-agents 10.0.101.1"
ios_config "no cns id hardware-serial"
ios_config "no cns id hardware-serial event"
ios_config "no cns id hardware-serial image"
ios_config "no cns event prime-infra 11013 keepalive 120 2 reconnect-time 10"
ios_config "no cns config partial 10.0.101.1 80"
ios_config "no cns exec 80"
ios_config "no cns image server http://10.0.101.1/cns/HttpMsgDispatcher status http://10.0.101.1/cns/HttpMsgDispatcher"
ios_config "no ip host prime.example.com 10.0.101.1"
ios_config "no ip host prime10.0.101.1"
ios_config "interface g0/1"\
"no ip add"\
"shut"\
"end"
08-05-2014 07:45 PM
smolz,
Your applet appears to have a max run time of 60 seconds and the first action is to wait 300 seconds. I think this may be where it is aborting.
Seeing as you already have a tclsh script running on your device, you can include the configuration adjustments in that script by using the ios_config command in tclsh.
ios_config "no cns trusted-server all-agents prime.example.com"
ios_config "no cns trusted-server all-agents prime"
ios_config "no cns trusted-server all-agents 10.0.101.1"
ios_config "no cns id hardware-serial"
ios_config "no cns id hardware-serial event"
ios_config "no cns id hardware-serial image"
ios_config "no cns event prime-infra 11013 keepalive 120 2 reconnect-time 10"
ios_config "no cns config partial 10.0.101.1 80"
ios_config "no cns exec 80"
ios_config "no cns image server http://10.0.101.1/cns/HttpMsgDispatcher status http://10.0.101.1/cns/HttpMsgDispatcher"
ios_config "no ip host prime.example.com 10.0.101.1"
ios_config "no ip host prime10.0.101.1"
ios_config "interface g0/1"\
"no ip add"\
"shut"\
"end"
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