Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSCHECK and FIREWALL only run against a sosreport directory #267

Open
rfc1459 opened this issue Nov 3, 2021 · 1 comment
Open

SSCHECK and FIREWALL only run against a sosreport directory #267

rfc1459 opened this issue Nov 3, 2021 · 1 comment

Comments

@rfc1459
Copy link

rfc1459 commented Nov 3, 2021

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]}" '

@sukmoonlee
Copy link

i had same issue. so i fix so as below.

https://github.com/sukmoonlee/xsos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants