Skip to Content
Arista Warrior,第二版
book

Arista Warrior,第二版

by Gary A. Donahue
May 2025
Intermediate to advanced
572 pages
8h 39m
Chinese
O'Reilly Media, Inc.
Book available
Content preview from Arista Warrior,第二版

第 29 章 故障排除 故障排除

本作品已使用人工智能进行翻译。欢迎您提供反馈和意见:translation-feedback@oreilly.com

Arista 交换机上有一些非常有用的诊断工具,其中一些我们已经介绍过,如 tcpdump。有时,我们需要更详细地了解交换机正在做什么,这就是性能监控发挥作用的地方。

日志

在Linux 中,您可以使用tail -f filename命令跟踪日志文件的实时更新。在 EOS 中使用命令行界面(CLI)命令show logging follow 查看系统日志时,也可以做类似的事情。在 Linux 中,系统日志信息存储在任何 Linux 人都希望看到的地方,即/var/log/ 中:

[admin@Arista ~]$ ls /var/log
EosInit           error.log              messages
NorCalInit        eventMon.db            nginx-access.log
Post              fneserver              nginx-error.log
agents            inotifyrun-local.log   ntpstats
btmp              inotifyrun-secure.log  ppp
cli               inotifyrun-sys.log     qt
cron              kernel.debug           secure
eos               lastlog                spooler
eos-console       libvirt                startup-config-output
eos-console-sync  logrot.log             tallylog
eos-monitor       maillog                wtmp
eos-monitor-sync  mcelog                 yum.log

/var/log/messages包含在控制台中看到的所有系统日志信息。sudo 请注意,您需要才能查看该文件:

[admin@Arista ~]$ cd /var/log
[admin@Arista log]$ tail messages
tail: cannot open 'messages' for reading: Permission denied
[admin@Arista log]$ sudo tail messages
Nov 29 02:07:34 Arista Stp: %SPANTREE-6-STABLE_CHANGE: Stp state
is now stable
Nov 29 02:07:56 Arista Cli: %SYS-5-CONFIG_I: Configured from
console by admin on vty3 (10.0.0.100)
Nov 29 02:08:01 Arista CROND[10746]: (root) CMD
(/etc/archivecheck.sh &> /dev/null)
Nov 29 02:08:33 Arista Cli: %SYS-5-CONFIG_E: Enter configuration
mode from console by admin on vty3 (10.0.0.100)
[--output truncated--]

EOS 的文件系统驻留在内存中,因此闪存:之外的任何文件都无法在重启后存活。此外,有些交换机在出厂时可能会配备固态硬盘(Solid-state Drive,SSD),如果你的交换机包含固态硬盘,系统会自动将许多系统日志文件归档到该硬盘上,CLI 中为drive:,Linux 中为/mnt/drive

[admin@Arista ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

A Practical Guide to Fedora™ and Red Hat® Enterprise Linux®, Seventh Edition

A Practical Guide to Fedora™ and Red Hat® Enterprise Linux®, Seventh Edition

Mark G. Sobell

Publisher Resources

ISBN: 9798341658967