From: Steven Baltakatei Sandoval Date: Tue, 27 Oct 2020 18:58:29 +0000 (+0000) Subject: feat(exec/temp):Log hostname in polling script X-Git-Url: https://zdv2.bktei.com/gitweb/EVA-2020-02.git/commitdiff_plain/090dcb1a0c03dce9f47a63e5c7ca51b33c86081a?ds=sidebyside;hp=-c feat(exec/temp):Log hostname in polling script --- 090dcb1a0c03dce9f47a63e5c7ca51b33c86081a 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)