Skip to content

f0restolf/CC-SFP-module-sensor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors