Update problem
Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Update problem
PostPosted: Tue Apr 28, 2009 6:08 am 
Offline
Newbie

Joined: Thu Apr 23, 2009 3:09 am
Posts: 7
Hello Again!

Due to my damn curiosity i've upgraded TTerm to the latest version.
Unfortunately now the script i managed to get running are not working anymore.
There's always this message "Link Macro First"...
Anyone got suggestions?Is there any documentation for this? Any help would be appreciated!

thanks in advance

Alessio


Top
 Profile E-mail  
 
 Post subject: Re: Update problem
PostPosted: Tue Apr 28, 2009 6:20 am 
Offline
Guru

Joined: Wed Jan 25, 2006 7:28 pm
Posts: 532
Location: Denver, Colorado, USA
"Link Macro First" means the script is trying to perform some command that needs communication with a serial, telnet, or ssh port such as sendln or recvln, and that such an open connection is not there.

It would help if you posted your script.


Top
 Profile  
 
 Post subject: Re: Update problem
PostPosted: Tue Apr 28, 2009 7:03 am 
Offline
Newbie

Joined: Thu Apr 23, 2009 3:09 am
Posts: 7
Ishmael first of all thank you so much for your time and efforts!
Below you'll find my script, please feel free to comment and to point me where i'm doing wrong
any comments on how to improve are appreciated!
thank you again!

Alessio

P.S. is your nick remotely connected with a David Gerrold Book?


  1. ;°°°°°°°°°°°°°°° Conf Parameters °°°°°°°°°°°°°
  2.  
  3. username='XXXXX' ; username for connection
  4. password='YYYYYY' ; password for connection
  5. ip_address='IP_TEST.txt'; file with ip addresses of the routers to analyze
  6. timeout=5; timeout
  7. Sedi='indirizzi.txt'; file containing results
  8.  
  9.  
  10. ;°°°°°°°°°°°°°°°° APERTURA FILE CONTENENTE IP °°°°°°°°°
  11. ; Opening file with addresses
  12.  
  13.     fileopen fhandle Ip_address 0
  14.     filecreate fh Sedi
  15.    
  16. ;°°°°°°°°°°°°°°°° INIZIO LOOP °°°°°°°°°°°°°°°°°°°°°°°°
  17. ; Initial Loop
  18.  
  19.     :loop
  20.         filereadln fhandle ip_address
  21.         if result goto fine
  22.         flushrecv
  23.  
  24. ;°°°°°°°°°°°°°°°° CONNESSIONE °°°°°°°°°°°°°°°°°°°°°°°°°
  25. ; TT connects to one of the addresses in the list specified above
  26.    
  27.      connect ip_address
  28.  
  29. ;°°°°°°°°°°°°°°°° INVIO USERNAME °°°°°°°°°°°°°°°°°°°°°°
  30. ; Routine for sending username to host
  31.  
  32.     wait 'Username:'
  33.        if result=0 then
  34.         space = '_'
  35.         strconcat Ip_address space
  36.         strconcat Ip_address 'non connessa'
  37.         filewriteln fh ip_address
  38.             goto prossimo
  39.        endif
  40.         sendln username
  41.  
  42. ;°°°°°°°°°°°°°°°° INVIO PASSWORD °°°°°°°°°°°°°°°°°°°°°°
  43. ; Routine for sending password to host
  44.  
  45.     wait 'Password:'
  46.        if result=0 then
  47.         space = '_'
  48.         strconcat Ip_address space
  49.         strconcat Ip_address 'Tacacs non funzionante'
  50.         filewriteln fh ip_address
  51.         goto prossimo
  52.        endif
  53.        setsync 1
  54.     sendln password
  55.        setsync 0
  56.    
  57. ;°°°°°°°°°°°°°°°° CONTROLLO LINEA BGP °°°°°°°°°°°°°°°°°°°°°°
  58. ; TT sends commands for checking BGP links
  59. ;°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
  60.  
  61.  
  62.        flushrecv                       ;ensure nothing is in the buffer
  63.        sendln 'terminal length 0'  
  64.        sendln 'sh bgp a s'
  65.             for i 1 16
  66.             recvln           ;skip past technobabble
  67.                next
  68.                recvln
  69.                filewriteln fh inputstr  ;now save two relevant lines in a file
  70.                recvln
  71.                filewriteln fh inputstr
  72.         goto prox
  73.  
  74. ;°°°°°°°°°°°°°°°° DISCONNESSIONE  con HOST °°°°°°°°°°°°°°°°
  75. ; Disconnect from the host
  76.  
  77.     sendln 'exit'
  78.  
  79. ;°°°°°°°°°°°°°°°°     LOOP     °°°°°°°°°°°°°°°°°°°°°°°°°°°°
  80. ;Loop Procedure
  81.  
  82.     :prox
  83.         pause 1
  84.         disconnect
  85.         closett
  86.         goto loop
  87.  
  88. ;°°°°°°°°°°°°°°°°° FINE PROGRAMMA °°°°°°°°°°°°°°°°°°°°°°
  89. ; Close TT after ll IP have been processed
  90.  
  91.     :end
  92.         fileclose fhandle
  93.         end
  94.  


Top
 Profile E-mail  
 
 Post subject: Re: Update problem
PostPosted: Tue Apr 28, 2009 7:16 am 
Offline
Moderator, LogMeTT developer
User avatar

Joined: Sat Jan 08, 2005 7:52 am
Posts: 1140
Location: Seattle, WA, USA
Alessio et al:

Please use "Code" option in your posts to improve macro readability.

_________________
Thanks.
Best regards,
// Boris


Top
 Profile E-mail  
 
 Post subject: Re: Update problem
PostPosted: Tue Apr 28, 2009 7:28 am 
Offline
Newbie

Joined: Thu Apr 23, 2009 3:09 am
Posts: 7
Boris,

Sorry for that, i'll use the Code option from now on;)
Thanks!

Alessio


Top
 Profile E-mail  
 
 Post subject: Re: Update problem
PostPosted: Wed Apr 29, 2009 7:49 am 
Offline
Guru

Joined: Wed Jan 25, 2006 7:28 pm
Posts: 532
Location: Denver, Colorado, USA
I would put in a testlink after your connect to make sure the connect worked. I think you might be having another issue related to perhaps your hardware or network setup that is not allowing you to connect.

As a suggestion, do a minor rewrite to get rid of all GOTO statements. They were unavoidable in TeraTERM 2.3, but the latest version has more than enough types of flow control statements to avoid them completely. This will save you much grief in the long run, trust me. Also, it would be easier to read if you only indented loops and if statement bodys.

Think Herman Melville instead of David Gerrold. Rather pretentious literary reference from my younger days that has somehow stuck.


Top
 Profile  
 
 Post subject: Re: Update problem
PostPosted: Mon May 04, 2009 5:11 am 
Offline
Newbie

Joined: Thu Apr 23, 2009 3:09 am
Posts: 7
Hello!

Ishmael Thank you for your help, i've been thinking about where the "Link Macro First" error could have been generated.
Finally i got the answer.
In the initial part of the code i pretended to use a list of addresses to connect to for getting info concerning the BGP link.
I've done some testing and it appears that if i just use a single IP address everything works.
Now i have to find a way to connect to multiple addresses sequentially in a loop;)
Thanks again for your precious help!

Regards Alessio

P.S. Melville, yep now i recall it, very well hidden and almost forgotten in a black box somewhere in my mind :wink:


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group