Skip to content

Latest commit

 

History

History
73 lines (52 loc) · 2.29 KB

File metadata and controls

73 lines (52 loc) · 2.29 KB

SFP+ DDM Monitor

Lightweight C daemon that polls ethtool -m for standard SFP+ DDM (Digital Diagnostics Monitoring) data and writes hwmon-format sensor files for CoolerControl to read.

Works with any SFP+ transceiver that supports DDM — copper RJ45 (RealHD, MikroTik S+RJ10, etc.), SR/LR optical, DAC, AOC. Parses only the standard Module temperature and Module voltage fields; all other DDM data (laser bias, optical power, rx power) is ignored, which means copper transceivers that spoof optical identity work fine.

What it monitors

  • Module temperaturetemp1_input (millidegrees C)
  • Supply voltagein1_input (millivolts)
  • Alarm/warning thresholds (written once on first successful read)

The first one is actually useful in CoolerControl, the other two I am still on the fence.

Quick install

# Copy this folder to the target machine
scp -r sfp-monitor/ user@hostname:~/

# SSH in and install
ssh user@hostname
cd ~/sfp-monitor
sudo ./install.sh

The install script auto-detects ixgbe (Intel 82599) interfaces. If multiple are found it presents a numbered menu; if none are found it prompts with tab-autocomplete over all network interfaces. You can also pass the interface name directly: sudo ./install.sh enp3s0f0.

The script compiles the C source, generates a systemd service for the chosen interface, enables and starts it, and verifies sensor output.

The default poll interval is 5 seconds. To change it, edit the ExecStart line in /etc/systemd/system/sfp-monitor.service (third argument) and sudo systemctl daemon-reload && sudo systemctl restart sfp-monitor.

Files installed

File Location
Binary /usr/local/bin/sfp_monitor
Service (generated) /etc/systemd/system/sfp-monitor.service
Sensor data /run/sfp-monitor/<interface>/ (tmpfs, recreated on boot)

Verify your transceiver supports DDM

Before installing, confirm ethtool -m <interface> returns a Module temperature line:

sudo ethtool -m <interface> | grep "Module temperature"

If it doesn't, the transceiver either lacks DDM support or the driver needs allow_unsupported_sfp=1 (common with ixgbe).

Uninstall

sudo ./uninstall.sh

Acknowledgments

This project was developed with assistance from Claude (Anthropic).