-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Labels
Comments
Examplepackage 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
|
amarinderca
added a commit
to amarinderca/gopsutil
that referenced
this issue
Apr 6, 2024
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
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
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):
ver
]/etc/os-release
and the result ofuname -a
]sw_vers
anduname -a
freebsd-version -k -r -u
anduname -a
]Additional context
Please see original bug report on telegraf project: influxdata/telegraf#12977
The text was updated successfully, but these errors were encountered: