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

SS support along with netstat #400

Open
sumitgarg44 opened this issue Oct 13, 2022 · 10 comments
Open

SS support along with netstat #400

sumitgarg44 opened this issue Oct 13, 2022 · 10 comments

Comments

@sumitgarg44
Copy link

As OS vendors are moving towards 'ss' than netstat in latest releases. I believe it will be worth to add ss support in apache2buddy script.

Regards
Sumit Garg

@richardforth
Copy link
Owner

richardforth commented Oct 13, 2022 via email

@sumitgarg44
Copy link
Author

I had one device having only SS but then I end up installing netstat temporarily :)

@richardforth
Copy link
Owner

richardforth commented Oct 13, 2022 via email

@sumitgarg44
Copy link
Author

Unfortunately I don’t remember it exactly, I believe it was Ubuntu 20 or 22 LTS

@richardforth
Copy link
Owner

richardforth commented Oct 30, 2022

# yum whatprovides ss
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager

...


iproute-4.11.0-30.el7.x86_64 : Advanced IP routing and network device configuration tools
Repo        : base
Matched from:
Filename    : /usr/sbin/ss



iproute-4.11.0-25.el7_7.2.x86_64 : Advanced IP routing and network device configuration tools
Repo        : @base
Matched from:
Filename    : /sbin/ss



iproute-4.11.0-25.el7_7.2.x86_64 : Advanced IP routing and network device configuration tools
Repo        : @base
Matched from:
Filename    : /usr/sbin/ss

@richardforth
Copy link
Owner

I'm also in the process of adding an Ubuntu 22.04 Docker file and Jenkins stage in the pipeline

@richardforth
Copy link
Owner

richardforth commented Oct 30, 2022

  1671          # Check 2.1
  1672          # this script uses netstat to determine the port that apache is listening on
  1673          # process. make sure that netstat is available.
  1674          our $netstat = `which netstat`;
  1675          chomp($netstat);
  1676
  1677          # make sure that netstat is available within our path
  1678          if ( $netstat !~ m/.*\/netstat/ ) {
  1679                  show_crit_box();
  1680                  print "Unable to locate the netstat utility. This script requires netstat to determine the port that apache is listening on.\n";
  1681                  show_info_box(); print "${YELLOW}To fix this make sure the net-tools package is installed.${ENDC}\n";
  1682                  exit;
  1683          } else {
  1684                  if ( ! $NOOK ) { show_ok_box(); print "The utility 'netstat' exists and is available for use: ${CYAN}$netstat${ENDC}\n" }
  1685          }

@richardforth
Copy link
Owner

Thinking of setting some flags, and checking for netstat, and falling back to ss, then later in the script calling netstat or ss depending on what flag is set

@richardforth
Copy link
Owner

richardforth commented Oct 30, 2022

for ss

show_info_box(); print "${YELLOW}To fix this make sure the iproute package is installed.${ENDC}\n";

@richardforth
Copy link
Owner

or im also thinking of looking for ss first, and falling back to netstat, as this will likely future proof the logic for a few years, since ss is the new preferred command and netstat is being deprecated and probably eventually removed.

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

No branches or pull requests

2 participants