diff options
Diffstat (limited to 'scan.py')
-rwxr-xr-x | scan.py | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -25,9 +25,14 @@ class Prom: for field in fields: output = output + "# HELP therm_{0} {0}\n# TYPE therm_{0} gauge\n".format(field) for mac in self.collected: - output = output + "therm_{0}{{mac=\"{1}\"}} {2:f}\n".format( - field, mac, self.collected[mac][field][0] - ) + try: + output = output + "therm_{0}{{mac=\"{1}\"}} {2:f}\n".format( + field, mac, self.collected[mac][field][0] + ) + except E: + output = output + "# therm_{0}{{mac=\"{1}\"}} {2}\n".format( + field, mac, E + ) headers = HttpHeaders() headers.set('Content-type', 'text/plain; version=0.0.4; charset=utf-8; escaping=values') |