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’

※↑コピーすると ‘ が大文字になってしまうので、注意です。

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny