MQTT from AWS IoT


#1

Hi, anyone managed to MQTT Sub to AWS IoT?

Did the following settings in telegraph.conf but can’t seems to get it to work

topics = [
“telegraf/host01/cpu”,
“telegraf/+/mem”,
“test”,
a2r4hxxxxxxx.iot.ap-southeast-1.amazonaws.com/test”,
a2r4hxxxxxxx.iot.ap-southeast-1.amazonaws.com/#
]

Optional SSL Config

ssl_ca = "/etc/telegraf/aws.pem"
ssl_cert = "/etc/telegraf/5633xxxx-certificate.pem"
ssl_key = “/etc/telegraf/563xxxxxee9f-private.pem”

Use SSL but skip chain & host verification

insecure_skip_verify = true


#2

Hi @mcmxii ,

Any luck with this, or blockers you ran into? Assuming the issue may have to do with the fact that AWS IoT only seems to support only TLS 1.2 through MQTT: https://docs.aws.amazon.com/iot/latest/developerguide/iot-security-identity.html

Going to attempt same thing and will update if successful.


#3

What errors are you seeing when trying this configuration?

dg


#4

Sorry for the late reply. I got it working after changing the sehema to ssl://xxxxxxx:8883

Read metrics from MQTT topic(s)

[[inputs.mqtt_consumer]]

MQTT broker URLs to be used. The format should be scheme://host:port,

schema can be tcp, ssl, or ws.

servers = [“ssl://a2r4xxxxxxxx.amazonaws.com:8883”]

MQTT QoS, must be 0, 1, or 2

qos = 0

Connection timeout for initial connection in seconds

connection_timeout = “30s”

Topics to subscribe to

topics = [
“telegraf/host01/cpu”,
“telegraf/+/mem”,
“Your aws iot topic”,
]