Junos でのログ取得のやり方を毎回、メールを漁って探している気がするのでメモしておくことに。
RSI (request support information) の取得
1 | sponge@bob> request support information | save /var/tmp/rsi.txt |
/var/log
の取得
1 2 | sponge@bob> file archive compress source /var/log/* destination /var/tmp/log.tgz tar: Removing leading '/' from member names |
ルータ系(Routing Engine 冗長)での
/var/log
の取得
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | {master} sponge@bob> file archive compress source /var/log/* destination /var/tmp/re0_log.tgz tar: Removing leading '/' from member names {master} sponge@bob> request routing-engine login backup Last login: Wed Oct 10 10:52:11 on ttyu0 --- JUNOS 18.1R1.9 Kernel 64-bit JNPR-11.0-20180308.0604c57_buil {backup} sponge@bob> file archive compress source /var/log/* destination /var/tmp/re1_log.tgz {backup} sponge@bob> exit rlogin: connection closed {master} sponge@bob> file copy re1:/var/tmp/re1_log.tgz /var/tmp |
コマンドだけ抜き出し
1 2 3 4 5 | file archive compress source /var/log/* destination /var/tmp/re0_log.tgz request routing-engine login backup file archive compress source /var/log/* destination /var/tmp/re1_log.tgz exit file copy re1:/var/tmp/re1_log.tgz /var/tmp/ |
スイッチ系 (Virtual Chassis) での
/var/log
の取得
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | {master:0} sponge@bob> file archive compress source /var/log/* destination /var/tmp/fpc0_log.tgz tar: Removing leading '/' from member names {master:0} sponge@bob> request session member 1 --- JUNOS 18.1R3-S6.1 Kernel 64-bit JNPR-11.0-20190316.df99236_buil {backup:1} sponge@bob> file archive compress source /var/log/* destination /var/tmp/fpc1_log.tgz tar: Removing leading '/' from member names {backup:1} sponge@bob> exit rlogin: connection closed {master:0} sponge@bob> file copy fpc1:/var/tmp/fpc1_log.tgz /var/tmp/ |
コマンドだけ抜き出し
1 2 3 4 5 | file archive compress source /var/log/* destination /var/tmp/fpc0_log.tgz request session member 1 file archive compress source /var/log/* destination /var/tmp/fpc1_log.tgz exit file copy fpc1:/var/tmp/fpc1_log.tgz /var/tmp/ |
なお、shell @ fpc0 から fpc1 に入る場合は下記を実行すればよい。
1 2 3 4 5 6 7 | % rlogin -Ji fpc1 Last login: Fri Mar 20 02:26:48 from master --- JUNOS 18.1R3-S6.1 Kernel 64-bit JNPR-11.0-20190316.df99236_buil {backup:1} sponge@bob> |
SRX (Chassis Cluster) での
/var/log
の取得
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | {primary:node0} sponge@bob> file archive compress source /var/log/* destination /var/tmp/node0_log.tgz tar: Removing leading '/' from member names {primary:node0} sponge@bob> request routing-engine login node 1 --- JUNOS 18.4R3.3 Kernel 64-bit JNPR-11.0-20191211.fa5e90e_buil {secondary:node1} sponge@bob> file archive compress source /var/log/* destination /var/tmp/node1_log.tgz tar: Removing leading '/' from member names {secondary:node1} sponge@bob> exit rlogin: connection closed {primary:node0} sponge@bob> file copy node1:/var/tmp/node1.log.tgz /var/tmp/ |
コマンドだけ抜き出し
1 2 3 4 5 | file archive compress source /var/log/* destination /var/tmp/node0_log.tgz request routing-engine login node 1 file archive compress source /var/log/* destination /var/tmp/node1_log.tgz exit file copy node1:/var/tmp/node1.log.tgz /var/tmp/ |
なお、shell @ node0 から node1 に入る場合は下記を実行すればよい。
1 2 3 4 5 6 7 | % rlogin -T node1 Last login: Fri Mar 20 02:59:31 from 129.16.0.1 --- JUNOS 18.4R3.3 Kernel 64-bit JNPR-11.0-20191211.fa5e90e_buil {secondary:node1} sponge@bob> |
作ったファイルができているかの確認
1 | sponge@bob> file list /var/tmp/ |
ファイルができていれば、あとは scp や tftp でアップロードすれば大丈夫です。
No comment yet, add your voice below!