mcmxii
February 11, 2018, 4:37am
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
alfijr
October 17, 2018, 10:55pm
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: Security in AWS IoT - AWS IoT Core
Going to attempt same thing and will update if successful.
What errors are you seeing when trying this configuration?
dg
mcmxii
November 4, 2018, 8:13am
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”,
]
2 Likes
Hi,
Is this configuration still working?
I am trying to subscribe to data from AWS iot core using telegraf but does not seem to get the authentication correct.
This is my configuration file in telegraf v1.13.3:
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://xxxxxxxxxx-ats.iot.eu-north-1.amazonaws.com:8883”] #8883
Topics that will be subscribed to.
topics = [
“Sensor/Temperature”,
]
qos = 0
connection_timeout = “30s”
persistent_session = false
## Optional TLS Config
ssl_ca = “/home/telegraf/etc/AmazonRootCA1.pem”
ssl_cert = “/home/telegraf/etc/xxxxxxxxxx-certificate.pem”
ssl_key = “/home/telegraf/etc/xxxxxxxxxx-private.pem”
## Use TLS but skip chain & host verification
insecure_skip_verify = true
data_format = “influx”
Getting this error in the log in AWS iot core
{
“timestamp”: “2020-02-26 09:26:10.104”,
“logLevel”: “ERROR”,
“traceId”: “2f048bd9-0bc2-807c-b166-2d8bf072b455”,
“accountId”: “060935925196”,
“status”: “Failure”,
“eventType”: “Connect”,
“protocol”: “MQTT”,
“clientId”: “Telegraf-Consumer-vEPlO”,
“principalId”: “e54b5351fb77137d93154068e965bb72f50fe91e21d20cce35c5fcbb28397d8e”,
“sourceIp”: “13.53.43.19”,
“sourcePort”: 39754,
“reason”: “AUTHORIZATION_FAILURE”,
“details”: “Authorization Failure”
}
In telegraf debug it only writes
[inputs.mqtt_consumer] Connecting [ssl://a2m4idry5khnfp-ats.iot.eu-north-1.amazonaws.com:8883]
and nothing happens.
Any ideas what I am missing?
I found the problem, the setup in Telegraf was correct.
I had missed to configure the AWS iot security policy for the certificate used for this communication.
1 Like