Categorygithub.com/ebikt/ethtool-exporter
modulepackage
0.1.2
Repository: https://github.com/ebikt/ethtool-exporter.git
Documentation: pkg.go.dev

# README

Ethtool Exporter

This exporter uses ethtool syscall to collect transciever diagnosis from optical ethernet cards. It does currently support only type ETH_MODULE_SFF_8472 (0x2). It was tested only with ixbge network cards, so current default search path only include devices using this driver.

It has endpoints /metrics for prometheus and /influx for scraping by telegraph.

Influx format includes also dBm values for laser input and output power, they are simply calulated from mW values provided by the transciever.

Implementation

ethtool utility reads whole eeprom, which is slow (~0.1s per transciever just reading the memory). So I reimplemented ethtool -m reading and parsing in go, with following optimizations:

  • Tags are cached by serial number of transciever, on each scraping is read only serial number (16 bytes) and other tag values are read only first time, then they are filled from cache.
  • No alert limits for metrics are read, just the metrics themselves (10 bytes)

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
merge reads with gap of at most this size between them.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author