You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to match a process that is owned by a user with a long name fails to match using check-process.rb -u longusername
It appears this line in check-process.rb: 229 >> read_lines('ps axwwo user,pid,vsz,rss,pcpu,nlwp,state,etime,time,command').drop(1).map do |line|
Uses ps which by default truncates the username at 7 characters (adding a + at the end to indicate that the field is truncated). A possible fix for this would be to specify the length of the user field. I've tried this on a few flavors of linux successfully, but not an exhaustive test.
229 >> read_lines('ps axwwo user:30,pid,vsz,rss,pcpu,nlwp,state,etime,time,command').drop(1).map do |line|
It seems to make more sense to make the user column display length of the ps call set based on the length of the -u query so that it would have sufficient length to match the user delimiter parameter in the check.
The text was updated successfully, but these errors were encountered:
makayez
changed the title
check-process.rb: Processes owned by users with names longer than 7 characters cannot be matched
check-process.rb: Processes owned by users with names longer than 7 characters cannot be matched using -u switch
Jun 10, 2020
When trying to match a process that is owned by a user with a long name fails to match using check-process.rb -u longusername
It appears this line in check-process.rb:
229 >> read_lines('ps axwwo user,pid,vsz,rss,pcpu,nlwp,state,etime,time,command').drop(1).map do |line|
Uses ps which by default truncates the username at 7 characters (adding a + at the end to indicate that the field is truncated). A possible fix for this would be to specify the length of the user field. I've tried this on a few flavors of linux successfully, but not an exhaustive test.
229 >> read_lines('ps axwwo user:30,pid,vsz,rss,pcpu,nlwp,state,etime,time,command').drop(1).map do |line|
It seems to make more sense to make the user column display length of the ps call set based on the length of the -u query so that it would have sufficient length to match the user delimiter parameter in the check.
The text was updated successfully, but these errors were encountered: