如何查看接口何时出现故障 - Debian



有没有办法检查接口何时出现故障? eth0 由于某种原因宕机,我需要知道这是什么时候发生的。

在终端中运行此命令。

tail  /var/log/syslog -n 1000 | grep down

它显示网络接口的停机时间日志。

root@host:~$ tail  /var/log/syslog -n 1000 | grep down
Aug 21 16:25:22 host org.freedesktop.PackageKit[1868]: INFO:Shutting down because of inactivity
Aug 21 17:44:28 host nm-dispatcher: req:2 'down' [enp2s0]: new request (1 scripts)
Aug 21 17:44:28 host nm-dispatcher: req:2 'down' [enp2s0]: start running ordered scripts...
Aug 21 17:45:20 host kernel: [30576.121063] r8169 0000:02:00.0 enp2s0: link down
Aug 21 17:45:24 host nm-dispatcher: req:2 'down' [enp2s0]: new request (1 scripts)
Aug 21 17:45:24 host nm-dispatcher: req:2 'down' [enp2s0]: start running ordered scripts...

如果需要任何特定网络接口的日志

root@host:~$ tail  /var/log/syslog -n 200 | grep enp2s0

它将显示网络的更多信息(正常运行时间,停机时间和其他( 接口 "ENP2S0">

最新更新