Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SFP+ DDM Monitor

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.

What it monitors

  • Module temperaturetemp1_input (millidegrees C)
  • Supply voltagein1_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.

Quick install

# 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.sh

The 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

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)

Check that your transceiver supports DDM

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.

Uninstall

sudo ./uninstall.sh

Acknowledgments

I developed this project with help from Claude (Anthropic).

About

CoolerControl compatible script that gets info from the SFP modules with ethtool and makes hmon looking files that you can use with CoolerControl

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages