Special input lines of `Sepcs.ps_eo`
JoySnow opened this issue · 1 comments
JoySnow commented
Get the following exceptions from "Insights Times and Errors Report 2024-03-05" :
count | component | request_id | exception |
---|---|---|---|
140843 | insights.specs.Specs.ps_eo | some_request_id | ValueError("invalid literal for int() with base 10: ' 1'") |
140843 | insights.specs.Specs.sysctl | some_request_id | ValueError("invalid literal for int() with base 10: ' 1'") |
57962 | insights.specs.Specs.sysctl | some_request_id | ValueError("invalid literal for int() with base 10: 'callback 1'") |
57962 | insights.specs.Specs.ps_eo | some_request_id | ValueError("invalid literal for int() with base 10: 'callback 1'") |
The ValueError
was raised for parsing special input data of Specs.ps_eo
, some example lines:
PID PPID COMMAND NLWP
1 0 systemd 1
863 1 falcond 1
865 863 falcon-sensor 29
3106 2 NFSv4 callback 1
20570 865 falco <defunct> 1
Filled the special input data to test case in #4053 .
JoySnow commented
Noticed that all the ps command related specs in insights-core have the "COMMAND" column as the last column in command output.
Enlighted by this, we can adjust the Specs.ps_eo
's command args order to resolve this issue without touching the current Ps
parsers.
To change Specs.ps_eo
from
ps_eo = simple_command("/usr/bin/ps -eo pid,ppid,comm,nlwp")
to
ps_eo = simple_command("/usr/bin/ps -eo pid,ppid,nlwp,comm")
And the new content of Specs.ps_eo
will look like:
PS_EO_NLWP_COMM = """
PID PPID NLWP COMMAND
1 0 1 systemd
2 0 1 kthreadd
863 1 1 falcond
865 863 29 falcon-sensor
3106 2 1 NFSv4 callback
20570 865 1 falco <defunct>
"""