Created
November 24, 2020 18:55
-
-
Save Pitriss/6c7439e75024de60fe09af2a8f0766c0 to your computer and use it in GitHub Desktop.
Emulation of hddtemp to show rPi4 temp in monitoring
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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