cURL / Mailing Lists / curl-users / Single Mail

curl-users

Obtaining configuration files with CURL

From: R. Roberto Quirarte C <rquirarte_at_megared.net.mx>
Date: 04 Apr 2003 10:52:39 -0600

Hi,

Im using CURL (telnet) to connect with some machines and obtain some
configuration files, and doing an historic of the changes.

With some hardware (especially CISCOs) I have to connect first to
another machine and then jump to the CISCO, then I use a line like this:

  cisco.sh $ipcisco | /usr/local/bin/curl --connect-timeout 120
--max-time 540 telnet://$equipA > confcisco_$city.$ipcisco.$date

in the cisco.sh file I have the login and password of equipA and the
login, password and the instructions to obtain the configuration of the
cisco.

Something like this (cisco.sh)

direccion=$1
echo
echo "loginequipA"
echo "passwdequipA"
echo
echo "telnet $direccion"
echo
echo "logincisco"
echo "passwdcisco"
echo "terminal length 0"
echo "show run"
echo
sleep 2
echo "exit"
echo
sleep 4
echo
echo "exit"
echo
echo

I have 2 kind of problems doing this

1.- Sometimes, it connect correct to the equipA but send the other
instructions "to fast" and it can't connect to the cisco. (That's why I
had to use some sleeps)

2.- Sometimes, it connect good to both but obtains like 16KB of
configuration and stops there for some minutes (like 6 or 7) and then
continues... Thats weird because if you do it manually you have an
inmediatly response with a show run command...

These are some examples, because I have to do this with a lot of
diferent hardware and versions of software. If you have any idea to do
this in a better way or how to resolve the problems I have please let me
know.

(If this is not the correct list to send this kind of questions please
send me to the rigth one)

Thanks a lot

R. Roberto Quirarte C.

-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb:
Dedicated Hosting for just $79/mo with 500 GB of bandwidth!
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
Received on 2003-04-04