[Git][NTPsec/ntpsec][master] Change smartctl-temp-log

Gary E. Miller gitlab at mg.gitlab.com
Sat Jan 21 04:32:04 UTC 2017


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
f96c2d19 by James Browning at 2017-01-20T20:31:25-08:00
Change smartctl-temp-log

* Print device node path instead of uninformative 'SMART'
* Grab the 8th field instead of the 1st to provide real temp not arbitrary number

Signed-off-by: Gary E. Miller <gem at rellim.com>

- - - - -


1 changed file:

- contrib/smartctl-temp-log


Changes:

=====================================
contrib/smartctl-temp-log
=====================================
--- a/contrib/smartctl-temp-log
+++ b/contrib/smartctl-temp-log
@@ -70,7 +70,7 @@ except OSError as e:
 lines = output.split('\n')
 
 # this regex matches temperature output lines from 'sensors -u'
-pat = re.compile('194 Temperature_Celsius\s+\S+\s+(\d+)\s+')
+pat = re.compile('194 Temperature_Celsius\s+\S+\s+\d+\s+\d+\s+\d+\s+\S+\s+\S+\s+\S+\s+(\d+)')
 
 now = int(time.time())
 
@@ -79,4 +79,4 @@ for line in lines:
     match = pat.match(line)
     if match and match.group(1):
         temp = match.group(1)
-        sys.stdout.write('%d SMART %s\n' % (now, temp))
+        sys.stdout.write('%d %s %s\n' % (now, device, temp))



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/f96c2d19257ad9ecfab5a24466360334e32fcf9c
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170121/2050f5ee/attachment.html>


More information about the vc mailing list