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

Update GetNetOverflow function to use nstat instead of netstat #277

Closed
ja20222 opened this issue Apr 4, 2023 · 2 comments · Fixed by #301
Closed

Update GetNetOverflow function to use nstat instead of netstat #277

ja20222 opened this issue Apr 4, 2023 · 2 comments · Fixed by #301
Labels
enhancement New feature or request good-first-issue Good for newcomers

Comments

@ja20222
Copy link

ja20222 commented Apr 4, 2023

nstat is installed on linux by default so we can use that instead of relying on netstat.

To get the network overflow run the following command:

$ nstat -az | grep -i TcpExtListenOverflows

which will return the following output:

TcpExtListenOverflows           0                  0.0

The NGINX Agent should parse the particular output and populate the float64 :

func GetNetOverflow() (float64, error) {

Ensure consistent output - Rocky Linux 9 (x86_64) and AlmaLinux 8 (x86_64), Ubuntu 22, RHEL 8, SUSE 15, FreeBSD 13 (pasted in the PR output)

@Dean-Coakley Dean-Coakley added enhancement New feature or request good-first-issue Good for newcomers labels Apr 4, 2023
@Harshitsoni2000
Copy link

Hi @Dean-Coakley , @ja20222 . I would love to work on this issue. Could you throw some light on how I can begin?

@Dean-Coakley
Copy link
Contributor

Hi @Harshitsoni2000

First I recommend following this section of our README to setup a development environment: https://github.com/nginx/agent#development-environment-setup

If that goes ok, some steps to get started:

  1. Replace the usage of netstat command with nstat -az in
    func GetNetOverflow() (float64, error) {
  2. Replace the regex to parse the new value correctly:
    reTimesOverflowed = regexp.MustCompile("times the listen queue of a socket overflowed")
  3. Enable parsing of NetOverflow on linux

u5surf added a commit to u5surf/agent that referenced this issue Apr 23, 2023
* use nstat -az
* fix nginx#277 partially
u5surf added a commit to u5surf/agent that referenced this issue Apr 24, 2023
* use nstat -az
* fix nginx#277 partially
dhurley pushed a commit that referenced this issue May 3, 2023
* use nstat -az
* fix #277 partially
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good-first-issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants