mirror of https://github.com/nicolargo/glances
Prevent exporting empty data to InfluxDB
parent
4be7c630a1
commit
2c34d463c9
|
@ -126,10 +126,12 @@ class Export(GlancesExport):
|
|||
if self.prefix is not None:
|
||||
name = self.prefix + '.' + name
|
||||
# Write input to the InfluxDB database
|
||||
try:
|
||||
self.client.write_points(self._normalize(name, columns, points))
|
||||
except Exception as e:
|
||||
logger.error("Cannot export {} stats to InfluxDB ({})".format(name,
|
||||
e))
|
||||
if len(points) == 0:
|
||||
logger.debug("Cannot export empty {} stats to InfluxDB".format(name))
|
||||
else:
|
||||
logger.debug("Export {} stats to InfluxDB".format(name))
|
||||
try:
|
||||
self.client.write_points(self._normalize(name, columns, points))
|
||||
except Exception as e:
|
||||
logger.error("Cannot export {} stats to InfluxDB ({})".format(name, e))
|
||||
else:
|
||||
logger.debug("Export {} stats to InfluxDB".format(name))
|
||||
|
|
Loading…
Reference in New Issue