LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-22-2017, 03:47 AM   #1
mokan
LQ Newbie
 
Registered: Jun 2017
Posts: 2

Rep: Reputation: Disabled
Post TeraTerm


Hi there to any teraterm users im an intern and very new to his software. I need to get the file size of the log through command?? Any guidance and between does anyone have any idea when my macro run for router the logs collected are not complete and differ length from few testings. Mind a sharing if why this happens?
 
Old 06-22-2017, 04:04 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,759

Rep: Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563
I don't really understand what do you really need. How is it related to TeraTerm at all?
can you please give us more details, examples....
 
Old 06-22-2017, 04:08 AM   #3
mokan
LQ Newbie
 
Registered: Jun 2017
Posts: 2

Original Poster
Rep: Reputation: Disabled
Macro

Quote:
; ***Macro Template to collect Router log****************

; Get current directory
getdir curdir
groupmatchstr1=curdir
groupmatchstr2="\Logs"
strjoin strvar "" 2
changedir strvar
setdir strvar

CommandPrompt = '#'
inputbox 'Please enter ZoneID:' 'Zone ID'
ZoneID = inputstr
;inputbox 'Please enter SiteID:' 'Site ID'
;SiteID = inputstr
SiteID = ''
inputbox 'Please enter Router name with Router ID:' 'Router Name'
RouterName = inputstr
toupper RouterName RouterName

groupmatchstr1=ZoneID
groupmatchstr2=SiteID
groupmatchstr3=RouterName
groupmatchstr4=".log"
strjoin logfile "" 4
;logfile=strvar

groupmatchstr1= logfile
groupmatchstr2= ".tmp"
strjoin tmp_file "" 2
;tmp_file = strvar

;start logging
logopen logfile 0 0
gettime curtime "------------------------------------%Y-%m-%d %H:%M:%S----------------------------------"
logwrite curtime

;setsync 0

sendln

wait CommandPrompt
sendln 'set terminal length 0'

wait CommandPrompt
sendln 'set sl=n'

wait CommandPrompt
flushrecv
sendln 'sh date'

wait CommandPrompt
flushrecv
sendln 'sh timezone'

wait CommandPrompt
flushrecv
sendln 'sh ' 'sysinfo'

wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'ip allroute'

mpause 500
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'ntp status'

wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'sys sm'

mpause 500
wait CommandPrompt
flushrecv
sendln 'sh version'

wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'sys soft a:/primary/boot.ppc'

wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'sys soft a:/secondar/boot.ppc'

wait CommandPrompt
flushrecv
sendln 'sf 9'

wait 'Press Y to clear boot statistics (any other key to cancel) :'
flushrecv
sendln ''

; to add cat partial dump and audit log

; Go to Audit log folder
wait CommandPrompt
flushrecv
sendln 'cd ' "a:/audlog"

; List to see audit log file name
wait CommandPrompt
flushrecv
sendln 'df'
pause 1

; parse audit log file name
strdim aud_tmp 999
i=0
filecopy logfile tmp_file
fileopen fhandle tmp_file 0
while 1
filereadln fhandle line
if result=1 then
break
endif
;messagebox line 'temp.log'
strscan line 'AUD'
if result > 0 then
strcopy line 1 6 aud_tmp[i]
;messagebox aud_tmp[i] 'audlog'
i=i+1
result=0
endif
endwhile
fileclose fhandle
filedelete tmp_file

; Cat audit log
groupmatchstr1="cat "
groupmatchstr3=".log"
j=0
strdim aud 999
if i>0 then
for j 0 i-1
groupmatchstr2=aud_tmp[j]
strjoin aud[j] "" 3
sendln aud[j]
pause 1
next
endif

wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'audit locallog'

pause 1
wait CommandPrompt
flushrecv
sendln 'cd a:/'

; Cat Partial Dump 1
wait CommandPrompt
flushrecv
sendln 'cat ' 'partial1.dmp'

; Cat Partial Dump 2
pause 2
wait CommandPrompt
flushrecv
sendln 'cat ' 'partial2.dmp'

