系统日志
nv show system log
显示交换机上的当前系统日志配置。
版本历史
在 Cumulus Linux 5.12.0 中引入
示例
cumulus@switch:~$ nv show system log
operational
----------- -----------------
[file] syslog
[component] apt
[component] audit
[component] auth
[component] boot
[component] csmgr
[component] datapath
[component] dpkg
[component] ifupdown2
[component] installer
[component] mlag
[component] nginx
[component] nvue
[component] otlp-telemetry
[component] platform-phc
[component] platform-thermal
[component] pps
[component] ptm
[component] ptp
[component] ptp-firefly-servo
[component] routing
[component] stp
[component] synce
nv show system log component
显示生成日志的系统组件以及与每个组件关联的日志严重级别。
版本历史
在 Cumulus Linux 5.12.0 中引入
示例
cumulus@switch:~$ nv show system log component
Component Summary
----------------- -------
apt
audit
auth
boot
csmgr
datapath
dpkg
ifupdown2
installer
mlag
nginx
nvue
otlp-telemetry
platform-phc
platform-thermal
pps
ptm
ptp
ptp-firefly-servo
routing
stp
synce
nv show system log component <component-name> file
显示特定组件的最新文件的内容。系统使用 less 命令,以便您可以交互式地滚动浏览文件。
命令语法
语法 | 描述 |
---|---|
<component-name> | 您要查看其日志文件内容的系统组件。 |
版本历史
在 Cumulus Linux 5.12.0 中引入
示例
cumulus@switch:~$ nv show system log component nvue file
2025-01-15T11:59:23.648913+00:00 cumulus nvued: INFO: nvued:214 Starting nvued
2025-01-15T11:59:23.649568+00:00 cumulus nvued: INFO: nvued:216 NVUE logging set to INFO, chatty deps set to INFO
2025-01-15T11:59:23.650005+00:00 cumulus nvued: INFO: nvued:171 Attempting to extend the SystemD start/stop timeout on Cumulus/VX platform to 15 minutes
2025-01-15T11:59:23.650327+00:00 cumulus nvued: INFO: nvued:184 Successfully sent request to SystemD to extend start timeout: True
2025-01-15T11:59:23.692508+00:00 cumulus nvued: INFO: _access.py:137 Loaded /etc/nvue-auth.yaml
2025-01-15T11:59:23.768857+00:00 cumulus nvued: INFO: safe_sh.py:108 <Running: '/usr/bin/platform-detect'>
2025-01-15T11:59:23.826070+00:00 cumulus nvued: INFO: safe_sh.py:195 <Finished: '/usr/bin/platform-detect'>
2025-01-15T11:59:23.826338+00:00 cumulus nvued: INFO: osinfo.py:298 Platform name vx
...
nv show system log component <component-name> file list
显示指定组件的日志文件列表,并显示相关的日志。
命令语法
语法 | 描述 |
---|---|
<component-name> | 您要查看其日志文件列表的系统组件。 |
版本历史
在 Cumulus Linux 5.12.0 中引入
示例
cumulus@switch:~$ nv show system log component nvue file list
File name File path
----------- --------------------
nv-cli.log /var/log/nv-cli.log
nvued.log /var/log/nvued.log
nvued.log.1 /var/log/nvued.log.1
nv show system log file
显示最新系统日志文件的内容。
版本历史
在 Cumulus Linux 5.12.0 中引入
示例
cumulus@switch:~$ nv show system log file
2025-01-25T17:28:48.288450+00:00 cumulus systemd-modules-load[322]: Inserted module 'loop'
2025-01-25T17:28:48.288682+00:00 cumulus systemd-modules-load[322]: Inserted module 'bonding'
2025-01-25T17:28:48.288696+00:00 cumulus systemd-random-seed[331]: Kernel entropy pool is not initialized yet, waiting until it is.
2025-01-25T17:28:48.288720+00:00 cumulus systemd-modules-load[322]: Inserted module 'bridge'
2025-01-25T17:28:48.288729+00:00 cumulus systemd-modules-load[322]: Inserted module 'br_netfilter'
2025-01-25T17:28:48.288737+00:00 cumulus systemd-modules-load[322]: Inserted module 'tun'
2025-01-25T17:28:48.288751+00:00 cumulus systemd-modules-load[322]: Inserted module 'at24'
2025-01-25T17:28:48.288759+00:00 cumulus systemd-modules-load[322]: Inserted module 'mpls_router'
2025-01-25T17:28:48.288768+00:00 cumulus systemd-modules-load[322]: Inserted module 'mpls_iptunnel'
2025-01-25T17:28:48.288814+00:00 cumulus systemd[1]: Starting systemd-journal-flush.service - Flush Journal to Persistent Storage...
2025-01-25T17:28:48.288853+00:00 cumulus systemd[1]: modprobe@drm.service: Deactivated successfully.
2025-01-25T17:28:48.288863+00:00 cumulus systemd[1]: Finished modprobe@drm.service - Load Kernel Module drm.
2025-01-25T17:28:48.288871+00:00 cumulus systemd-modules-load[322]: Inserted module 'vxlan'
2025-01-25T17:28:48.288879+00:00 cumulus systemd-modules-load[322]: Inserted module 'cumulus_vx_platform'
2025-01-25T17:28:48.288887+00:00 cumulus systemd-modules-load[322]: Inserted module 'softdog'
2025-01-25T17:28:48.288900+00:00 cumulus systemd[1]: Finished systemd-modules-load.service - Load Kernel Modules.
2025-01-25T17:28:48.288909+00:00 cumulus systemd-udevd[337]: Using default interface naming scheme 'v252'.
...
nv show system log file <file-name>
显示特定系统日志文件的内容。如果文件是常规日志文件(例如 syslog.1),系统会使用 less,以便您可以滚动和搜索日志条目。如果文件已压缩(例如 syslog.2.gz),系统会显示内容而不解压缩文件。此命令对于查看已存档和压缩的日志文件都很有用。
命令语法
语法 | 描述 |
---|---|
<file-name> | 您要查看的系统日志文件。 |
版本历史
在 Cumulus Linux 5.12.0 中引入
示例
cumulus@switch:~$ nv show system log file syslog
2025-01-15T11:59:20.314123+00:00 cumulus systemd-modules-load[322]: Inserted mod
ule 'loop'
2025-01-15T11:59:20.314357+00:00 cumulus systemd-random-seed[331]: Kernel entropy pool is not initialized yet, waiting until it is.
2025-01-15T11:59:20.314386+00:00 cumulus systemd-modules-load[322]: Inserted module 'bonding'
2025-01-15T11:59:20.314396+00:00 cumulus systemd[1]: Starting systemd-journal-flush.service - Flush Journal to Persistent Storage...
2025-01-15T11:59:20.314438+00:00 cumulus systemd[1]: modprobe@drm.service: Deactivated successfully.
2025-01-15T11:59:20.314448+00:00 cumulus systemd[1]: Finished modprobe@drm.service - Load Kernel Module drm.
2025-01-15T11:59:20.314456+00:00 cumulus systemd-modules-load[322]: Inserted module 'bridge'
2025-01-15T11:59:20.314464+00:00 cumulus systemd-modules-load[322]: Inserted module 'br_netfilter'
...
nv show system log file brief
以简洁格式显示最新系统日志文件的内容。
版本历史
在 Cumulus Linux 5.12.0 中引入
示例
cumulus@switch:~$ nv show system log file brief
2025-01-15T11:59:20.314123+00:00 cumulus systemd-modules-load[322]: Inserted module 'loop'
2025-01-15T11:59:20.314357+00:00 cumulus systemd-random-seed[331]: Kernel entropy pool is not initialized yet, waiting until it is.
2025-01-15T11:59:20.314386+00:00 cumulus systemd-modules-load[322]: Inserted module 'bonding'
2025-01-15T11:59:20.314396+00:00 cumulus systemd[1]: Starting systemd-journal-flush.service - Flush Journal to Persistent Storage...
2025-01-15T11:59:20.314438+00:00 cumulus systemd[1]: modprobe@drm.service: Deactivated successfully.
2025-01-15T11:59:20.314448+00:00 cumulus systemd[1]: Finished modprobe@drm.service - Load Kernel Module drm.
2025-01-15T11:59:20.314456+00:00 cumulus systemd-modules-load[322]: Inserted module 'bridge'
2025-01-15T11:59:20.314464+00:00 cumulus systemd-modules-load[322]: Inserted module 'br_netfilter'
...
nv show system log file follow
实时显示系统日志文件的内容。该命令持续显示日志文件输出,类似于 tail -f
命令的行为。
版本历史
在 Cumulus Linux 5.12.0 中引入
示例
cumulus@switch:~$ nv show system log file follow
2025-01-16T22:00:08.749566+00:00 leaf01 sshd[17758]: pam_unix(sshd:session): session closed for user cumulus
2025-01-16T22:00:19.589388+00:00 leaf01 sshd[18387]: Accepted publickey for cumulus from 192.168.200.1 port 39400 ssh2: RSA SHA256:l/CnwXBKo6zp1gdL48W0Qpntk4wpJuV0567K+sPF66w
2025-01-16T22:00:19.590984+00:00 leaf01 sshd[18387]: pam_unix(sshd:session): session opened for user cumulus(uid=1000) by (uid=0)
2025-01-16T22:00:19.626551+00:00 leaf01 sshd[18387]: pam_env(sshd:session): deprecated reading of user environment enabled
2025-01-16T22:00:29.900648+00:00 leaf01 sudo: cumulus : TTY=pts/0 ; PWD=/var/home/cumulus ; USER=root ; COMMAND=/usr/bin/nv show system log file brief
2025-01-16T22:00:30.525635+00:00 leaf01 systemd[1]: mnt-air.mount: Deactivated successfully.
2025-01-16T22:01:00.534717+00:00 leaf01 systemd[1]: mnt-air.mount: Deactivated successfully.
2025-01-16T22:01:30.544233+00:00 leaf01 systemd[1]: mnt-air.mount: Deactivated successfully.
...
nv show system log file list
显示系统上可用的系统日志文件及其文件名和对应的文件路径。
版本历史
在 Cumulus Linux 5.12.0 中引入
示例
cumulus@switch:~$ nv show system log file list
File name File path
--------- ---------------
syslog /var/log/syslog