From 090dcb1a0c03dce9f47a63e5c7ca51b33c86081a Mon Sep 17 00:00:00 2001 From: Steven Baltakatei Sandoval Date: Tue, 27 Oct 2020 18:58:29 +0000 Subject: [PATCH 1/1] feat(exec/temp):Log hostname in polling script --- exec/temperature/DS18B20..temp_poll.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/exec/temperature/DS18B20..temp_poll.py b/exec/temperature/DS18B20..temp_poll.py index 21a727b..f15926c 100755 --- a/exec/temperature/DS18B20..temp_poll.py +++ b/exec/temperature/DS18B20..temp_poll.py @@ -4,6 +4,7 @@ import os import glob import time from time import strftime +import socket os.system('modprobe w1-gpio') os.system('modprobe w1-therm') @@ -36,5 +37,6 @@ while True: nowTimeIso8601 = strftime("%Y%m%dT%H%M%S%z") nowTimeUE = strftime("%s") nowTemp = read_temp() - print(str(nowTimeIso8601) + ',' + str(nowTimeUE) + ',' + str(nowTemp)) + myHostname = socket.gethostname() + print(str(nowTimeIso8601) + ',' + str(nowTimeUE) + ',' + str(myHostname) + ',' + str(nowTemp)) time.sleep(1) -- 2.30.2