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

Only bytes received and sent being reported for OpenBSD hosts #1441

Closed
2 of 6 tasks
amarinderca opened this issue Mar 29, 2023 · 2 comments
Closed
2 of 6 tasks

Only bytes received and sent being reported for OpenBSD hosts #1441

amarinderca opened this issue Mar 29, 2023 · 2 comments

Comments

@amarinderca
Copy link
Contributor

Describe the bug

We are only getting bytes received and sent being reported correctly on OpenBSD. Everything else (packets sent, packets received, error in, error out, drop in, drop out) is reporting a value of 0.

To Reproduce

  1. Setup net plugin using official telegraf package on openbsd 7.1/7.2 to report to influxdbv2 (OpenBSD 7.1 and 7.2, telegraf 1.22.0 and telegraf 1.22.4 respectively)
  2. View the data in influxdb UI and notice that a value of 0 is being reported for all metrics except bytes received and sent

Expected behavior
Report packets sent, packets received, error in, error out, drop in, drop out in addition to bytes received and sent

Environment (please complete the following information):

  • Windows: [paste the result of ver]
  • Linux: [paste contents of /etc/os-release and the result of uname -a]
  • Mac OS: [paste the result of sw_vers and uname -a
  • FreeBSD: [paste the result of freebsd-version -k -r -u and uname -a]
  • OpenBSD: OpenBSD 7.2 GENERIC.MP#6 amd64
  • OpenBSD: OpenBSD 7.1 GENERIC.MP#3 amd64

Additional context

Please see original bug report on telegraf project: influxdata/telegraf#12977

@amarinderca
Copy link
Contributor Author

Example

package main

import (
        "fmt"
        "log"

        "github.com/shirou/gopsutil/v3/net"
)

func main() {
        // Get network statistics
        stats, err := net.IOCounters(true)
        if err != nil {
                log.Fatal(err)
        }

        // Print network statistics
        for _, stat := range stats {
                fmt.Printf("Interface: %s\n", stat.Name)
                fmt.Printf("  Bytes Sent: %d\n", stat.BytesSent)
                fmt.Printf("  Bytes Received: %d\n", stat.BytesRecv)
                fmt.Printf("  Packets Sent: %d\n", stat.PacketsSent)
                fmt.Printf("  Packets Received: %d\n", stat.PacketsRecv)
                fmt.Printf("  Errors in Sent: %d\n", stat.Errout)
                fmt.Printf("  Errors in Received: %d\n", stat.Errin)
                fmt.Printf("  Dropped Packets in Sent: %d\n", stat.Dropout)
                fmt.Printf("  Dropped Packets in Received: %d\n", stat.Dropin)
                fmt.Println()
        }
}

Output

champv1# go run test.go
Interface: lo0
  Bytes Sent: 0
  Bytes Received: 0
  Packets Sent: 0
  Packets Received: 0
  Errors in Sent: 0
  Errors in Received: 0
  Dropped Packets in Sent: 0
  Dropped Packets in Received: 0

Interface: vio0
  Bytes Sent: 9480904
  Bytes Received: 299791338
  Packets Sent: 0
  Packets Received: 0
  Errors in Sent: 0
  Errors in Received: 0
  Dropped Packets in Sent: 0
  Dropped Packets in Received: 0

Interface: vio1*
  Bytes Sent: 0
  Bytes Received: 0
  Packets Sent: 0
  Packets Received: 0
  Errors in Sent: 0
  Errors in Received: 0
  Dropped Packets in Sent: 0
  Dropped Packets in Received: 0

@amarinderca
Copy link
Contributor Author

I have confirmed that this is now fixed in telegraf as well. See influxdata/telegraf#12977 (comment)

Closing.

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