【Junos】手動生成Core-dump文件

常規狀況下,當JUNOS進程異常或內核崩潰時,將自動生成一個Core-dump文件,有時故障排查的須要下,需手動的去生成一個Core-dump文件。node


以NSD進程手動生成Core-dump爲例:shell

{primary:node0}ide

root@vsrx-a> show system processes extensive | match nsdspa

Mar 06 01:57:59debug

8128 root        1  76    0 14416K  9464K select 0   0:00  0.00% nsd日誌

NSD的進程ID是8128, 當前防火牆沒有任何的Core-dump文件:router

{primary:node0}blog

root@vsrx-a> show system core-dumps接口

Mar 06 01:58:45進程

node0:

--------------------------------------------------------------------------

/var/crash/*core*: No such file or directory

/var/tmp/*core*: No such file or directory

/var/tmp/pics/*core*: No such file or directory

/var/crash/kernel.*: No such file or directory

/tftpboot/corefiles/*core*: No such file or directory

現手動的爲NSD進程手動生成一個Core-dump文件,使用request命令生動產生Core-dump文件時,會致使nsd進程重啓。

{primary:node0}

root@vsrx-a> request system core-dump network-security node 0

{primary:node0}

root@vsrx-a> show system processes extensive | match nsd

Mar 06 02:01:43

8471 root        1  76    0 14212K  8652K select 0   0:00  0.00% nsd

{primary:node0}

root@vsrx-a> show system core-dumps

Mar 06 02:01:46

node0:

--------------------------------------------------------------------------

/var/crash/*core*: No such file or directory

-rw-rw----  1 root  wheel     304987 Mar 6  02:01 /var/tmp/nsd.core-tarball.0.tgz

/var/tmp/pics/*core*: No such file or directory

/var/crash/kernel.*: No such file or directory

/tftpboot/corefiles/*core*: No such file or directory

total files: 1

如下方法爲不重啓NSD的狀況下,生成一個Core-dump信息:

{primary:node0}

root@vsrx-a> show system processes extensive | match nsd

Mar 06 02:03:34

8471 root        1  76    0 14212K  8652K select 0   0:00  0.00% nsd

{primary:node0}

root@vsrx-a> start shell

root@vsrx-a% gcore -s -c /var/tmp/nsd.core.8471 8471

root@vsrx-a% cli

{primary:node0}

root@vsrx-a> show system core-dumps

node0:

--------------------------------------------------------------------------

/var/crash/*core*: No such file or directory

-rw-rw----  1 root  wheel     304987 Mar 6  02:01 /var/tmp/nsd.core-tarball.0.tgz

-rw-r--r--  1 root  wheel    5758976 Mar 6  02:04 /var/tmp/nsd.core.8471

/var/tmp/pics/*core*: No such file or directory

/var/crash/kernel.*: No such file or directory

/tftpboot/corefiles/*core*: No such file or directory

total files: 2

{primary:node0}

root@vsrx-a> show system processes extensive | match nsd

8471 root        1  76    0 14212K  9288K select 0   0:00  0.00% nsd

生成一個內核的core-dump (RE將會重啓)

root@vsrx-a% sysctl -w debug.kdb.panic=1

debug.kdb.panic: 0

sysctl: debug.kdb.panic: Operation not permitted

root@vsrx-a%

Note:真機可能會能夠使用

或者如下方式:

set system debugger-on-break

then

router>edit

router#

ctrl ]

telnet>send brk

db> panic

在線生成一個Kernel Core-dump信息,而不重啓RE

root@lab-16% sysctl -w kern.live_core_dump=1

kern.live_core_dump: 0 -> 1

FPC/IQ2/MS-PIC/上生成一個Core-dump信息(CPU將會重啓)

VMX(vmx16 vty)# set parser security 10

Security level set to 10

VMX(vmx16 vty)# test panic

The semaphore timeout period has expired.

Press Ctrl+C to cancel or Enter to reconnect immediately.

Reconnecting in 1 seconds

1556093986.png

這樣將會致使FPC板卡Offline,須要手工的Online一把後,板卡Online了,可是沒法與原先板卡上的接口互通,後嘗試重試Vmx後,能夠正常通訊。

能夠不用重啓CPU的方式,但Services PIC可能會Restart。

Note: 如下命令可能真機板卡支持,當前全部手工產生Core-dump的命令,慎用

VMX(lab-16 vty)# wr coredump

^

Syntax error at `wr'.

VMX(lab-16 vty)# write coredump

^

Syntax error at `write'.

設備上查看小的Core-dump日誌分析信息,使用如下命令:

root@lab-16> show system core-dumps core-file-info /var/tmp/vmxt.core.0.gz detail

1556094013.png

相關文章
相關標籤/搜索