Skip to content

Instantly share code, notes, and snippets.

@Pitriss
Created November 24, 2020 18:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pitriss/6c7439e75024de60fe09af2a8f0766c0 to your computer and use it in GitHub Desktop.
Save Pitriss/6c7439e75024de60fe09af2a8f0766c0 to your computer and use it in GitHub Desktop.
Emulation of hddtemp to show rPi4 temp in monitoring
#!/usr/bin/ruby
require 'socket'
server = TCPServer.new 7634
while session = server.accept
temp = File.read("/sys/class/thermal/thermal_zone0/temp").chomp
temp = temp.to_i / 1000
session.print "|/dev/cpu|BCM2835|#{temp.to_i}|C|"
session.close
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment