系统管理员工具包: 日志文件基础知识
2008-11-12 08:29:50 来源:WEB开发网因为 syslog 是 UNIX/Linux 中的标准日志记录机制,所以它用于记录大量的不同信息。其中包括启动消息、登录和授权信息,以及服务的启动/关闭。另外,syslog 通常还用于记录电子邮件消息传递、文件系统问题,甚至 DHCP 租期、DNS 问题和 NFS 问题。因为 syslog 可以将数据写入不同的区域,所以 syslog 在写入信息时并不总是十分明显。
在磁盘上复制 syslog 的主要目的地与在 UNIX 变体之间不同。许多 Linux 版本将信息写入 /var/log/messages。在 AIX、Solaris 和 HP-UX 上,syslog 被写入 /var/adm/messages。
在清单 5 中可以看到 Solaris 计算机的 /var/adm/messages 示例。
清单 5. 示例系统日志输出
Feb 3 16:06:58 solaris2 ata: [ID 496167 kern.info] cmdk2 at ata1 target 0 lun 0
Feb 3 16:06:58 solaris2 genunix: [ID 936769 kern.info] cmdk2 is
/pci@0,0/pci-ide@1f,1/ide@1/cmdk@0,0
Feb 3 16:06:59 solaris2 asy: [ID 267298 kern.notice] asy0: UART @
3f8 scratch register: expected 0x5a, g
ot 0xff
Feb 3 16:06:59 solaris2 asy: [ID 702181 kern.notice] Cannot identify UART chip at 3f8
Feb 3 16:06:59 solaris2 asy: [ID 267298 kern.notice] asy1: UART @ 2f8 scratch register:
expected 0x5a, got 0xff
Feb 3 16:06:59 solaris2 asy: [ID 702181 kern.notice] Cannot identify UART chip at 2f8
Feb 3 16:07:01 solaris2 genunix: [ID 314293 kern.info] device
pciclass,030000@2(display#0) keeps up device sd@1,0(sd#1), but the latter is
not power managed
Feb 3 16:07:01 solaris2 /usr/lib/power/powerd: [ID 387247 daemon.error]
Able to open /dev/srn
Feb 3 16:07:08 solaris2 /sbin/dhcpagent[164]: [ID 778557 daemon.warning]
configure_v4_lease: no IP broadcast specified for ni0, making best guess
Feb 3 16:07:31 solaris2 sendmail[503]: [ID 702911 mail.crit] My unqualified host name
(solaris2) unknown; sleeping for retry
Feb 3 16:07:32 solaris2 sendmail[507]: [ID 702911 mail.crit] My unqualified host name
(solaris2) unknown; sleeping for retry
Feb 3 16:07:48 solaris2 svc.startd[7]: [ID 652011 daemon.warning]
svc:/system/webconsole:console: Method "/lib/svc/method/svc-webconsole start"
failed with exit status 95.
Feb 3 16:07:48 solaris2 svc.startd[7]: [ID 748625 daemon.error]
system/webconsole:console failed fatally: transitioned to maintenance
(see 'svcs -xv' for details)
Feb 3 16:07:55 solaris2 pseudo: [ID 129642 kern.info] pseudo-device: devinfo0
Feb 3 16:07:55 solaris2 genunix: [ID 936769 kern.info] devinfo0 is /pseudo/devinfo@0
Feb 3 16:08:31 solaris2 sendmail[503]: [ID 702911 mail.alert] unable to qualify
my own domain name (solaris2) -- using short name
Feb 3 16:08:32 solaris2 sendmail[507]: [ID 702911 mail.alert] unable to qualify my
own domain name (solaris2) -- using short name
更多精彩
赞助商链接