A small C daemon that polls ethtool -m for standard SFP+ DDM (Digital
Diagnostics Monitoring) data. It writes hwmon-format sensor files for
CoolerControl to read.
The daemon works with any SFP+ transceiver that supports DDM: copper RJ45
(RealHD, MikroTik S+RJ10, and others), SR/LR optical, DAC, and AOC. It parses
only the standard Module temperature and Module voltage fields. It ignores
all other DDM data (laser bias, optical power, and rx power). As a result,
copper transceivers that spoof optical identity work correctly.
- Module temperature →
temp1_input(millidegrees C) - Supply voltage →
in1_input(millivolts) - Alarm and warning thresholds (written one time, on the first successful read)
Only the temperature is useful in CoolerControl. I am still not sure about the other two.
# Copy this folder to the target machine
scp -r sfp-monitor/ user@hostname:~/
# Connect with SSH, then install
ssh user@hostname
cd ~/sfp-monitor
sudo ./install.shThe install script automatically detects ixgbe (Intel 82599) interfaces. If the
script finds more than one interface, it shows a numbered menu. If it finds
none, it prompts you with tab-autocomplete over all network interfaces. You can
also give the interface name directly: sudo ./install.sh enp3s0f0.
The script compiles the C source and creates a systemd service for the interface you chose. Then it enables the service, starts it, and checks the sensor output.
The default poll interval is 5 seconds. To change it, edit the third argument
of the ExecStart line in /etc/systemd/system/sfp-monitor.service. Then run:
sudo systemctl daemon-reload && sudo systemctl restart sfp-monitor| 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) |
Before you install the daemon, check that ethtool -m <interface> returns a
Module temperature line:
sudo ethtool -m <interface> | grep "Module temperature"If it does not, then the transceiver does not support DDM, or the driver needs
allow_unsupported_sfp=1. The second cause is common with ixgbe.
sudo ./uninstall.shI developed this project with help from Claude (Anthropic).