Passing variables to kapacitor

kapacitor

#1

I am beginning to think Kapacitor is not designed for my use case. I have users(clients) mapped to specific sensors with matching identifiers. When I insert data into influx from a specific sensor and try to send alerts to them, I need to know what their min and max level of alerts are(the can configure this themselves) and not just hard code it as I have mostly seen in the examples. Is it possible to pass values to Kapacitor or somehow link it up with my external db?


#2

I think we would need some more info. So you have data flowing through Kapacitor and you want to cross reference it with another DB?

If you have any examples(even not working) you should post them


#3

Thanks for the response. I will describe what I want to achieve and you can tell me if this is possible with influx and Kapacitor.

We have instruments fitted with sensors for example temperature and sold to end users. We can have one or more users in an instrument and each user can configure a threshold for alerts which can have a minimum or maximum value depending on the sensor and of course they will have different email addresses or even mobile numbers as these are options for alerting.

When I currently upload data to influx(I am still in the testing phase before we make a final decision), there is a unique id that I can use to identify the instrument and the users mapped to that instrument with their respective sensor threshold values. This is what I expect to trigger the alert with and also send them a corresponding message.

So yes, it will be nice if I can cross reference it with our in house db actually hosted on aws. One of the ways I want to solve this problem is to obtain say for every 20 mins the min and max of my measurements in Kapacitor and then post this to an api end point and continue processing from there but this is a bit hacky and if I could do everything within an established architecture, this would be preferable.

A second challenge I have is aggregating data over space. Our instrument sends coordinates along with values so I would like a query to get say a daily data of the mean hourly values of the coordinates. So I have this query: SELECT MEAN(“data”) FROM “temperature” WHERE “id” =‘xxxxxx’ AND “time” >=‘2018-10-30 22:00:00’ and “time” >= ‘2018-10-16 22:00:00’ GROUP BY time(1h), x_cord, y_cord this gives me the hourly aggregate of all coordinates but I need to further reduce this to daily values of these mean hourly coordinate values.

PS: I noticed the group by time is buggy. If I don’t add a where clause, it returns with some timestamps that don’t even exist in my data but this is a conversation for a different thread.