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

exec "show archive conf diff file1 file2" not triggering within a tcl

David Reynolds
Level 1
Level 1

I have an issue that is frustrating me to no end.

When I issue the command

RTR(tcl)#exec "show archive config diff file1 file2"

 it works like a champ.

 

However when that same command is called at the end of a longer tcl script it is simply ignored.

 

Afterwards I can again run the command from RTR(tcl)# 

and again it works like a champ.

 

Any suggestions?  Reasons?  Workarounds?

1 Accepted Solution

Accepted Solutions

So it's the stupid small things that end up the most frustrating.

 

The answer was to simply add "puts" to the beginning of the line.  Apparently TCL was running the command but since I didn't ask it to provide an output......it appeared to me to not be working.

 

Bottom line:  drink more coffee and open eyes for a change.

 

Thanks all.

View solution in original post

2 Replies 2

David Reynolds
Level 1
Level 1

Here is the script that the exec for diff at the end is not functional.

NOTE the delete exec is functional.

 

I've read that the diff may fail if there is a lack of memory available, could this be the case?

 

puts [open "flash:test.tcl" w+] {
puts "Enter correct device hostname, for device being graded:"
set graded_device [gets stdin]
# START DEVICE OPTION R1
if {$graded_device =="R1"} {
puts "Running Checks on Device R1."
puts " "
# exec "copy run flash:/R1_candidate_config"
set correct_config {
!
!
version 12.4
service timestamps debug datetime
service timestamps log datetime localtime
service password-encryption
!
hostname RTR
!
boot-start-marker
boot system flash:/c1841-adventerprisek9-mz.124-22.T5.bin
warm-reboot
boot-end-marker
!
logging message-counter syslog
logging buffered 65535
!
aaa new-model
!
!
aaa authentication login default local
aaa authorization exec default local
aaa authorization commands 15 default local if-authenticated
!
!
aaa session-id common
clock timezone EST -5
clock summer-time EST recurring
dot11 syslog
no ip source-route
!
!
!
!
ip cef
no ip bootp server
multilink bundle-name authenticated
!
!
!
!
!
!
!
ip ssh maxstartups 2
ip ssh version 2
ip scp server enable
!
!
!
interface FastEthernet0/0
ip address 192.168.155.1 255.255.255.254
ip ospf network point-to-point
ip ospf 1 area 0
speed auto
half-duplex
!
interface FastEthernet0/1
ip address 10.10.20.1 255.255.255.252
duplex auto
speed auto
!
router ospf 1
log-adjacency-changes
default-information originate always
!
ip forward-protocol nd
no ip http server
ip http access-class 1
ip http authentication local
no ip http secure-server
ip http timeout-policy idle 60 life 86400 requests 10000
!
!
!
snmp-server engineID local 0123456789
snmp-server group HOME_GRP v3 priv match exact
snmp-server ifindex persist
!
!
!
!
!
!
control-plane
!
!
!
line con 0
exec-timeout 15 0
logging synchronous
line aux 0
exec-timeout 0 1
no exec
transport output none
line vty 0 4
exec-timeout 0 0
logging synchronous
transport input ssh
line vty 5 807
exec-timeout 0 0
logging synchronous
transport input none
!
scheduler allocate 20000 1000
ntp master
ntp update-calendar
ntp server 128.138.140.44
ntp server 98.175.203.200
time-range DAY_TIME
periodic daily 7:30 to 20:30
!
}
}
set stdout [open flash:temp_correct w+]
puts $stdout $correct_config
close $stdout
exec "show archive conf diff flash:temp_correct system:running-config"
# CLEANUP
exec "delete flash:/temp_correct"
}

So it's the stupid small things that end up the most frustrating.

 

The answer was to simply add "puts" to the beginning of the line.  Apparently TCL was running the command but since I didn't ask it to provide an output......it appeared to me to not be working.

 

Bottom line:  drink more coffee and open eyes for a change.

 

Thanks all.

Getting Started

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:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco