Skip to content

Instantly share code, notes, and snippets.

@yunazuno
yunazuno / ethtool.py
Last active December 18, 2025 07:15
ethtool -S in Python
#!/usr/bin/env python
import socket
import fcntl
import struct
import array
SIOCETHTOOL = 0x8946
ETHTOOL_GSTRINGS = 0x0000001b
ETHTOOL_GSSET_INFO = 0x00000037
ETHTOOL_GSTATS = 0x0000001d