minor fixes to influxdb plugin
This commit is contained in:
parent
674750a02e
commit
48a925ee7e
2 changed files with 9 additions and 16 deletions
plugins/influxdb
|
@ -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)
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import setuptools
|
||||
|
||||
version = '0.1.0'
|
||||
version = '0.1.1'
|
||||
|
||||
setuptools.setup(
|
||||
name="alerta-influxdb",
|
Loading…
Add table
Add a link
Reference in a new issue