Discussion:
[rancid] Trouble automating TFTP downloading using clogin
ML
2009-09-01 01:42:27 UTC
Permalink
I'm trying to script clogin to login to some switches and pull an IOS
image via tftp.

clogin -t 300 -c 'copy tftp://1.1.1.1/file.bin flash:' 2.2.2.2

I see the copy command appear to execute on the remote switch but the
operation ever starts. I verified with remote tftp server that not a
single packet ever reaches it. There is essentially zero output during
the vty session after the copy starts. I can successfully execute other
commands, just not 'copy'.


What could be happening?
Ryan West
2009-09-01 01:58:07 UTC
Permalink
ML,

Looks like you're missing carriage returns. Try creating a file with 3 carriage returns at the bottom, I recently upgraded a series of switches using the same method.

Clogin -x <file-with-commands> <rtr-name>

-ryan

-----Original Message-----
From: rancid-discuss-***@shrubbery.net [mailto:rancid-discuss-***@shrubbery.net] On Behalf Of ML
Sent: Monday, August 31, 2009 9:42 PM
To: rancid-***@shrubbery.net
Subject: [rancid] Trouble automating TFTP downloading using clogin

I'm trying to script clogin to login to some switches and pull an IOS
image via tftp.

clogin -t 300 -c 'copy tftp://1.1.1.1/file.bin flash:' 2.2.2.2

I see the copy command appear to execute on the remote switch but the
operation ever starts. I verified with remote tftp server that not a
single packet ever reaches it. There is essentially zero output during
the vty session after the copy starts. I can successfully execute other
commands, just not 'copy'.


What could be happening?
Mahaffey, Brian
2009-09-01 20:22:14 UTC
Permalink
I used Quotes " instead of ' and I saw the command execute, the issue I
see is that it doesn't prompt you to accept image destination name the
same way if you did it manually on the command line.

More tftp.sh
Clogin -c "copy tftp://10.10.15.11/c2800nm-adventerprisek9-mz.124-23.bin
flash:" SPAIN-C2811.PELCO.ORG


-bash-3.2$ ./tftp.sh
SPAIN-c2811.pelco.org
spawn ssh -c 3des -x -l user SPAIN-c2811.pelco.org
CCC

DO NOT LOGIN TO THIS DEVICE!

Password:

SPAIN-C2811#
SPAIN-C2811#terminal length 0
SPAIN-C2811#copy
tftp://10.200.2.11/c2800nm-adventerprisek9-mz.124-23.bin flash:

Error: TIMEOUT reached
-bash-3.2$



-----Original Message-----
From: rancid-discuss-***@shrubbery.net
[mailto:rancid-discuss-***@shrubbery.net] On Behalf Of ML
Sent: Monday, August 31, 2009 6:42 PM
To: rancid-***@shrubbery.net
Subject: [rancid] Trouble automating TFTP downloading using clogin

I'm trying to script clogin to login to some switches and pull an IOS
image via tftp.

clogin -t 300 -c 'copy tftp://1.1.1.1/file.bin flash:' 2.2.2.2

I see the copy command appear to execute on the remote switch but the
operation ever starts. I verified with remote tftp server that not a
single packet ever reaches it. There is essentially zero output during
the vty session after the copy starts. I can successfully execute other

commands, just not 'copy'.


What could be happening?


_______________________________________________
Rancid-discuss mailing list
Rancid-***@shrubbery.net
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss

- ------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this transmission is legally privileged and confidential, intended only for the use of the individual(s) or entities named above. This email and any files transmitted with it are the property of Pelco. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any review, disclosure, copying, distribution, retention, or any action taken or omitted to be taken in reliance on it is prohibited and may be unlawful. If you receive this communication in error, please notify us immediately by telephone call to +1-559-292-1981 or forward the e-mail to ***@pelco.com and then permanently delete the e-mail and destroy all soft and hard copies of the message and any attachments. Thank you for your cooperation.
- ------------------------------------------------------------------------------
David Croft
2009-09-01 21:25:57 UTC
Permalink
Your script may be stalling on a prompt. I use this script to turn off
file prompts before the copy:

clogin -c "conf t; file prompt quiet; exit; copy
scp://user:***@server/$script running-config; conf t; no file prompt
quiet" $router

David
Post by ML
I'm trying to script clogin to login to some switches and pull an IOS
image via tftp.
clogin -t 300 -c 'copy tftp://1.1.1.1/file.bin flash:' 2.2.2.2
I see the copy command appear to execute on the remote switch but the
operation ever starts.  I verified with remote tftp server that not a
single packet ever reaches it.  There is essentially zero output during
the vty session after the copy starts.  I can successfully execute other
commands, just not 'copy'.
What could be happening?
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
Loading...