Skip to content

Analyze sosreport including sar files in many different ways

License

Notifications You must be signed in to change notification settings

uyefe/sosreport-analyzer-ng

Repository files navigation

sosreport-analyzer-ng

This is the next version of 'sosreport-analyzer' or 'sar-analyzer'.

This program includes both 'sosreport-analyzer' and 'sar-analyzer'.

Enjoy!

# sosreport-analyzer
Analyze sosreport in many different ways

This software installs 1 binary file, 'sosreport-analyzer' linked with libsar-analyzer.so and libsosreport-analyzer.so.
You can check linkage with '$ ldd /usr/local/bin/sosreport-analyzer'.

How to build:

 $ ./autogen.sh
 $ ./configure
 $ make
 # make install

 It will install 1 program, 'sosreport-analyzer' in '/usr/local/bin'.

1. sosreport-analyzer

Program Name: sosreport-analyzer

Binary path: /usr/local/bin/sosreport-analyzer

  For sosreport

  New version of config is found in /usr/share/sosreport-analyzer/sosreport-analyzer.conf.example.
  Copy it as /etc/sosreport-analyzer.conf.

  Echo date file.
  Echo lsg-release file.
  Echo uname file.
  Echo hostname file.
  Echo uptime file.
  Echo root/anaconda-ks.cfg file.
  Analyze dmidecode file.
  Analyze lsmod file.
  Analyze lspci file.
  Echo sos_commands/scsi/lsscsi file.
  Analyze installed-rpms file.
  Analyze df file.
  Echo vgdisplay file.
  Echo free file.
  Echo ip_addr file.
  Echo route file.
  Analyze last file.
  Analyze ps file.
  Analyze lsof file.
  Analyze netstat file.
  Analyze etc/kdump.conf
  Analyze etc/sysctl.conf
  Analyze proc/meminfo file.
  Echo proc/interrupts file.
  Echo proc/net/dev file.
  Echo proc/net/sockstat file.
  Echo etc/logrotate.conf file.
  Echo files in etc/cron.d/.
  Analyze var/log/messages files.
  Analyze var/log/secure files.
  Analyze sos_commands/kernel/sysctl_-a file.
  Analyze sos_commands/logs/journalctl_--no-pager files.
  Analyze sos_commands/networking/ethtool_-S files.

  For mcinfo 

  New version of config is found in /usr/share/sosreport-analyzer/sosreport-analyzer-mcinfo.conf.example.
  Copy it as /etc/sosreport-analyzer-mcinfo.conf.

  Echo files in cmdlog/.
  Analyze proc/meminfo file.
  Echo proc/interrupts file.
  Analyze var/log/messages files.

2. sar-analyzer

  Presently, it gives -ZM option to usual sar-analyzer functionality.

  There are six features.

  Show highest and lowest average lines to a file with a report.
  Show highest and lowest all lines to a file with a report.
  Show highest spike to a file with a report.
  Show possible thrashing.
  Show network down.
  Generate graphs as postscript files.

  When the file sanity check fails, program stops echoing the reason.
  In that case, move the very file to other than <sosreport-dir>/var/log/sa and run the program again. 
  Or you may reading file including japanese although machine locale is not JP.
  In that case, edit libsar-analyzer/Makefile.am to use common_jp.c and sar_analyzer_jp.c.

## Getting "sar file"
  Note that "sar file" should be basically, written in English.

  It may be good to convert binary 'sa' file to text 'sar' file.
  Because, sometimes, text 'sar' file is not made yet but binary 'sa' file exists.
  Here is a way converting 'sa' file to 'sar' file.

  example:
  $ LC_ALL=C sar -f /var/log/sa/sa01 -A -t > ./sar01

  how to remove ^@

  Sometimes, ^@ will appear in 'sar' file. In those cases, remove with this command.

  example:
  $ sed -i 's/\x00//g' ./sar01

  Check 'sar' file is written in Ascii text and clear.

  example:
  $less sar01

## Before using

  - sosreport

    Check /etc/sosreport-analyzer.conf

      You can set analyzing word for each analyzing member.
      If you are not sure, consult /usr/share/sosreport-analyzer/sosreport-analyzer.conf.example.
      New version will not override the conf file. When you build new version, be sure to copy file
      or at least, copy lines needed.

  - mcinfo 

    Check /etc/sosreport-analyzer-mcinfo.conf

      You can set analyzing word for each analyzing member.
      If you are not sure, consult /usr/share/sosreport-analyzer/sosreport-analyzer-mcinfo.conf.example.
      New version will not override the conf file. When you build new version, be sure to copy file
      or at least, copy lines needed.

## Usage

  - sosreport

    $ sosreport-analyzer -D <sosreport-dir>

      It writes a file to './sosreport-analyzer-results/<sosreport-dir>/<sosreport-dir>_<time>.txt',
      './sosreport-analyzer-results/<sosreport-dir>/<sosreport-dir>_sar_<time>.txt'.
      and, './sosreport-analyzer-results/<sosreport-dir>/<sosreport-dir>-<item>-<no>.ps'.

  - mcinfo

    $ sosreport-analyzer -M -D <mcinfo-dir>

      It writes a file to './sosreport-analyzer-results/<mcinfo-dir>/<mcinfo-dir>_<time>.txt',
      './sosreport-analyzer-results/<mcinfo-dir>/<mcinfo-dir>_sar_<time>.txt'.
      and, './sosreport-analyzer-results/<mcinfo-dir>/<mcinfo-dir>-<item>-<no>.ps'.

  You can't redirect to a file.

## Is this program safe to execute?

  You can execute this program as an ordinary user not root ( you need to be root when editting conf file, though ).

  Presently, it creats 4 dummy files in the current directory, with no harm.

  Creating directory unconditionally in the current directory for the analyzed files, with no harm.

  No memory leakage.

    Checked with 'valgrind --leak-check=full -v sosreport-analyzer -D <sosreport-dir>'. 

## Uninstall

  # make uninstall

About

Analyze sosreport including sar files in many different ways

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 93.5%
  • Objective-C 5.2%
  • Other 1.3%