teraterm マクロ 完成系


CISCO機器への自動ログインマクロとなります。

TELNET版
connect ‘192.168.3.202:23 /nossh’
wait ‘>’
sendln ‘enable’
wait ‘Password:’
sendln ‘cisco’
gettime timestr ‘%Y%m%d_%H%M-%S’
sprintf2 filename ‘c:\abc\%s.txt’ timestr
logopen filename 0 0
wait ‘#’
sendln ‘ter len 0’
wait ‘#’
sendln ‘show run’
wait ‘#’
sendln ‘show version’
SSH版
connect ‘192.168.3.202:22 /ssh /2 /auth=password /user=admin1 /passwd=cisco1’
wait ‘>’
sendln ‘enable’
wait ‘Password:’
sendln ‘cisco’
gettime timestr ‘%Y%m%d_%H%M-%S’
sprintf2 filename ‘c:\abc\%s.txt’ timestr
logopen filename 0 0
wait ‘#’
sendln ‘ter len 0’
wait ‘#’
sendln ‘show run’
wait ‘#’
sendln ‘show version’
console版
connect ‘/C=4’
gettime timestr ‘%Y%m%d_%H%M-%S’
sprintf2 filename ‘c:\abc\%s.txt’ timestr
logopen filename 0 0
sendln ‘ter len 0’
wait ‘#’
sendln ‘show run’
wait ‘#’
sendln ‘show version’