AIX系统的日志文件
系统日志存放目录:/var/adm/ras/(包括启动日志、错误日志、core文件等)
查看错误日志路径
# /usr/lib/errdemon -l
Error Log Attributes
——————————————–
Log File /var/adm/ras/errlog
Log Size 1048576 bytes
Memory Buffer Size 32768 bytes
Duplicate Removal true
Duplicate Interval 10000 milliseconds
Duplicate Error Maximum 1000
查看错误日志:
# errpt(errpt -a显示详细信息)
IDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTION
F89FB899 0831150006 P O dumpcheck The copy directory is too small.
2BFA76F6 0804104006 T S SYSPROC SYSTEM SHUTDOWN BY USER
9DBCFDEE 0804104706 T O errdemon ERROR LOGGING TURNED ON
192AC071 0804103906 T O errdemon ERROR LOGGING TURNED OFF
70247B03 0804103806 I H hdisk1 Device Not Supported
如果RESOURCE_NAME 为硬件,可以用diag工具诊断错误原因
错误分类:
1、按错误的类型,或者说严重的程度,分为6个:
PEND 设备或功能组件可能丢失 简写P
PERF 性能严重下降 P
PERM 硬件设备或软件模块损坏,确诊了的 P
TEMP 临时性错误,经过重试后已经恢复正常 T
INFO 一般消息,不是错误 I
UNKN 不能确定错误的严重性 U
2、种类CLASS c:指出错误源
H 硬件或介质故障
S 软件故障
O 人为错误
U 不能确定
日志清理:
通过errclear命令可以用来清理错误日志,并且默认情况下cron会每天清理错误日志
# crontab -l
0 11 * * * /usr/bin/errclear -d S,O 30
0 12 * * * /usr/bin/errclear -d H 90
0 15 * * * /usr/lib/ras/dumpcheck >;/dev/null 2>;&1
显然,找上面的例子,S,O 类的错误会保留30天,而H的错误会保留90天
AIX通过修改配置文件/etc/syslog.conf 来跟踪不同模块的运行状况。
信息类别:
auth- used by authorization systems (login)
cron - used for the cron and at systems
daemon- system/netword daemon
kern- produced by kernel messages
lpr - printing system
mail - mail system
mark- internally used for time stamps
news - reserved for the news system
user- default facility, used for any program
uucp - reserved for the uucp system
错误等级:
debug- normally used for debugging
info- informational messages
notice- conditions that may require attention
Warning- any warnings
err- any errors
crit - critical conditions like hardware problems
Alert- any condition that demand immediate attention
emerg - any emergency condition
none - Do not send messages from the indicated f
acility - to the selected file.
配置举例:
在文件中添加cron.err /var/cronerr.log #定义记录cron的err信息到/var/cronerr.log文件
core 和 snapcore
由应用产生的 dump 文件,可用于诊断错误 可删除
nohup.out
nohup 命令的输出结果 可删除
.xerrors
X11的输出结果 可截短
mbox
用户邮箱中的邮件 可截短
smit.log 和 smit.script
用户使用smit 命令后的日志 可适当保留最后1000行,或删除
/var/adm/wtmp
记录用户的登录信息,是二进制文件, 用who 命令来阅读其内容 根据需要保留60天中有用的内容,其余删除
/etc/security/failedlogin
记录用户失败的登录信息,是二进制文件,用who 命令来阅读其内容 可根据需要保留60天中有用的内容,其余删除
/var/adm/sulog 用户使用su 命令的日志
可根据需要保留60天中有用的内容,其余删除
/var/adm/cron/log
cron的日志 可截短
/var/tmp/snmpd.log
snmp 监控进程日志 可截短
/var/tmp/dpid.log
/var/tmp/dpid2.log
/var/tmp/hostmidb.log
/var/tmp/muxatmd
snmp 子系统日志 可截短
dead.letter
未成功的邮件 可删除
trcfile trace
实用程序的输出 可删除
/var/adm/messages
用于记录syslog进程的日志 可适当保留最后1000行,或删除
/etc/shutdown.log
系统关机过程日志,用shutdown -l 命令产生 可适当保留最后1000行,或删除