Skip to content

SSCHECK and FIREWALL only run against a sosreport directory #267

Description

@rfc1459

Trying to run xsos -FSx on a live system fails because both modules unconditionally look for sosreport files:

# xsos -FSx
SS CHECK
  Sessions:
    Proto Local Peer sock_drop app_limited dsack_dups lost reord_seen back_log retrans_total rq tq %CPU %MEM User Command
    ----- ----- ---- --------- ----------- ---------- ---- ---------- -------- ------------- -- -- ---- ---- ---- -------

FIREWALL
  Services enabled:
    No firewall services enabled.

  Rules loaded:
    No rules loaded.
cat: /ps: No such file or directory
cat: /ps: No such file or directory
cat: /ps: No such file or directory
cat: /ps: No such file or directory
cat: /sos_commands/networking/ss_-peaonmi: No such file or directory
/usr/local/bin/xsos: line 3760: /sos_commands/systemd/systemctl_status_--all: No such file or directory
/usr/local/bin/xsos: line 3760: /sos_commands/systemd/systemctl_status_--all: No such file or directory
/usr/local/bin/xsos: line 3760: /sos_commands/systemd/systemctl_status_--all: No such file or directory

Looking at the relevant source, the code for handling a live system is missing (using SSCHECK as an example, FIREWALL has the same issue):

xsos/xsos

Lines 3415 to 3430 in 81e7575

# These are used later to print the name, cpu and mem of the process owner of the socket.
pids=$(cat $1/ps | tr -d '()[]' | tr -s ' ' | cut -d' ' -f2)
cmds=$(cat $1/ps | tr -d '()[]' | tr -s ' ' | cut -d' ' -f11)
cpus=$(cat $1/ps | tr -d '()[]' | tr -s ' ' | cut -d' ' -f3)
mems=$(cat $1/ps | tr -d '()[]' | tr -s ' ' | cut -d' ' -f4)
# These fields have format "name value". Add them a ":" so they have the same format as the other fields (name: value)
cat "$1/sos_commands/networking/ss_-peaonmi" | sed \
-e 's/ send / send:/' \
-e 's/ pacing_rate / pacing_rate:/' \
-e 's/ delivered / delivered:/' \
-e 's/ delivery_rate / delivery_rate:/' |
gawk -vpid_list="$pids" -vcmd_list="$cmds" -vmem_list="$mems" -vcpu_list="$cpus" \
-vcheck_fields_str="${XSOS_SS_CHECK_FIELDS}" \
-vI="$XSOS_INDENT_H1" -vcH1="${c[H1]}" -vcH2="${c[H2]}" -vcH3="${c[H3]}" -vc0="${c[0]}" '

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions