加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

linux下日志收集

(2014-02-26 13:59:56)
分类: 系统应用

日志的收集和分析是一个非常重要的工作,一般厂商都会有自己独有的命令,我这边列举下常用的两个Linux厂商的收集命令。

1. 基于redhat的日志收集

使用root用户执行sosreport,会在/tmp下产生新的.tar.gz的日志文件

收集例子:
==
[root@rhel6 ~]# sosreport

sosreport (version 2.2)

This utility will collect some detailed  information about the
hardware and setup of your Red Hat Enterprise Linux system.
The information is collected and an archive is  packaged under
/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:
  /tmp/sosreport-rhel6-20140225005603-93a7.tar.xz

The md5sum is: 96b9d932e5ef540e856c8df7aad993a7

Please send this file to your support representative.
==


2. 基于Suse的日志收集

使用脚本supportconfig -A收集日志,日志路径会存在/var/log下。
--
TESTDBO2:/tmp/tools/nmon # supportconfig -A

=============================================================================
                     Support Utilities - Supportconfig
                          Script Version: 2.25-197
                          Script Date: 2010 04 02
=============================================================================

Gathering system information
  Data Directory:    /var/log/nts_TESTDBO2_140226_1114

Basic Server Health Check...                 Done
  RPM Database...                              Done
  Basic Environment...                         Done
  Basic Health Report...                       Done
  System Modules...                            Done
  Memory Details...                            Done
  Disk I/O...                                  Done
  System Logs...                               Done
  YaST Files...                                Done
  Auditing...                                  Done
  Crash Info...                                Done
  NTP...                                       Done
  PROC...                                      Done
  Boot Files...                                Done
  SLERT...                                     Skipped
  Updates...                                   Done
  SMT...                                       Skipped
  Novell eDirectory...                         Please Wait... Skipped
  Novell LUM...                                Skipped
  Novell NCP...                                Skipped
  Novell NSS...                                Skipped
  Novell DFS...                                Skipped
  Novell SMS...                                Skipped
  Novell NCS...                                Skipped
  Novell AFP...                                Skipped
  Novell CIFS...                               Skipped
  HA Cluster...                                Skipped
  OCFS2...                                     Skipped
  PAM...                                       Done
  LDAP...                                      Done
  CIMOM...                                     Done
  Open Files...                                Done
  Environment...                               Done
  ETC...                                       Done
  SYSCONFIG...                                 Done
  SYSFS...                                     Done
  System Daemons...                            Done
  CRON...                                      Done
  AT...                                        Done
  UDEV...                                      Done
  LVM...                                       Please Wait... Base Detail Done
  EVMS...                                      Skipped
  Software Raid...                             Done
  Multipathing...                              Done
  Networking...                                Done
  Web...                                       Done
  InfiniBand...                                Done
  DNS...                                       Done
  DHCP...                                      Done
  SLP...                                       Please Wait... Services Done
  SSH...                                       Done
  iSCSI...                                     Done
  Samba...                                     Done
  NFS...                                       Done
  AUTOFS...                                    Done
  SAR Files...                                 Skipped
  AppArmor...                                  Done
  Xen...                                       Skipped
  X...                                         Done
  Printing...                                  Done
  SMART Disks...                               Done
  Hardware...                                  Please Wait... Done
  File System List...                          Please Wait... Done
  Supportability Analysis...                   Please Wait... Done

Creating Tar Ball

==[ DONE ]===================================================================
  Log file tar ball: /var/log/nts_TESTDBO2_140226_1114.tbz
  Log file size:     25M
  Log file md5sum:   36a0aaee37b5174e29278544ac3e8f61

Please attach the log file tar ball to your open Service Request at the
  following URL:
  https://secure-support.novell.com/eService_enu

You can also upload the tar ball to ftp.novell.com/incoming, or just use
  supportconfig -ur , to upload the tar ball automatically.

If you cannot attach the tar ball to the SR, then email it to the engineer.
=============================================================================
--

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有