0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Fortigateの設定をTeratermマクロで取得する

Posted at

1.ttlファイルをttmacro.exeに紐付けてください。

 みんなこのぐらいはできると思いますが、親切な方が画面を取ってくれていました。

2.次のようなttlファイルの中身で動きます。

username = 'fortinet'         ;任意で変更
hostname = '192.168.100.1'     ;任意で変更
userpasswd = 'fortipass'      ;任意で変更
portnum = '22'               ;任意で変更
prompt = 'fortigate-100E $'   ;任意で変更
logfile = 'c:\users\fortinet\documents\fortigate.log'  ;任意で変更

msg = hostname

strconcat msg ':portnum /ssh /auth=password /user='
strconcat msg username
strconcat msg ' /passwd='
strconcat msg userpasswd
strconcat msg inputstr

connect msg

wait prompt

logopen logfile 0 0 ;binaryとoverwrite
;0がtext, 1がbinary 0が上書き、1が追加

sendln 'show'

wait prompt

logclose

sendln 'exit'

いつも通り、あくまでサンプルなので、そのままコピペでは動きません。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?