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.

  ==== general ==== 
    Echo date file.
    Echo lsb-release file.
    Echo uname file.
    Echo hostname file.
    Echo uptime file.
    Echo etc/nsswitch.conf file.
    Analyze installed-rpms file.
    Analyze proc/cpuinfo file.
    Echo root/anaconda-ks.cfg file.
    Analyze dmidecode file.
    Echo files in etc/default.
    Echo files in etc/sysconfig/ except '/network-scripts/'.
    Analyze files in sos_commands/boot/.

  ==== cpu ==== 
    Echo proc/interrupts file.

  ==== module ==== 
    Analyze lsmod file.
    Echo files in etc/modprobe.d/.
    Echo files in sys/module/.

  ==== device ==== 
    Analyze lspci file.
    Analyze etc/udev/ file.
    Echo files in sos_commands/devicemapper/.
    Analyze sos_commands/devices/udevadm_info_--export-db file.
    Echo files in sos_commands/ipmitool/.
    Echo sos_commands/scsi/lsscsi file.
    Echo files in sos_commands/usb/.

  ==== file systems ==== 
    Echo files in etc/lvm/.
    Echo files in sos_commands/lvm2/.
    
  ==== disk usage ==== 
    Analyze df file.
    Echo vgdisplay file.

  ==== memory usage ==== 
    Echo free file.
    Echo files in sos_commands/memory/.
    Analyze proc/meminfo file.
    Echo proc/zoneinfo file.
    Echo proc/buddyinfo file.
    Echo proc/slabinfo file.
    Echo proc/vmstat file.

  ==== networking ==== 
    Echo files etc/host*.
    Echo ip_addr file.
    Echo route file.
    Echo files etc/sysconfig/network-scripts/ifcfg-*.
    Echo files in etc/firewalld/.
    Echo files in sos_commands/firewalld/.
    Echo proc/net/dev file.
    Echo proc/net/sockstat file.
    Analyze sos_commands/networking/ethtool_-S files.
    Analyze sos_commands/networking/ethtool_-i files.
    Analyze files in sos_commands/networking/.
    Echo files in etc/NetworkManager/.
    Analyze files in sos_commands/networkmanager/.
    Echo files in sos_commands/wireless/.
    Analyze netstat file.

  ==== process ==== 
    Analyze ps file.

  ==== virtualization ==== 
    Echo files in sos_commands/virsh/.

  ==== files ==== 
    Analyze lsof file.

  ==== systemd ==== 
    Echo files in etc/systemd/system/.
    Echo files in etc/systemd/.
    Echo files in usr/lib/systemd/.

  ==== security ==== 
    Echo files in etc/pam.d/.
    Echo files in sos_commands/pam/.
    Analyze var/log/secure* files.
    Echo files in etc/audit/.
    Echo files in sos_commands/auditd/.
    Analyze files in var/log/audit/.
    Echo files in etc/pki/.
    Echo files in etc/selinux/.
    Echo files in sos_commands/selinux/.

  ==== kernel ==== 
    Analyze etc/kdump.conf.
    Analyze etc/sysctl.conf.
    Analyze sos_commands/kernel/sysctl_-a file.
    Echo files in var/crash/ if the directory exists.
    Analyze files under sos_commands/abrt/.

  ==== dnf/yum ==== 
    Echo files in etc/dnf/.
    Echo files in sos_commands/dnf/.
    Echo etc/yum.conf file.
    Echo files in etc/yum.repos.d/.
    Echo files in etc/yum/.
    Echo files in sos_commands/yum/.

  ==== login ====
    Analyze last file.

  ==== cron ==== 
    Echo etc/anacrontab file.
    Echo etc/crontab file.
    Echo etc/cron.deny file.
    Echo files in etc/cron.d/.
    Echo files in etc/cron.hourly/.
    Echo files in etc/cron.daily/.
    Echo files in etc/cron.weekly/.
    Echo files in etc/cron.monthly/.
    Echo files in var/spool/cron/.

  ==== logrotate ==== 
    Echo etc/logrotate.conf file.
    Echo files in etc/logrotate.d/.

  ==== logs and journals ==== 
    Echo etc/rsyslog.conf.
    Echo var/log/dmesg file.
    Analyze var/log/messages* files.
    Analyze sos_commands/logs/journalctl_--no-pager files.
    Echo files in sos_commands/sar.

  ==== httpd ==== 
    Echo files in etc/httpd/.
    Echo files in sos_commands/apache/.

  ==== others ( default item is 'skip') ==== 
    Echo files in lib/.
    Echo files in etc/.
    Echo files in sos_commands/ except journalctl*.
    Echo files in dev/.
    Echo files in usr/.
    Echo files in var/ except messages*, journal*, sa*, nova* crash*.
    Analyze files in proc/.

  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.

  Analyze proc/cpuinfo file.
  Analyze boot/grub/ files.
  Echo files in cmdlog/.
  Echo etc/host*.
  Echo files etc/sysconfig/network-scripts/ifcfg-*.
  Echo files in etc/.
  Analyze proc/meminfo file.
  Echo proc/zoneinfo file.
  Echo proc/buddyinfo file.
  Echo proc/slabinfo file.
  Echo proc/vmstat file.
  Echo proc/interrupts file.
  Echo var/log/dmesg file.
  Echo etc/crontab file.
  Echo etc/cron.deny file.
  Echo files in etc/cron.d/.
  Echo files in etc/cron.hourly/.
  Echo files in etc/cron.daily/.
  Echo files in etc/cron.weekly/.
  Echo files in etc/cron.monthly/.
  Echo files in var/spool/cron/.
  Analyze var/log/messages* files.
  Echo files in var/crash/.
  Echo files in var/ except messages*, journal*, sa*, nova* crash*.
  Analyze files under proc/.

  Note that members in the same directory, upper ones will be analyzed and those are omitted for the rest. 

2. sar-analyzer

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

  There are seven features.

  Show highest and lowest average value to a file with a report.
  Show spike, highest and lowest value to a file with a report.
  Show spike, highest and lowest value in given time-span to a file with a report.
  Show possible thrashing.
  Show network down.
  am-pm style is converted to abs style in the report.
  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 or Japanese.

  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

  or in Japanese environment, just do this.

  $ 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

  When you did above, 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>/graphs/<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>/graphs/<mcinfo-dir>-<item>-<no>.ps'.

  - sar-only 

    $ sosreport-analyzer -S -D <sa-dir-path>

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

  - time-span for sar 

    ex.

    $ sosreport-analyzer -T 09:00-13:00 -D <sosreport-dir> 
    $ sosreport-analyzer -T 09:00-13:00 -M -D <mcinfo-dir> 
    $ sosreport-analyzer -T 09:00-13:00 -S -D <sa-dir-path> 

  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 ).

  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%