; Cat Partial Dump 3
pause 2
wait CommandPrompt
flushrecv
sendln 'cat ' 'partial3.dmp'

pause 2
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'ip netaddr'

pause 5
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'ip addr'

pause 10
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'sys stat ' '-' 'port'

mpause 500
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'sys stat ' '-' 'path'

mpause 500
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'path config'

mpause 500
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'po conf'

mpause 500
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'po queuepri'

mpause 500
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'po QueueStatistics'

mpause 500
wait CommandPrompt
flushrecv
sendln 'su ' 'mu'

mpause 500
wait CommandPrompt
flushrecv
sendln 'su ' 'drt'

mpause 500
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'pa ma'

mpause 500
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'ccgw conf'

mpause 500
wait CommandPrompt
flushrecv
sendln 'cd ' 'a:/primary'

wait CommandPrompt
sendln 'cat config.log'

pause 5
wait CommandPrompt
flushrecv
sendln 'cat capture.cfg'

pause 5
wait CommandPrompt
flushrecv
sendln 'cat boot.cfg'

pause 5
wait CommandPrompt
flushrecv
sendln 'cat staticrp.cfg'

mpause 300
wait CommandPrompt
flushrecv
sendln 'cat xgsn.cfg'

wait CommandPrompt
flushrecv
sendln 'cd ' 'a:/secondar'

wait CommandPrompt
flushrecv
sendln 'cat config.log'

pause 5
wait CommandPrompt
flushrecv
sendln 'cat capture.cfg'

pause 5
wait CommandPrompt
flushrecv
sendln 'cat boot.cfg'

pause 5
wait CommandPrompt
flushrecv
sendln 'cat staticrp.cfg'

mpause 300
wait CommandPrompt
flushrecv
sendln 'cat xgsn.cfg'

mpause 300
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'vrrp conf'

pause 1
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'NAT conf'

pause 1
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'NAT sessions'

pause 1
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'pim conf'

pause 1
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'pim mcastgrouplim'

pause 1
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'pim mcastgrouplimrp'

pause 1
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'pim rps'

pause 1
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'pim rt'

pause 2
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'pim rt long'

pause 1
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'pim staticrp'

pause 1
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'pim staticrp summary'

pause 1
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'pim neigh'

mpause 500
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'mip igmp'

mpause 500
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'mip fc'

pause 2
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'mip vrrp'

pause 1
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'mip rpf 10.1.253.9'

mpause 300
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'mip rpf 10.1.253.17'

mpause 300
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'fr dlcistat'

pause 1
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'ospf ns'

pause 1
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'pa connst'

pause 1
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'fr mfrdispstat'

pause 1
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'fr QueueStatistics'

mpause 1
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'cwr status'

mpause 300
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'cwr conf'

mpause 300
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'pa WanCounters'

pause 1
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'pa conncounters'

pause 1
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'fr MfrAvcQueS'

pause 1
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'fr VcQueStats 16'

pause 5
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'fr VcQueStats 17'

pause 5
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'sys stat ' '-' 'fr'

pause 5
wait CommandPrompt
flushrecv
sendln 'sh lmi'

mpause 5
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'ip bfds'

mpause 5
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'SCH bfdevent'

pause 5
wait CommandPrompt
flushrecv
sendln 'sh ' '-' 'ipdv STAT

pause 5
wait CommandPrompt
sendln 'exit'

logclose
Above is the macro i run to collect logs from router through tera term. When i check through the logs is not complete it stops halfway.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to install Teraterm on linux(ubuntu)? korlid.dt Linux - Software 21 12-24-2019 02:58 AM
teraTerm of linux giantpanda77 Linux - Software 3 11-10-2009 10:59 PM
Special Keys Non-Functional via TeraTerm Ruler2112 *BSD 4 05-08-2009 11:33 AM
Teraterm , securecrt , in linux ??? rpmf53 Linux - Software 4 05-28-2003 05:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration