minor fixes to influxdb plugin

This commit is contained in:
Nick Satterly 2014-10-03 13:35:18 +01:00
parent 674750a02e
commit 48a925ee7e
2 changed files with 9 additions and 16 deletions
plugins/influxdb

View file

@ -14,27 +14,20 @@ INFLUXDB_PASSWORD = 'alerta'
class InfluxDBWrite(PluginBase):
def __init__(self):
self.endpoint = 'http://localhost:8086'
def pre_receive(self, alert):
pass
def post_receive(self, alert):
url = self.endpoint + '/db/alerta/series'
url = INFLUXDB_URL + '/db/alerta/series'
data = [
{
"name": alert.event,
"columns": ["value", "environment", "resource"],
"points": [
[alert.value, alert.environment, alert.resource]
]
}
]
data = [{
"name": alert.event,
"columns": ["value", "environment", "resource"],
"points": [
[alert.value, alert.environment, alert.resource]
]
}]
LOG.debug('InfluxDB data: %s', data)

View file

@ -2,7 +2,7 @@
import setuptools
version = '0.1.0'
version = '0.1.1'
setuptools.setup(
name="alerta-influxdb",