This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

influxdb
#1
I want to store LM object (values) data in an influxdb database, does anybody have any experience with this?

Their documentation (https://docs.influxdata.com/influxdb/v1....ting_data/) says that you can use the http api for storing data like this;
Code:
curl -i -XPOST 'http://localhost:8086/write?db=mydb' --data-binary 'cpu_load_short,host=server01,region=us-west value=0.64 1434055562000000000'

Is this possible from lua in the LM? 

Thanks Mischa
Reply
#2
Code:
http = require('socket.http')
http.TIMEOUT = 5
res, err = http.request('http://192.168.1.2:8086/write?db=mydb', 'cpu_load_short,host=server01,region=us-west value=0.64')
log(res, err)
Reply
#3
(13.08.2018, 11:25)admin Wrote:
Code:
http = require('socket.http')
http.TIMEOUT = 5
res, err = http.request('http://192.168.1.2:8086/write?db=mydb', 'cpu_load_short,host=server01,region=us-west value=0.64')
log(res, err)

Thanks, works perfectly.
Reply


Forum Jump: