Giter Site home page Giter Site logo

xsos's Introduction

xsos - Summarize system info from sosreports

Jump to ...

SCREEN SHOTS

xsos -om OR xsos --os --mem would show something like the following:

xsos parsing general os info and /proc/meminfo

xsos -cln OR xsos --cpu --lspci --net could show this:

xsos parsing /proc/cpuinfo, lspci, /proc/net/dev

xsos -e OR xsos --ethtool output looks like this:

xsos parsing ethtool output

INTRO

The goal of xsos is to make it easy to instantaneously gather information about a system together in an easy-to-read-summary, whether that system is the localhost on which xsos is being run or a system for which you have an unpacked sosreport.

There is tons of useful amazing instructive data available to normal users (not to mention root) on a Linux system, but by design, this information is spread out across myriad files. Some of it even requires commands to parse through.

xsos will attempt to make it easy, parsing and calculating and formatting data from dozens of files (and commands) to give you a detailed overview about a system, or -- if requested -- xsos will only parse one file (e.g. with --mem or --cpu) or output from one command (e.g. with --ip or --ps).

New features are being added all the time -- see the tracker to have a look at some of the things that are already in line to be worked on.

Why another tool? Why not add stuff to sxconsole?

INSTALLATION

"I'm sold! How do I install xsos?"

Two choices:

  1. Manual install: Get the very latest (potentially bleeding-edge) version directly by downloading the main xsos file from bit.ly/xsos-direct (which points to raw.github.com/ryran/xsos/master/xsos). Updating will need to be done manually by re-downloading. Explicitly, you could run the following as root:

    curl -Lo /usr/local/bin/xsos bit.ly/xsos-direct
    chmod +x /usr/local/bin/xsos
    
  2. RPM/Yum repo (recommended): Configure access to the Fedora/RHEL6+ yum repository @ people.redhat.com/rsawhill/rpms and install the [potentially not-as-bleeding-edge] xsos rpm from there. Updating can happen automatically along with the rest of your system. Two-step instructions @ How to install xsos or rsar via yum?

Once xsos is installed by one of the above methods, run xsos -h as a normal user to see the help page and get started.

EXAMPLES IN ACTION

The lovely thing that isn't going to be captured here is all the coloring done to make things easier to read. There's actually quite a bit of color-logic to warn of various conditions...

Run on a sosreport with no options:

[rsaw]$ xsos aczx998pinkle/
OS
  Hostname: aczx998pinkle
  Distro:   [redhat-release] Red Hat Enterprise Linux Server release 5.5 (Carthage)
            [enterprise-release] Enterprise Linux Enterprise Linux Server release 5.5 (Carthage)
  RHN:      serverURL=https://linux-update.oracle.com/XMLRPC
  Runlevel: N 3  (default 3)
  SELinux:  permissive  (default enforcing)
  Arch:     mach=x86_64  cpu=x86_64  platform=x86_64
  Kernel:
    Booted kernel:  2.6.18-238.12.2.0.2.el5
    GRUB default:   2.6.18-238.12.2.0.2.el5
    Build version:
      Linux version 2.6.18-238.12.2.0.2.el5 ([email protected]) (gcc version 4.1.2
      20080704 (Red Hat 4.1.2-50)) #1 SMP Tue Jun 28 05:21:19 EDT 2011
    Booted kernel cmdline:
      root=/dev/md6 ro bootarea=c0d0 loglevel=7 panic=60 debug rhgb numa=off console=ttyS0,115200n8
      console=tty1 crashkernel=128M@16M bootfrom=CELLBOOT audit=1 processor.max_cstate=1 nomce
    GRUB default kernel cmdline:
      root=/dev/md6 ro bootarea=c0d0 loglevel=7 panic=60 debug rhgb numa=off console=ttyS0,115200n8
      console=tty1 crashkernel=128M@16M bootfrom=BOOT audit=1 processor.max_cstate=1 nomce
    Kernel taint-check: 536870912 512 64 16 1
      Technology Preview code is loaded
      Taint on warning
      Userspace-defined naughtiness
      System experienced a machine check exception
      Proprietary module has been loaded
    - - - - - - - - - - - - - - - - - - -
  Sys time:  Mon Oct 29 10:55:02 CDT 2012
  Boot time: Sat Apr 28 03:29:56 CDT 2012  (1335583796)
  Uptime:    184 days, 12:25,  1 user
  LoadAvg:   [24 CPU] 2.34 (10%), 1.27 (5%), 0.95 (4%)
  /proc/stat:
    procs_running: 4    procs_blocked: 1    processes: 248052571
    cpu:  [Break-down of CPU time since boot]
      us 1%, ni 0%, sys 1%, idle 96%, iowait 2%, irq 0%, sftirq 0%, steal 0%

While xsos is always being improved, here's the minimal help page from v0.5.6:

Usage: xsos [DISPLAY OPTIONS] [-6abokcmdtlerngisp] [SOSREPORT ROOT]
  or:  xsos [DISPLAY OPTIONS] {--B|--C|--M|--D|--T|--L|--R|--N|--G|--I|--P FILE}...
  or:  xsos [-?|-h|--help]
  or:  xsos [-U|--update]

Display system info from localhost or extracted sosreport

Content options:
 -a, --all      show everything
 -b, --bios     show info from dmidecode
 -o, --os       show hostname, distro, SELinux, kernel info, uptime, etc
 -k, --kdump    inspect kdump configuration
 -c, --cpu      show info from /proc/cpuinfo
 -m, --mem      show info from /proc/meminfo
 -d, --disks    show info from /proc/partitions + dm-multipath synopsis
 -t, --mpath    show info from dm-multipath
 -l, --lspci    show info from lspci
 -e, --ethtool  show info from ethtool
 -r, --softirq  show info from /proc/net/softnet_stat
 -n, --netdev   show info from /proc/net/dev
 -g, --bonding  show info from /proc/net/bonding
 -i, --ip       show info from ip addr (BASH v4+ required)
     --net      alias for: --lspci --ethtool --softirq --netdev --bonding --ip
 -s, --sysctl   show important kernel sysctls
 -p, --ps       inspect running processes via ps

Display options:
     --scrub-ip     remove IP addresses & hostnames from output
     --scrub-mac    remove HW MAC addresses from output
                    see XSOS_SCRUB_IP_HN & XSOS_SCRUB_MACADDR env vars
 -6, --ipv6         parse ip addr output for IPv6 addresses instead of IPv4
 -q, --wwid=ID      restrict dm-multipath output to a particular mpath device,
                    where ID is a wwid, friendly name, or LUN identifier
 -u, --unit=P       change byte display for /proc/meminfo & /proc/net/dev,
                    where P is "b" for byte, or else "k", "m", "g", or "t"
 -v, --verbose=NUM  specify ps verbosity level (0-4, default: 1)
 -w, --width=NUM    change fold-width, in columns (positive number, e.g., 80)
                    "0" disables wrapping, "w" autodetects width (default)
 -x, --nocolor      disable output colorization
 -y, --less         send output to `less -SR`
 -z, --more         send output to `more`

Special options (BASH v4+ required):
 --B=FILE  read from FILE containing `dmidecode` dump
 --C=FILE  read from FILE containing /proc/cpuinfo dump
 --M=FILE  read from FILE containing /proc/meminfo dump
 --D=FILE  read from FILE containing /proc/partitions dump
 --T=FILE  read from FILE containing `multipath -v4 -ll` dump
 --L=FILE  read from FILE containing `lspci` dump
 --R=FILE  read from FILE containing /proc/net/softnet_stat dump
 --N=FILE  read from FILE containing /proc/net/dev dump
 --G=FILE  read from FILE containing /proc/net/bonding/xxx dump
 --I=FILE  read from FILE containing `ip addr` dump
 --P=FILE  read from FILE containing `ps aux` dump

Run with "--help" to see full help page

Version info: xsos v0.5.6 last mod 2015/01/01
See <github.com/ryran/xsos> to report bugs or suggestions

Here it is run on my laptop as root, with specific options:

[rsaw]$ sudo xsos --bios --ip --lspci --ethtool --net --ps  # would be same as 'xsos -bilenp'
DMIDECODE
  BIOS:
    LENOVO, version 8CET50WW (1.30 ), 11/01/2011
  System:
    Mfr:  LENOVO
    Prod: 4174AQ5
    Vers: ThinkPad T420s
    Ser:  R9XXXXXXXX
    UUID: 56EABD01-XXXX-11CB-9DE6-XXXXXXXXXX
  CPU:
    1 of 1 CPU sockets populated, 2 cores/4 threads per CPU
    2 total cores, 4 total threads
    Mfr:  Intel(R) Corporation
    Fam:  Core i5
    Freq: 2600 MHz
    Vers: Intel(R) Core(TM) i5-2540M CPU @ 2.60GHz
  Memory:
    8192 MB (8 GB) total
    2 of 4 DIMMs populated (system max capacity 16 GB)

LSPCI
  Net/Storage:
    (1) Intel Corporation Centrino Ultimate-N 6300 (rev 3e)
    (1) Intel Corporation 82579LM Gigabit Network Connection (rev 04)
  VGA:
    Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)

ETHTOOL
  Interface Status:
    em1         link=up 1000Mb/s full (autoneg=Y)  drv e1000e v2.2.14-k / fw 0.13-3
    tun0        link=up 10Mb/s full (autoneg=N)    drv tun v1.6
    virbr0      link=DOWN                          drv bridge v2.3 / fw N/A
    virbr0-nic  link=DOWN                          drv tun v1.6
    wlan0       link=up                            drv iwlwifi v3.9.6-200.fc18.x86_64 / fw 9.221.4.1
  Interface Errors:
    em1  dropped_smbus: 267


IP
  Interface   Slave Of  IPv4 Address        State  MAC Address
  =========   ========  ==================  =====  =================
  lo          -         127.0.0.1/8         up     -
  em1         -         192.168.0.20/24     up     f0:de:f1:ba:cf:c4
  wlan0       -         10.7.7.111/24       up     24:77:03:41:41:18
                        192.168.17.17/32
  virbr0      -         192.168.122.1/24    up     52:54:00:97:e3:ee
  virbr0-nic  -         -                   DOWN   52:54:00:97:e3:ee
  tun0        -         10.10.49.81/32      up     -

NETDEV
  Interface   RxMiBytes  RxPackets  RxErrs  RxDrop  TxMiBytes  TxPackets  TxErrs  TxDrop  TxColls
  =========   =========  =========  ======  ======  =========  =========  ======  ======  =======
  em1         6715       6940 k     0       0       6715       1972 k     0       0       0
  tun0        0          0 k        0       0       0          0 k        0       0       0
  virbr0      8          41 k       0       0       8          37 k       0       0       0
  virbr0-nic  0          0 k        0       0       0          0 k        0       0       0
  wlan0       1902       1761 k     0       0       1902       1139 k     0       0       0


PS CHECK
  Total number of processes:
    291
  Top users of CPU & MEM:
    USER  %CPU   %MEM   RSS
    rsaw  34.1%  46.0%  3.81 GiB
    qemu  27.4%  4.9%   0.38 GiB
    root  2.7%   1.0%   0.20 GiB
  Uninteruptible sleep & Defunct processes:
    USER     PID    %CPU  %MEM  VSZ-MiB  RSS-MiB  TTY    STAT   START  TIME    COMMAND
    rsaw     5287   0.0   0.0   0        0        pts/0  D+     17:19  0:00    [cat]
    rsaw     5125   0.0   0.0   0        0        ?      Z      Dec16  0:48    [chromium-browse] <defunct>
    rsaw     8307   0.2   0.0   0        0        ?      Z      Dec17  3:07    [chromium-browse] <defunct>
    rsaw     8867   0.0   0.0   0        0        ?      Z      Dec17  1:20    [xchat] <defunct>
    rsaw     9533   0.0   0.0   0        0        ?      Z      Dec17  0:32    [gedit] <defunct>
  Top CPU-using processes:
    USER     PID    %CPU  %MEM  VSZ-MiB  RSS-MiB  TTY    STAT   START  TIME    COMMAND
    qemu     613    27.4  4.9   3094     393      ?      Sl     00:38  0:29    /usr/bin/qemu-kvm -S -M
    rsaw     23059  13.7  2.3   1091     185      ?      Sl     Dec26  21:34   /proc/self/exe --type=plugin --plugin-path=/usr/lib64/flash-plugin/libflashplayer.so
    rsaw     621    5.9   0.8   964      65       ?      Ss     00:38  0:06    python /usr/share/virt-manager/virt-manager.py
    rsaw     2137   5.3   18.7  2705     1472     ?      Sl     Dec24  204:37  /usr/lib64/firefox/firefox
    root     1226   2.2   0.5   135      42       tty1   Ss+    Dec24  87:57   /usr/bin/Xorg :0 -background
    rsaw     11901  2.1   4.2   2319     335      ?      SLl    Dec24  74:54   /usr/bin/gnome-shell
    rsaw     22866  2.0   1.6   898      128      ?      Sl     Dec26  3:11    /usr/lib64/chromium-browser/chromium-browser --enable-plugins --enable-extensions
    rsaw     29408  1.3   0.5   1218     39       ?      Sl     Dec26  0:37    gedit
    rsaw     23084  0.8   1.2   1140     99       ?      Sl     Dec26  1:18    /usr/lib64/chromium-browser/chromium-browser --type=renderer --lang=en-US
    rsaw     22952  0.8   1.7   1168     141      ?      Sl     Dec26  1:22    /usr/lib64/chromium-browser/chromium-browser --type=renderer --lang=en-US
  Top MEM-using processes:
    USER     PID    %CPU  %MEM  VSZ-MiB  RSS-MiB  TTY    STAT   START  TIME    COMMAND
    rsaw     2137   5.3   18.7  2705     1472     ?      Sl     Dec24  204:37  /usr/lib64/firefox/firefox
    qemu     613    27.4  4.9   3094     393      ?      Sl     00:38  0:29    /usr/bin/qemu-kvm -S -M
    rsaw     11901  2.1   4.2   2319     335      ?      SLl    Dec24  74:54   /usr/bin/gnome-shell
    rsaw     23059  13.7  2.3   1091     185      ?      Sl     Dec26  21:34   /proc/self/exe --type=plugin --plugin-path=/usr/lib64/flash-plugin/libflashplayer.so
    rsaw     22952  0.8   1.7   1168     141      ?      Sl     Dec26  1:22    /usr/lib64/chromium-browser/chromium-browser --type=renderer --lang=en-US
    rsaw     22866  2.0   1.6   898      128      ?      Sl     Dec26  3:11    /usr/lib64/chromium-browser/chromium-browser --enable-plugins --enable-extensions
    rsaw     23214  0.6   1.5   1141     121      ?      Sl     Dec26  0:59    /usr/lib64/chromium-browser/chromium-browser --type=renderer --lang=en-US
    rsaw     23004  0.0   1.2   1130     100      ?      Sl     Dec26  0:06    /usr/lib64/chromium-browser/chromium-browser --type=renderer --lang=en-US
    rsaw     22959  0.0   1.2   1127     100      ?      Sl     Dec26  0:05    /usr/lib64/chromium-browser/chromium-browser --type=renderer --lang=en-US
    rsaw     23084  0.8   1.2   1140     99       ?      Sl     Dec26  1:18    /usr/lib64/chromium-browser/chromium-browser --type=renderer --lang=en-US

Run on another sosreport with some options:

[rsaw]$ xsos 8308201prodserv --disks --mem --unit=m
MEMORY
  Stats graphed as percent of MemTotal:
    MemUsed    ◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◇◇  96.0%
    HugePages  ◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇  60.5%
    Buffers    ◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇   0.6%
    Cached     ◆◆◆◆◆◆◆◆◆◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇  18.6%
    Dirty      ◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇   0.0%
  RAM:
    64363 MiB total ram
    61815 MiB (96%) used
    49451 MiB (76.8%) used excluding Buffers/Cached
    5 MiB (0%) dirty
  HugePages:
    38912 MiB pre-allocated to HugePages (60.5% of total ram)
    38146 MiB of HugePages (98%) in-use by applications
  LowMem/Slab/PageTables/Shmem:
    61815 MiB (96%) of 64363 MiB LowMem in-use
    1192 MiB (1.9%) of total ram used for Slab
    349 MiB (0.5%) of total ram used for PageTables
  Swap:
    464 MiB (2.8%) used of 16381 MiB total

STORAGE
  Multipath:
    archive    2.0 T
    dbbackup   850 G
    dgspool    20 G
    miscspool  100 G
    proddb     200 G
    prodstage  100 G
    produpgdb  150 G
    reportdb   30 G
    tsttrndev  150 G
  Disks:
    (Multipath and/or software raid components hidden)
    1 disks, totaling 272 GiB (0.27 TiB)
    sda   271.9 G

[rsaw]$ xsos --net --unit k 8308201prodserv
NETDEV
  Interface  RxKiBytes     RxPackets     RxErrs  RxDrop     TxKiBytes     TxPackets     TxErrs  TxDrop
  =========  =========     =========     ======  ======     =========     =========     ======  ======
  eth0       23569277      300080406     0       0          23569277      480926218     0       0
  eth1       144484269105  342207919183  0       4494 (0%)  144484269105  357978804158  0       0
  eth2       428438229206  392560553366  0       373 (0%)   428438229206  330736051661  0       0
  eth4       37184228554   55232280858   0       2350 (0%)  37184228554   35535848225   0       0


[rsaw]$ xsos -nug 8308201prodserv
NETDEV
  Interface  RxGiBytes  RxPackets  RxErrs  RxDrop     TxGiBytes  TxPackets  TxErrs  TxDrop
  =========  =========  =========  ======  ======     =========  =========  ======  ======
  eth0       22.5       300 M      0       0          22.5       481 M      0       0
  eth1       137791     342208 M   0       4494 (0%)  137791     357979 M   0       0
  eth2       408590     392561 M   0       373 (0%)   408590     330736 M   0       0
  eth4       35461.6    55232 M    0       2350 (0%)  35461.6    35536 M    0       0

Run on a sosreport again, showing sysctls:

[rsaw]$ xsos --sysctl boomyaow/
SYSCTLS
  kernel.
    hostname =  boomyaow03
    osrelease =  2.6.32-220.13.1.el6.x86_64
    tainted =  0  (kernel untainted)
    random.boot_id =  defb55c5-c2bb-4e4e-86c3-745d80a6585d
    random.entropy_avail [bits] =  154
    hung_task_panic [bool] =  0
    hung_task_timeout_secs =  120  (secs task must be D-state to trigger)
    msgmax [bytes] =  65536
    msgmnb [bytes] =  65536
    msgmni [msg queues] =  32768
    panic [secs] =  0  (no autoreboot on panic)
    panic_on_oops [bool] =  1
    panic_on_unrecovered_nmi [bool] =  0
    pid_max =  32768
    threads-max =  1029998
    sem [array] =  250  32000  32  4096
      SEMMSL (max semaphores per array) =  250
      SEMMNS (max sems system-wide)     =  32000
      SEMOPM (max ops per semop call)   =  32
      SEMMNI (max number of sem arrays) =  4096
    shmall [4-KiB pages] =  4294967296  (16384.0 GiB max total shared memory)
    shmmax [bytes] =  68719476736  (64.00 GiB max segment size)
    shmmni [segments] =  4096  (max number of segs)
    sysrq [bitmask] =  0  (disallowed)
  fs.
    file-max [fds] =  6512672  (system-wide limit on nr open file descriptors)
    file-nr [fds] =  2496  0  6512672  (nr allocated fds, N/A, nr free fds)
    inode-nr [inodes] =  78574  1  (nr_inodes allocated, nr_free_inodes)
  net.
    core.rmem_max [bytes] =  131071  (127 KiB)
    core.wmem_max [bytes] =  131071  (127 KiB)
    core.rmem_default [bytes] =  124928  (122 KiB)
    core.wmem_default [bytes] =  124928  (122 KiB)
    ipv4.icmp_echo_ignore_all [bool] =  0
    ipv4.ip_forward [bool] =  0
    ipv4.tcp_max_orphans [sockets] =  65536  (4096 MiB @ max 64 KiB per orphan)
    ipv4.tcp_mem [4-KiB pages] =  6179904  8239872  12359808  (23.57 GiB, 31.43 GiB, 47.15 GiB)
    ipv4.udp_mem [4-KiB pages] =  6179904  8239872  12359808  (23.57 GiB, 31.43 GiB, 47.15 GiB)
    ipv4.tcp_window_scaling [bool] =  1
    ipv4.tcp_rmem [bytes] =  4096  87380  4194304  (4 KiB, 85 KiB, 4096 KiB)
    ipv4.tcp_wmem [bytes] =  4096  16384  4194304  (4 KiB, 16 KiB, 4096 KiB)
    ipv4.udp_rmem_min [bytes] =  4096  (4 KiB)
    ipv4.udp_wmem_min [bytes] =  4096  (4 KiB)
  vm.
    dirty_ratio =  20  (% of total system memory)
    dirty_bytes =  0  (disabled -- check dirty_ratio)
    dirty_background_ratio =  10  (% of total system memory)
    dirty_background_bytes =  0  (disabled -- check dirty_background_ratio)
    dirty_expire_centisecs =  3000
    dirty_writeback_centisecs =  500
    nr_hugepages [2-MiB pages] =  0
    overcommit_memory [0-2] =  0  (heuristic overcommit)
    overcommit_ratio =  50
    oom_kill_allocating_task [bool] =  0  (scan tasklist)
    panic_on_oom [0-2] =  0  (no panic)
    swappiness [0-100] =  60

Finally, here's example of using some of the Special options, which allow you to specify a specific file instead of a full sosreport or having xsos run on your local system:

[rsaw]$ xsos -v0 --B /tmp/dmidecode.txt --I=/tmp/ipaddr.dump --P /tmp/psaux.txt
DMIDECODE
  BIOS:
    HP, version P66, 06/24/2011
  System:
    Mfr:  HP
    Prod: ProLiant DL980 G7
    Vers: Not Specified
    Ser:  CZ3XXXXXXXX
    UUID: 35344D41-XXXXXX-5A43-3331-XXXXXXXXXXX
  CPU:
    8 of 8 CPU sockets populated, 8 cores/16 threads per CPU
    64 total cores, 128 total threads
    Mfr:  Intel
    Fam:  Xeon
    Freq: 2133 MHz
    Vers: Intel(R) Xeon(R) CPU E7- 2830 @ 2.13GHz
  Memory:
    262144 MB (256 GB) total
    32 of 128 DIMMs populated (system max capacity 512 GB)

IP
  Interface  Slave Of  MAC Address        State  IPv4 Address
  =========  ========  =================  =====  ==================
  lo         -         -                  up     127.0.0.1/8
  lo:0       -         -                  up     192.168.160.20/32
  eth0       -         ZZ:xy:56:01:12:qr  up     192.168.160.11/24
  eth1       -         ZZ:xy:9a:1a:19:qr  up     10.79.4.68/23
  eth1:1     -         ZZ:xy:9a:1a:19:qr  up     10.79.4.70/23
  eth2       -         ZZ:xy:28:fd:19:qr  up     10.10.10.8/28
  eth4       -         ZZ:xy:9e:0b:19:qr  up     192.168.254.8/28
  eth5       bond0     ZZ:xy:b5:0b:19:qq  up     -
  eth6       bond0     ZZ:xy:b5:0b:1a:qq  up     -
  eth7       -         ZZ:xy:35:00:99:qq  DOWN   -
  bond0      -         ZZ:zz:ZZ:zz:ZZ:zz  up     10.180.162.22/24

PS CHECK
  Total number of processes:
    1393
  Top users of CPU & MEM:
    USER    %CPU    %MEM      RSS
    oracle  909.8%  60649.2%  38137.57 GiB
    root    130.8%  2.7%      1.93 GiB
  Uninteruptible sleep & Defunct processes:
    USER     PID    %CPU  %MEM  VSZ-MiB  RSS-MiB  TTY    STAT  START  TIME      COMMAND  
    oracle   7883   0.3   59.3  141      38177    ?      Ds    Jul31  2:33      oracleCRELSP4
    oracle   11028  0.1   59.3  154      38170    ?      Ds    Jun30  49:08     ora_arc8_CRELSP4
    oracle   13816  0.0   59.3  140      38171    ?      Ds    Jul31  0:12      oracleCRELSP4
    oracle   15184  0.4   59.3  141      38176    ?      Ds    Jul31  3:01      oracleCRELSP4
    oracle   15423  0.5   59.3  143      38179    ?      Ds    Jul31  3:32      oracleCRELSP4
    oracle   17334  0.0   59.3  143      38176    ?      Ds    Jul31  0:14      oracleCRELSP4
    oracle   18502  0.3   59.3  141      38176    ?      Ds    Jul31  2:39      oracleCRELSP4
    root     18514  2.0   0.0   0        0        ?      D<    10:33  0:00      /bin/grep
    oracle   20751  0.8   59.3  143      38178    ?      Ds    Jul31  5:21      oracleCRELSP4
    oracle   24385  0.6   59.3  142      38175    ?      Ds    Jul31  4:05      oracleCRELSP4
    oracle   24557  0.4   59.3  140      38173    ?      Ds    10:22  0:02      oracleCRELSP4
    oracle   24718  1.3   59.3  143      38178    ?      Ds    Jul31  8:57      oracleCRELSP4
    oracle   29008  2.8   59.3  143      38176    ?      Ds    09:38  1:34      oracleCRELSP4  
  Top CPU-using processes:
    USER     PID    %CPU  %MEM  VSZ-MiB  RSS-MiB  TTY    STAT  START  TIME      COMMAND  
    root     18329  104   0.0   50       2        pts/6  R+    10:33  0:03      /bin/netstat
    oracle   11160  19.7  59.3  146      38174    ?      Ss    Jun30  9012:36   oracleCRELSP4
    oracle   14014  10.6  59.3  140      38173    ?      Ss    10:32  0:05      oracleCRELSP4
    root     6455   5.9   0.1   415      83       ?      Sl    Jan25  16265:29  /space/java/jdk1.5.0_20/bin/java
    root     6515   5.3   0.0   0        0        ?      R     Jan14  15483:17  [rpciod]
  Top MEM-using processes:
    USER     PID    %CPU  %MEM  VSZ-MiB  RSS-MiB  TTY    STAT  START  TIME      COMMAND  
    oracle   7847   0.0   59.4  249      38257    ?      Ss    Jun30  0:52      ora_diag_CRELSP4
    oracle   1912   0.0   59.3  160      38185    ?      Ss    Jul22  12:29     ora_j001_CRELSP4
    oracle   10937  0.1   59.3  167      38185    ?      Ss    Jun30  53:14     ora_arc3_CRELSP4
    oracle   10920  0.1   59.3  167      38185    ?      Ss    Jun30  58:05     ora_arc1_CRELSP4
    oracle   11037  0.1   59.3  167      38184    ?      Ss    Jun30  53:33     ora_arc9_CRELSP4

REQUIREMENTS

  • As detailed in the help page, BASH version 4 (rhel 6+) is required for -i/--ip and for any of the "Special options" like --C or --B. Colorization is also not done unless BASH v4+ is detected.
  • Other than that, nothing special for command requirements -- xsos uses standard coreutils & util-linux commands, along with, of course ... gawk and sed.
  • No absolute paths used for commands.
  • When running on localhost (i.e. not a sosreport), xsos gracefully reports as much of what's requested as possible when running as non-root (--bios and --ethtool require root privileges; --disks won't be able to print dm-multipath output without root privs).

THINGS THAT MIGHT SURPRISE YOU

  • xsos does some pretty intensive color-formatting to make the output more easily-readable (can be disabled with -x or --nocolor and colors can be modified via environment variables).
    • If you like the color but need to use a pager, use the --less (-y) or --more (-z) options to auto-pipe output to less -SR or more.
  • There are a bunch of environment variables that you can use to tweak behavior. See the original commit comment for documentation.
  • There's a bash autocompletion function defition available for xsos. Use it.
  • When printing disk info with -d/--disks, xsos automatically detects linux software raid (md) devices and hides their components. The multipath command is also consulted to print info about native multipathd devices. All LUNs that are part of a dm-multipath map are also hidden from the disk output.
  • You can use the --unit (-u) option to change how /proc/meminfo and /proc/net/dev are parsed -- displaying units in anything from bytes up to tebibytes. Note that this option does not affect display of the VSZ & RSS fields in the ps output. (For that, manually set the XSOS_PS_UNIT variable to k, m, or g.)

AUTHORS

As far as direct contributions go, so far it's just me, ryran, aka rsaw, aka Ryan Sawhill Aroha. That said, many folks have reported bugs and given suggestions for new features:

  • Patrick Talbert especially deserves a huge shout-out! Using xsos on sosreports while diagnosing networking issues, he's uncovered many an odd corner case and discussions with him have led to implementing new features and refining what the networking modules show.

  • Jamie Bainbridge has been so consistently kind and effusive in expressing his appreciation of xsos. The RFEs he has suggested (at least the ones we've implemented) have surely made xsos a more powerful tool.

  • Joe Wright was the first person to request a kdump module. Turned out to be a great idea!

When I was clueless in how to further my awk career early on, two prolific users over on StackOverflow -- Dennis Williamson and ghostdog74 -- each provided answers (to two separate questions) with code that was brilliantly instructive. My awk skills have since evolved far beyond what I was trying to do back then, but thanks definitely goes to both of them for that early inspiration.

Please contact me if you have ideas, suggestions, questions, or want to collaborate on this or something similar. For specific bugs and feature-requests, you can post a new issue on the tracker.

LICENSE

Copyright (C) 2012-2015 Ryan Sawhill Aroha

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @gnu.org/licenses/gpl.html for more details.

xsos's People

Contributors

chaerin16 avatar gangelop avatar juanmasg avatar natoscott avatar ptalbert avatar rhn-jaeshin avatar ryran avatar superjamie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xsos's Issues

RFE: Add option to make osinfo less RHEL-centric and less focused on support issues

Basically, this means adding an environment variable and possibly an easy-access cmdline toggle to switch between rhel-centric support-concerns and normal linux mode. This will only affect the osinfo output.

When in rhel-centric mode:

  • Special treatment for /etc/redhat-release
    • It's always shown, regardless of whether the file is there (glaring (missing) tag)
    • Special colorization for oddities in redhat-release
  • RHN field always shown, with special colorization for a few oddities
  • Colorization for kernel build version not being from a RHT build-server
  • Some checks for RHEL-hybrids are automatically run -- i.e., to see if system has suse, oracle, centos packages installed

When in general linux mode, none of the above happens. Simple enough.

--cpu doesn't show thread info for some single-core hyper-threaded cpus

When single-core CPUs have hyper-threading enabled, xsos doesn't break down the thread and core count, unlike with multi-core cpus.

Example of a multicore cpu with hyper-threading:

CPU
  16 logical processors (8 CPU cores)
  2 Intel Xeon CPU E5620 @ 2.40GHz (flags: aes,ht,lm,pae,vmx)
  └─8 threads, 4 cores each
-------------------------------------------------------------------------------

Example of a single-core cpu with ht:

$ xsos --C 13815423
CPU
  4 logical processors
  2 Intel Xeon CPU 3.20GHz (flags: ht,pae)
-------------------------------------------------------------------------------
$ grep physical 13815423
physical id : 0
physical id : 0
physical id : 3
physical id : 3
$ grep core 13815423
$ grep siblings 13815423
siblings    : 2
siblings    : 2
siblings    : 2
siblings    : 2
$ cat 13815423
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 15
model       : 2
model name  : Intel(R) Xeon(TM) CPU 3.20GHz
stepping    : 5
cpu MHz     : 3193.089
cache size  : 512 KB
physical id : 0
siblings    : 2
runqueue    : 0
fdiv_bug    : no
hlt_bug     : no
f00f_bug    : no
coma_bug    : no
fpu     : yes
fpu_exception   : yes
cpuid level : 2
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips    : 6370.09

processor   : 1
vendor_id   : GenuineIntel
cpu family  : 15
model       : 2
model name  : Intel(R) Xeon(TM) CPU 3.20GHz
stepping    : 5
cpu MHz     : 3193.089
cache size  : 512 KB
physical id : 0
siblings    : 2
runqueue    : 0
fdiv_bug    : no
hlt_bug     : no
f00f_bug    : no
coma_bug    : no
fpu     : yes
fpu_exception   : yes
cpuid level : 2
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips    : 6383.20

processor   : 2
vendor_id   : GenuineIntel
cpu family  : 15
model       : 2
model name  : Intel(R) Xeon(TM) CPU 3.20GHz
stepping    : 5
cpu MHz     : 3193.089
cache size  : 512 KB
physical id : 3
siblings    : 2
runqueue    : 2
fdiv_bug    : no
hlt_bug     : no
f00f_bug    : no
coma_bug    : no
fpu     : yes
fpu_exception   : yes
cpuid level : 2
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips    : 6383.20

processor   : 3
vendor_id   : GenuineIntel
cpu family  : 15
model       : 2
model name  : Intel(R) Xeon(TM) CPU 3.20GHz
stepping    : 5
cpu MHz     : 3193.089
cache size  : 512 KB
physical id : 3
siblings    : 2
runqueue    : 2
fdiv_bug    : no
hlt_bug     : no
f00f_bug    : no
coma_bug    : no
fpu     : yes
fpu_exception   : yes
cpuid level : 2
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips    : 6383.20

rsar RFE / BUG: -n opt only shows dev; what about sock, nfs, nfsd, etc?

Sar has multiple options for -n ... we need to take that into account.

-n { <keyword> [,...] | ALL }
    Network statistics
    Keywords are:
    DEV Network interfaces
    EDEV    Network interfaces (errors)
    NFS NFS client
    NFSD    NFS server
    SOCK    Sockets (v4)
    IP  IP traffic  (v4)
    EIP IP traffic  (v4) (errors)
    ICMP    ICMP traffic    (v4)
    EICMP   ICMP traffic    (v4) (errors)
    TCP TCP traffic (v4)
    ETCP    TCP traffic (v4) (errors)
    UDP UDP traffic (v4)
    SOCK6   Sockets (v6)
    IP6 IP traffic  (v6)
    EIP6    IP traffic  (v6) (errors)
    ICMP6   ICMP traffic    (v6)
    EICMP6  ICMP traffic    (v6) (errors)
    UDP6    UDP traffic (v6)

rsar: File-handling is crappy (slow, can't always open compressed files, errors out if any 1 of multiple files are bad or missing)

Problems we need to fix:

  • Why is rsar slow to get started? Not crazy slow, but it takes a split second before it starts displaying things, especially when tons of files are passed all at once.
  • Sometimes rsar can't read compressed files -- errors out with something about "ASCII text, with very long lines".
  • When passing rsar multiple files, every single one must be good or else rsar fails out.

lspci reports 1 nic, but 3 nics available when looking at ip addr, ethtool

Output from xsos -lei:

LSPCI
  Net:
    1 Intel Corporation 82541GI Gigabit Ethernet Controller (rev 05)
  VGA:
    XGI Technology Inc. (eXtreme Graphics Innovation) Z7/Z9 (XG20 core)
-------------------------------------------------------------------------------
ETHTOOL
  eth0  link=UP 1000Mb/s full (autoneg=Y)  drv forcedeth v0.64
  eth1  link=DOWN                          drv forcedeth v0.64
  eth2  link=DOWN                          drv e1000 v7.3.21-k6-1-NAPI / fw N/A
-------------------------------------------------------------------------------
IP
  Interface  Slave Of  MAC Address        State  IPv4 Address
  =========  ========  =================  =====  ==================
  lo         -         -                  up     127.0.0.1/8
  eth0       -         00:e0:81:b1:a7:6f  up     128.231.13.176/23
  eth1       -         00:e0:81:b1:a7:70  up     -
  eth2       -         00:e0:81:b1:a7:71  up     -
-------------------------------------------------------------------------------

WTH?

--cpu/-c/--C reporting improper number physical cpus for some multicore procs that don't report "core id" or "cpu cores"

$ xsos --C cpuinfo
CPU
  6 logical processors
  6 Six-Core AMD Opteron(tm) Processor 8435 (flags: lm,pae)
-------------------------------------------------------------------------------
$ cat cpuinfo
processor   : 0
vendor_id   : AuthenticAMD
cpu family  : 16
model       : 8
model name  : Six-Core AMD Opteron(tm) Processor 8435
stepping    : 0
cpu MHz     : 2599.942
cache size  : 512 KB
fpu     : yes
fpu_exception   : yes
cpuid level : 5
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 popcnt lahf_lm extapic altmovcr8 abm sse4a misalignsse
bogomips    : 5252.41
TLB size    : 1104 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: <NULL>

processor   : 1
vendor_id   : AuthenticAMD
cpu family  : 16
model       : 8
model name  : Six-Core AMD Opteron(tm) Processor 8435
stepping    : 0
cpu MHz     : 2599.942
cache size  : 512 KB
fpu     : yes
fpu_exception   : yes
cpuid level : 5
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 popcnt lahf_lm extapic altmovcr8 abm sse4a misalignsse
bogomips    : 5203.20
TLB size    : 1104 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: <NULL>

processor   : 2
vendor_id   : AuthenticAMD
cpu family  : 16
model       : 8
model name  : Six-Core AMD Opteron(tm) Processor 8435
stepping    : 0
cpu MHz     : 2599.942
cache size  : 512 KB
fpu     : yes
fpu_exception   : yes
cpuid level : 5
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 popcnt lahf_lm extapic altmovcr8 abm sse4a misalignsse
bogomips    : 5203.98
TLB size    : 1104 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: <NULL>

processor   : 3
vendor_id   : AuthenticAMD
cpu family  : 16
model       : 8
model name  : Six-Core AMD Opteron(tm) Processor 8435
stepping    : 0
cpu MHz     : 2599.942
cache size  : 512 KB
fpu     : yes
fpu_exception   : yes
cpuid level : 5
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 popcnt lahf_lm extapic altmovcr8 abm sse4a misalignsse
bogomips    : 5204.36
TLB size    : 1104 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: <NULL>

processor   : 4
vendor_id   : AuthenticAMD
cpu family  : 16
model       : 8
model name  : Six-Core AMD Opteron(tm) Processor 8435
stepping    : 0
cpu MHz     : 2599.942
cache size  : 512 KB
fpu     : yes
fpu_exception   : yes
cpuid level : 5
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 popcnt lahf_lm extapic altmovcr8 abm sse4a misalignsse
bogomips    : 5202.95
TLB size    : 1104 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: <NULL>

processor   : 5
vendor_id   : AuthenticAMD
cpu family  : 16
model       : 8
model name  : Six-Core AMD Opteron(tm) Processor 8435
stepping    : 0
cpu MHz     : 2599.942
cache size  : 512 KB
fpu     : yes
fpu_exception   : yes
cpuid level : 5
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 popcnt lahf_lm extapic altmovcr8 abm sse4a misalignsse
bogomips    : 5202.73
TLB size    : 1104 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: <NULL>

Running xsos --ip on a rhel5 system doesn't work

The following is seen when trying to run xsos on a rhel5 system.

$ ./xs -i
./xs: line 38: declare: -A: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
./xs: line 196: declare: -A: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
./xs: line 987: declare: -A: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
IP
  Interface  Slave Of  MAC Address        State  IPv4 Address
  =========  ========  =================  =====  ==================
  lo         -         -                  up     127.0.0.1/8
  eth0       -         52:54:00:28:57:9b  up     10.12.55.209/22
-------------------------------------------------------------------------------

After upgrading to the latest version, the following is seen:

$ ./xsos --ip
The -i/--ip option requires use of BASH associative arrays
i.e., BASH v4.0 or higher (RHEL6/Fedora11 and above)
-------------------------------------------------------------------------------

What gives?

RFE: Add asci-art/graph for meminfo-display

Skywalker suggested this and now I can't get it out of my head. Ahhhhh.

I suspect I will make it just be one horizontal bar where the total represents total memory and the break-downs are: hugepages, buffers&cache, and completely free mem.

Possible RFE: what about lvm & dm-crypt? what about filesystem level?

"The output from xsos -p is pretty useless. Is that all the love you've got for storage?"

I'm open to ideas on what info to present. It's so easy to look at /etc/fstab, /etc/crypttab, and use thelvm tools .. I'm not really sure what to do.

I might make use of the lsblk command but it's only in rhel6 and above. Not sure what to do with it other than print it out straight. Suggestions welcome.

running xsos --os on a sosreport doesn't show hostname or kernel version

Seen on a sosreport:

OS
/usr/local/bin/xsos: line 526: ./proc/sys/kernel/hostname: No such file or directory
  Hostname:  
  Distro:    Red Hat Enterprise Linux Server release 5.6 (Tikanga)
/usr/local/bin/xsos: line 528: ./proc/sys/kernel/osrelease: No such file or directory
  Kernel:    
  SELinux:   status unknown (default: unknown)
  Sys time:  Tue Oct 23 16:54:46 EDT 2012
  Boot time: Mon Oct 22 18:01:27 EDT 2012 (1350928887)
  Uptime:    1 day,  2:53,  6 users
  LoadAvg:   0.16 (0%), 0.03 (0%), 0.01 (0%)
  Cpu time since boot:
    us 0%, ni 0%, sys 0%, idle 100%, iowait 0%, irq 0%, sftirq 0%, steal 0%
  procs_running (procs_blocked):
    2 (0)
  Kernel taint-check: 64 16 2 1 
    Userspace-defined naughtiness
    System experienced a machine check exception
    Module has been forcibly loaded
    Proprietary module has been loaded
  Kernel cmdline:
    ro root=/dev/rootvg/rootvol crashkernel=128M@16M
  Kernel version/build:
    Linux version 2.6.18-238.12.1.el5 ([email protected]) 
    (gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)) #1 SMP Sat May 7 20:18:50 
    EDT 2011
-------------------------------------------------------------------------------

CPU info detection doesn't report cores for some multi-core cpus

Various multicore cpus aren't detected properly by xsos!
xsos --cpu or xsos --C shows the proper number of logical cpus, but shows no information about cores or threads like it does with other cpus!?!? OMG WTF BBQ!!?!?!?!!

$ xsos -C cpuinfo
CPU
  6 logical processors
  1 Six-Core AMD Opteron(tm) Processor 8435 (flags: lm,pae)
-------------------------------------------------------------------------------

$ cat cpuinfo
processor   : 0
vendor_id   : AuthenticAMD
cpu family  : 16
model       : 8
model name  : Six-Core AMD Opteron(tm) Processor 8435
stepping    : 0
cpu MHz     : 2599.942
cache size  : 512 KB
fpu     : yes
fpu_exception   : yes
cpuid level : 5
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 popcnt lahf_lm extapic altmovcr8 abm sse4a misalignsse
bogomips    : 5252.41
TLB size    : 1104 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: <NULL>

processor   : 1
vendor_id   : AuthenticAMD
cpu family  : 16
model       : 8
model name  : Six-Core AMD Opteron(tm) Processor 8435
stepping    : 0
cpu MHz     : 2599.942
cache size  : 512 KB
fpu     : yes
fpu_exception   : yes
cpuid level : 5
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 popcnt lahf_lm extapic altmovcr8 abm sse4a misalignsse
bogomips    : 5203.20
TLB size    : 1104 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: <NULL>

processor   : 2
vendor_id   : AuthenticAMD
cpu family  : 16
model       : 8
model name  : Six-Core AMD Opteron(tm) Processor 8435
stepping    : 0
cpu MHz     : 2599.942
cache size  : 512 KB
fpu     : yes
fpu_exception   : yes
cpuid level : 5
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 popcnt lahf_lm extapic altmovcr8 abm sse4a misalignsse
bogomips    : 5203.98
TLB size    : 1104 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: <NULL>

processor   : 3
vendor_id   : AuthenticAMD
cpu family  : 16
model       : 8
model name  : Six-Core AMD Opteron(tm) Processor 8435
stepping    : 0
cpu MHz     : 2599.942
cache size  : 512 KB
fpu     : yes
fpu_exception   : yes
cpuid level : 5
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 popcnt lahf_lm extapic altmovcr8 abm sse4a misalignsse
bogomips    : 5204.36
TLB size    : 1104 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: <NULL>

processor   : 4
vendor_id   : AuthenticAMD
cpu family  : 16
model       : 8
model name  : Six-Core AMD Opteron(tm) Processor 8435
stepping    : 0
cpu MHz     : 2599.942
cache size  : 512 KB
fpu     : yes
fpu_exception   : yes
cpuid level : 5
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 popcnt lahf_lm extapic altmovcr8 abm sse4a misalignsse
bogomips    : 5202.95
TLB size    : 1104 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: <NULL>

processor   : 5
vendor_id   : AuthenticAMD
cpu family  : 16
model       : 8
model name  : Six-Core AMD Opteron(tm) Processor 8435
stepping    : 0
cpu MHz     : 2599.942
cache size  : 512 KB
fpu     : yes
fpu_exception   : yes
cpuid level : 5
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 popcnt lahf_lm extapic altmovcr8 abm sse4a misalignsse
bogomips    : 5202.73
TLB size    : 1104 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: <NULL>

Here's another EXAMPLE!@^%$(()!!!!!

$ xsos --C cpuinfo
CPU
  2 logical processors
  1 Dual-Core AMD Opteron(tm) Processor 8218 (flags: lm,pae)
-------------------------------------------------------------------------------

$ cat cpuinfo
processor   : 0
vendor_id   : AuthenticAMD
cpu family  : 15
model       : 65
model name  : Dual-Core AMD Opteron(tm) Processor 8218
stepping    : 2
cpu MHz     : 2612.037
cache size  : 1024 KB
fpu     : yes
fpu_exception   : yes
cpuid level : 1
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good pni cx16 lahf_lm extapic
bogomips    : 5224.07
TLB size    : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp tm stc

processor   : 1
vendor_id   : AuthenticAMD
cpu family  : 15
model       : 65
model name  : Dual-Core AMD Opteron(tm) Processor 8218
stepping    : 2
cpu MHz     : 2612.037
cache size  : 1024 KB
fpu     : yes
fpu_exception   : yes
cpuid level : 1
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good pni cx16 lahf_lm extapic
bogomips    : 5224.07
TLB size    : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp tm stc

xsos --lspci showing extra blank line

Odd extra blank line showed up with v0.0.8b. Blank line wasn't there in earlier versions.

LSPCI
  Net:
    1 Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01)

  VGA:
    VMware SVGA II Adapter

Running xsos results in "declare: -A: invalid option" error

Running xsos permanently changes the terminal font color to cyan. It also causes the errors mentioned in subject.

[root@58n ~]# ./xsos -o
./xs: line 38: declare: -A: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
./xs: line 196: declare: -A: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
OS
  Hostname:  58n
  Distro:    Red Hat Enterprise Linux Server release 5.8 (Tikanga)
  Kernel:    2.6.18-308.16.1.el5
  Runlevel:  N 5 (default: 5)
  SELinux:   enforcing (default: enforcing)
  Sys time:  Tue Oct 23 21:15:45 EDT 2012
  Boot time: Fri Oct 19 11:09:21 EDT 2012 (1350659361)
  Uptime:    4 days, 10:06,  3 users
  LoadAvg:   0.00 (0%), 0.00 (0%), 0.00 (0%)
  Cpu time since boot:
    us 0%, ni 0%, sys 0%, idle 100%, iowait 0%, irq 0%, sftirq 0%, steal 0%
  procs_running (procs_blocked):
    2 (0)
  Kernel taint-check: 0 (kernel untainted)
  Kernel cmdline:
    ro root=/dev/VolGroup00/LogVol00 enforcing=1
  Kernel build from dmesg:
    Linux version 2.6.18-308.16.1.el5 ([email protected]) 
    (gcc version 4.1.2 20080704 (Red Hat 4.1.2-52)) #1 SMP Tue Sep 18 07:21:07 
    EDT 2012
