request system debug-info
语法
request system debug-info <node node-name>
语法(Junos EVO 设备)
request system debug-info <mode custom | lite | normal> <since duration> <node node-name>
描述
从 Junos OS 演化版收集调试信息,例如日志。日志存储在 / var/tmp/ 目录中。调试收集器收集核心、应用程序跟踪、配置、提交等。它还收集来自 CLI 和 CLI-PFE 命令的输出。您需要以 root 用户身份登录到设备才能使用此命令。输入 root 密码并在请求时进行确认。
选项
node node-name |
(可选)节点的标识符。如果给定了 (例如, , , |
mode |
|
since |
指定日志持续时间。支持的格式为 yyyy-mm-dd 或 #d(例如:2d)或 #h(例如:5h)。默认情况下,您可以收集持续时间为 90 天的日志。 |
其他信息
调试收集器在收集日志和跟踪时花费的时间最长。您可以使用命令从 request system debug-info
/ var/tmp 快速调试收集,示例格式如下:
-
request system debug-info node re0,fpc0,fpc1,fpc2 since 1h
—正常模式,从主 RE 和所有 FPC 收集的日志和跟踪日志最少。 -
request system debug-info node re1 since 1h
- 正常模式,仅从备份 RE 收集最少的日志和跟踪日志。 -
request system debug-info mode lite node re0,fpc0,fpc1,fpc2 since 1h
— 精简模式,从主 RE 和所有 FPC 收集的日志和跟踪日志最少。 -
request system debug-info mode lite node re1 since 1h
- 精简模式,仅从备份 RE 收集最少的日志和跟踪日志。
要查看 debug_collector.log 文件,请执行以下操作:
-
转到 / var/tmp/ 目录。
root@host:~# cd /var/tmp root@host:/var/tmp# ls debug_collector_2017-11-20_13_16_45.tar.gz
-
解压缩 / var/tmp/ 文件。
root@host:/var/tmp# tar -xf debug_collector_2017-11-20_13_16_45.tar.gz root@host:/var/tmp# ls debug_collector_2017-11-20_13_16_45 debug_collector_2017-11-20_13_16_45.tar.gz
-
转到 / var/tmp/debug_collector_timestamp 目录。
root@host:/var/tmp# cd debug_collector_2017-11-20_13_16_45 root@host:/var/tmp/debug_collector_2017-11-20_13_16_45# ls debug_collector.log re0 re1 fpc0
-
查看日志文件。
root@host:/var/tmp/debug_collector_2017-11-20_13_16_45# cat debug_collector.log 2017-11-20 13:16:45 INFO: debug_collector.py:704 <module>(): Running debug_collector as user 'root' with super user privileges... 2017-11-20 13:16:45 INFO: debug_collector.py:705 <module>(): You can monitor detailed progress using: 2017-11-20 13:16:45 INFO: debug_collector.py:706 <module>(): tail -f /var/tmp/debug_collector_2017-11-20_13_16_45/debug_collector.log 2017-11-20 13:16:45 INFO: debug_collector.py:323 fetch_root_pswd(): Debug collector needs to login into all nodes in the system as root user 2017-11-20 13:25:31 DEBUG: debug_collector.py:332 fetch_root_pswd(): Passwords matched, proceeding with debug collection... 2017-11-20 13:25:31 INFO: debug_collector.py:225 detect_res(): Detecting REs in the system... 2017-11-20 13:25:31 DEBUG: debug_collector.py:239 detect_res(): Into for 2017-11-20 13:25:31 DEBUG: debug_collector.py:242 detect_res(): Into m1 not None 2017-11-20 13:25:31 DEBUG: debug_collector.py:245 detect_res(): Found RE 're0' in /etc/hosts 2017-11-20 13:25:31 DEBUG: debug_collector.py:248 detect_res(): Into if 1 2017-11-20 13:25:31 DEBUG: debug_collector.py:239 detect_res(): Into for 2017-11-20 13:25:31 DEBUG: debug_collector.py:242 detect_res(): Into m1 not None 2017-11-20 13:25:31 DEBUG: debug_collector.py:245 detect_res(): Found RE 're1' in /etc/hosts 2017-11-20 13:25:31 DEBUG: debug_collector.py:261 detect_res(): Into if 4 2017-11-20 13:25:31 INFO: debug_collector.py:265 detect_res(): This RE is 're0' 2017-11-20 13:25:31 DEBUG: debug_collector.py:266 detect_res(): This RE is 're0' and the other RE is 're1' 2017-11-20 13:25:32 DEBUG: debug_collector.py:269 detect_res(): Other RE 're1' is reachable 2017-11-20 13:25:32 INFO: debug_collector.py:274 detect_res(): List of reachable REs: ['re0', 're1'] 2017-11-20 13:25:32 INFO: debug_collector.py:293 detect_fpcs(): Detecting FPCs in the system, might take upto a couple of minutes... 2017-11-20 13:25:33 DEBUG: debug_collector.py:309 detect_fpcs(): FPC 'fpc0' is reachable 2017-11-20 13:25:36 DEBUG: debug_collector.py:312 detect_fpcs(): FPC 'fpc1' is not reachable 2017-11-20 13:25:39 DEBUG: debug_collector.py:312 detect_fpcs(): FPC 'fpc2' is not reachable 2017-11-20 13:25:40 INFO: debug_collector.py:977 <module>(): User interrupt detected, stopping further debug collection... 2017-11-20 13:25:40 INFO: debug_collector.py:372 create_final_archive(): Creating archive of all logs collected...
所需权限级别
视图
示例输出
请求系统调试信息
root@host> request system debug-info 2017-11-20 13:16:45 INFO: debug_collector.py:704 <module>(): Running debug_collector as user 'root' with super user privileges... 2017-11-20 13:16:45 INFO: debug_collector.py:705 <module>(): You can monitor detailed progress using: 2017-11-20 13:16:45 INFO: debug_collector.py:706 <module>(): tail -f /var/tmp/debug_collector_2017-11-20_13_16_45/debug_collector.log 2017-11-20 13:16:45 INFO: debug_collector.py:323 fetch_root_pswd(): Debug collector needs to login into all nodes in the system as root user Please enter root password: Please re-enter the password: 2017-11-20 13:25:31 INFO: debug_collector.py:225 detect_res(): Detecting REs in the system... 2017-11-20 13:25:31 INFO: debug_collector.py:265 detect_res(): This RE is 're0' 2017-11-20 13:25:32 INFO: debug_collector.py:274 detect_res(): List of reachable REs: ['re0', 're1'] 2017-11-20 13:25:32 INFO: debug_collector.py:293 detect_fpcs(): Detecting FPCs in the system, might take upto a couple of minutes... ^C2017-11-20 13:25:40 INFO: debug_collector.py:977 <module>(): User interrupt detected, stopping further debug collection... 2017-11-20 13:25:40 INFO: debug_collector.py:372 create_final_archive(): Creating archive of all logs collected... 2017-11-20 13:25:40 INFO: debug_collector.py:380 create_final_archive(): Here it is: /var/tmp/debug_collector_2017-11-20_13_16_45.tar.gz 2017-11-20 13:25:40 INFO: debug_collector.py:389 create_final_archive(): Debug collector run time: 0h 8m 54s 2017-11-20 13:25:40 INFO: debug_collector.py:401 cleanup_and_exit(): Over n out!
发布信息
在 Junos OS 演化版 18.3R1 中引入的命令。