I’m working on running Telegraf on AWS, then using webhooks to talk to it. I’m really hoping to stay with the Particle.publish() system, rather than adding on MQTT or something along those lines, primarily due to flash space issues. Working from a suggestion from @sja, I’ve gone through the following steps:
Registered a domain through AWS Route53
Created an instance of the Amazon Linux AMI
Installed and config’d InfluxDB and Telegraf on the VM.
Created a Network ELB and pointed the domain alias to the ELB.
When I try to test the webhook through the Particle console, I’m getting a ‘socket hang up’ error. I strongly suspect the issue is in my ELB Listener and Target configs, but I’m not certain exactly how they need to be set up. My thoughts are as follows:
Telegraf uses port 1619
HTTPS uses 443
So I should be listening on 443 and forwarding that to my vm target on 1619?
I’m definitely in over my head here, but it would be incredibly helpful if I could get this up and running. Does anyone have any thoughts?
Hmm, turns out that’s the wrong Telegraf, turns out there’s that one, an add-on for a messaging service, and then there’s InfluxData Telegraf, the one I need. Which apparently won’t work in a Lambda. Ah well, back to poking at it…
I am running my solution on DigitalOcean but otherwise it is just a cloud VM with Telegraf / InfluxDB so it should work the same. A closer match to my solution would be a simple VM on AWS Lightsail with the Telegraf port exposed.
I would suggest breaking down the issue like this:
Make sure the Telegraf webhook input is working by testing with curl or some other tool. You should either see data show up in InfluxDB or some related errors in the Telegraf logs (or no response indicating Telegraf is not reachable - could be an AWS routing issue).
Instead of using the Particle Webhook Console "Test" feature, publish test data from a Particle device with an appropriately formatted JSON payload. The test feature will connect to Telegraf but produce an error because Telegraf won't be able to parse the test data.