-------------------------------------------------------------------------------

Furthermore, running xsos with one of the special options (like --C) causes another error (\033[1;36m: syntax error: operand expected (error token is "\033[1;36m")) and does not print the output expected.

[root@58n ~]# ./xs --C /proc/cpuinfo
./xs: line 38: declare: -A: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
./xs: line 196: declare: -A: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
./xs: line 219: \033[1;36m: syntax error: operand expected (error token is "\033[1;36m")
OS
  Hostname:  58n
  Distro:    Red Hat Enterprise Linux Server release 5.8 (Tikanga)
  Kernel:    2.6.18-308.16.1.el5
  Runlevel:  N 5 (default: 5)
  SELinux:   enforcing (default: enforcing)
  Sys time:  Tue Oct 23 21:16:03 EDT 2012
  Boot time: Fri Oct 19 11:09:21 EDT 2012 (1350659361)
  Uptime:    4 days, 10:06,  3 users
  LoadAvg:   0.00 (0%), 0.00 (0%), 0.00 (0%)
  Cpu time since boot:
    us 0%, ni 0%, sys 0%, idle 100%, iowait 0%, irq 0%, sftirq 0%, steal 0%
  procs_running (procs_blocked):
    2 (0)
  Kernel taint-check: 0 (kernel untainted)
  Kernel cmdline:
    ro root=/dev/VolGroup00/LogVol00 enforcing=1
  Kernel build from dmesg:
    Linux version 2.6.18-308.16.1.el5 ([email protected]) 
    (gcc version 4.1.2 20080704 (Red Hat 4.1.2-52)) #1 SMP Tue Sep 18 07:21:07 
    EDT 2012
-------------------------------------------------------------------------------
CPU
  1 logical processors 
  QEMU Virtual CPU version (cpu64-rhel6) (flags: lm,pae) 
-------------------------------------------------------------------------------
MEMORY
  RAM:
    0.5g total [0.4g (87%) used]
    0.2g (37%) used excluding buffers/cache
    0.00g (0%) dirty
  HugePages:
    ZERO ram pre-allocated to HugePages
  LowMem/Slab/PageTables/Shmem:
    0.4g (87%) of 0.5g LowMem in-use
    0.04g (9%) of total ram used for Slab
    0.01g (1%) of total ram used for PageTables
  Swap:
    0.0g (0%) used of 2.5g total
-------------------------------------------------------------------------------

--cpu/-c/--C reporting improper number of cores

$ x --C cpuinfo 
CPU
  64 logical cpus (ht,lm,pae,vmx)
  8 Intel Xeon CPU E7- 2830 @ 2.13GHz, 10 cores/ea
$ grep cpu.cores cpuinfo | sort -u
cpu cores   : 8
$ grep core.id cpuinfo | sort | uniq -c
      5 core id     : 0
      8 core id     : 1
      7 core id     : 2
      6 core id     : 3
      6 core id     : 4
      6 core id     : 5
      6 core id     : 6
      7 core id     : 7
      8 core id     : 8
      5 core id     : 9

--disks option not properly-handling mutlipath output on rhel6.3?

Turns out that xsos doesn't handle multipath command output from rhel6. Whoops. Hadn't noticed. Thanks so much to Mr. Markovic for pointing it out!!

After he brought it to my attention, this is what I noticed..

xsos could parse multipath from rhel5 just fine, at least when there were friendly names, e.g. this:

mpath9 (00000000000000000blahblahblah00000000) dm-11 IBM,2145
[size=50G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=50][active]
 \_ 3:0:6:1 sdy 65:128 [active][ready]
\_ round-robin 0 [prio=20][enabled]
 \_ 3:0:4:1 sdq 65:0   [active][ready]
 \_ 3:0:5:1 sdu 65:64  [active][ready]

And there were a few allowances in there for the differences with rhel4 as well.

However, rhel6 output like this was not taken into account:

123456787012812blahblahblah dm-2 NETAPP,LUN
size=250G features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=4 status=active
| |- 4:0:0:2 sdc 8:32  active ready running
| |- 4:0:2:2 sdg 8:96  active ready running
| |- 5:0:0:2 sdk 8:160 active ready running
| `- 5:0:3:2 sdq 65:0  active ready running
`-+- policy='round-robin 0' prio=1 status=enabled
  |- 4:0:3:2 sdi 8:128 active ready running
  |- 4:0:1:2 sde 8:64  active ready running
  |- 5:0:1:2 sdm 8:192 active ready running
  `- 5:0:2:2 sdo 8:224 active ready running

RFE: Improve SELinux detection in sosreports by looking at dmesg

Currently, xsos --os tries to detect the current enforcing mode as well as what the config-default mode is.

With sosreports, this checks for the output of sestatus as well as from /etc/selinux/config. Often this file is missing in sosreports, and instead we have a dangling symlink in /etc/sysconfig/selinux. In these cases, /proc/cmdline is checked to see if selinux was disabled/set permissive/enforcing via a kernel arg.

Failing all that, a line like this is printed:

  SELinux:   status unknown  (default unknown)

One more place to check: dmesg.

$ ll etc/sysconfig/selinux etc/selinux/config
ls: cannot access etc/selinux/config: No such file or directory
lrwxrwxrwx. 1 rsaw rsaw 17 Dec  7 18:06 etc/sysconfig/selinux -> ../selinux/config
$ egrep -i 'selinux=.|enforcing=.' proc/cmdline || echo oh noes
oh noes
$ grep -i selinux var/log/dmesg 
SELinux:  Initializing.
SELinux:  Starting in permissive mode
selinux_register_security:  Registering secondary module capability
SELinux:  Registering netfilter hooks
SELinux:  Disabled at runtime.
SELinux:  Unregistering netfilter hooks
type=1404 audit(1338760191.781:2): selinux=0 auid=4294967295 ses=4294967295

Boom. Easy fix.

Disk code should make use of /proc/scsi/scsi for something cool

Not doing anything at all with it yet and don't have any ideas. Seems pretty useless since sosreports don't also capture data from /sys. Honestly I think it's crazy that lsscsi isn't on every linux system by default. If that was included in sosreports it'd be great.

If you have ideas what to do with /proc/scsi/scsi, considering that we don't have info from /sys ... well, speak up.

--disks doesn't take into account EMC/Veritas/Hitachi multipath

Yep. That's true.

Let's say you have 65 scsi disks (i.e. /dev/sdaf) on your system -- 64 of which are multipathed devices ...

If the Linux native multipathd is managing all those, xsos will be able to detect the mpath devices (and display info on them) and will hide all the child paths (i.e. the scsi disk paths) from the regular disk printout, leaving the regular disk printout to only show the one local scsi disk.

On the other hand, if all those multipathed disks are provided by some other multipath service like EMC's powerpath, xsos --disks isn't going to know anything about them and the regular disk printout is going to show 65 scsi disks.

I'd obviously like to do something about this but haven't started digging around in any emc/veritas/hdlm sosreports.

rescue mode is not taken into account

The xsos --os output looks for kernel args in /proc/cmdline and so if you gather a sosreport from rescue, well... the kernel args reflect rescue, not the kernel args as they'd be if the system booted up. grub.conf should be checked.

The same goes for the selinux check.

Even more worrisome is that xsos doesn't grab the proper hostname -- perhaps it could grab the hostname from the sosreport's /etc/sysconfig/network file?

There should at least be a warning that the sosreport was run from rescue mode.

Intel Xeon E7-8837 reported improperly by --cpu?

Found something crazy in a sosreport. 640 logical CPUs.

DMIDECODE
  BIOS:
    SGI.COM, version 2.12 UEFI2.10 PI1.0 X64, 2011-10-04
  System:
    Mfr:  Intel Corp.
    Prod: Stoutland Platform
    Vers: 1.0
    Ser:  Unknown
    UUID: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  CPU:
    8 of 8 CPU sockets populated, 0 cores/0 threads per CPU
    0 total cores, 0 total threads
    Mfr:  Intel(R) Corporation
    Fam:  Pentium 4
    Freq: 2667 MHz
    Vers: Intel(R) Xeon(R) CPU E7- 8837 @ 2.67GHz
  Memory:
    0 MB (0 GB) total
    0 of 0 DIMMs populated (system max capacity 1024 GB)

CPU
  640 logical processors (640 CPU cores)
  80 Intel Xeon CPU E7- 8837 @ 2.67GHz (flags: constant_tsc,ht,lm,pae,vmx) 
  └─8 threads / 8 cores each

MEMORY
  RAM:
    5048.7g total [305.5g (6%) used]
    298.2g (6%) used excluding buffers/cache
    0.88g (0%) dirty
  HugePages:
    ZERO ram pre-allocated to HugePages
  LowMem/Slab/PageTables/Shmem:
    2.73g (0%) of total ram used for Slab
    0.73g (0%) of total ram used for PageTables
    0.06g (0%) of total ram used for Shmem
  Swap:
    0.0g (0%) used of 8.0g total

Insaaaaane.

Here's the first and last "processors" from /proc/cpuinfo:

processor       : 0                                                                                        
vendor_id       : GenuineIntel
cpu family      : 6
model           : 47
model name      : Intel(R) Xeon(R) CPU E7- 8837  @ 2.67GHz
stepping        : 2
cpu MHz         : 2666.847
cache size      : 24576 KB
physical id     : 0
siblings        : 8
core id         : 0
cpu cores       : 8
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 x2apic popcnt lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
bogomips        : 5333.69
clflush size    : 64
cache_alignment : 64
address sizes   : 44 bits physical, 48 bits virtual
power management:

processor       : 639
vendor_id       : GenuineIntel
cpu family      : 6
model           : 47
model name      : Intel(R) Xeon(R) CPU E7- 8837  @ 2.67GHz
stepping        : 2
cpu MHz         : 2666.847
cache size      : 24576 KB
physical id     : 79
siblings        : 8
core id         : 25
cpu cores       : 8
apicid          : 5106
initial apicid  : 114
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 x2apic popcnt lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
bogomips        : 5334.24
clflush size    : 64
cache_alignment : 64
address sizes   : 44 bits physical, 48 bits virtual
power management:

Need moar configurable settings

How about some environment variables, i.e. variables for:

  • width for all content modules
  • changing the default header colors
  • changing the default view
  • disabling color by default
  • setting --mb/--kb by default
  • changing the default content separator

This will make it so that people that want to customize the default behavior don't have to use aliases (or worse) edit the code and can more easily take advantage of new updates.

Possible RFE: Log file examination?

Another one of my plans: begin building a database of error messages to search for in log files. Might end up being a separate tool though. Speak up if you've got suggestions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.