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

[network] Use ss instead of netstat on linux #1859

Merged
merged 4 commits into from
Sep 24, 2015

Conversation

olivielpeau
Copy link
Member

netstat is deprecated on many distributions, ss is its replacement and is present by default in the PATH on most of the distributions that I've tested (CentOS >= 6, Ubuntu >= 12.04, but not on CentOS 5).

We still fallback to netstat if ss is not installed.

Addresses #1156

I've also checked that subprocess.Popen doesn't hang with stdout=PIPE: as long as we use it with communicate() (which we do here) we should be fine.

@olivielpeau olivielpeau added this to the 5.6.0 milestone Aug 25, 2015
@remh
Copy link

remh commented Aug 25, 2015

Nice. Can you write a test that checks that the metrics collected are equivalent ?

@remh
Copy link

remh commented Aug 25, 2015

Also can you switch to this helper ? https://github.com/DataDog/dd-agent/blob/master/utils/subprocess_output.py

It will be easier to debug and is safer to use

@olivielpeau olivielpeau force-pushed the olivielpeau/network-use-ss branch from 91e529e to 00ae20d Compare August 25, 2015 23:50
`netstat` is deprecated on many distributions, `ss` is its
replacement. It brings perf improvements especially on systems
that have lots of connections.

We still use `netstat` as a fallback if `ss` is not installed.
@hkaj
Copy link
Member

hkaj commented Sep 21, 2015

LGTM

@olivielpeau
Copy link
Member Author

Thanks @hkaj and @remh for your reviews, merging.

olivielpeau added a commit that referenced this pull request Sep 24, 2015
[network] Use `ss` instead of `netstat` on linux
@olivielpeau olivielpeau merged commit 76459c8 into master Sep 24, 2015
@olivielpeau olivielpeau deleted the olivielpeau/network-use-ss branch September 24, 2015 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants