linux下日志收集
(2014-02-26 13:59:56)分类: 系统应用 |
日志的收集和分析是一个非常重要的工作,一般厂商都会有自己独有的命令,我这边列举下常用的两个Linux厂商的收集命令。
1.
使用root用户执行sosreport,会在/tmp下产生新的.tar.gz的日志文件
收集例子:
==
[root@rhel6 ~]# sosreport
sosreport (version 2.2)
This utility will collect some detailed
hardware and setup of your Red Hat Enterprise Linux system.
The information is collected and an archive is
/tmp, which you can send to a support representative.
Red Hat Enterprise Linux will use this information for diagnostic
purposes ONLY
and it will be considered confidential information.
This process may take a while to complete.
No changes will be made to your system.
Press ENTER to continue, or CTRL-C to quit.
Please enter your first initial and last name [rhel6]:
Please enter the case number that you are generating this report
for:
Running plugins. Please wait ...
Completed [66/66]
...
Creating compressed archive...
Your sosreport has been generated and saved in:
The md5sum is: 96b9d932e5ef540e856c8df7
Please send this file to your support representative.
==
2.
使用脚本supportconfig -A收集日志,日志路径会存在/var/log下。
--
TESTDBO2:/tmp/tools/nmon # supportconfig -A
=============================================================================
=============================================================================
Gathering system information
Basic Server Health
Check...