3
votes

My setup has mosquitto 1.4.12 using TLS and user/pass authentication, it is working without issues under Ubuntu 14.04 for quite some time.

Problem is that no data is being published to any $SYS broker status topics. I have reviewed the configuration and sys_interval is set to 10. Is anything else needed to have this working?

I've tried many clients (mosquitto_sub, paho-mqtt, mqtt.fx), so it looks like a wrong mosquitto config, not a client issue.

mosquitto.conf looks like this:

sys_interval 10

max_queued_messages 10000
max_inflight_messages 100
max_connections -1

connection_messages true
log_dest stderr
log_type error
log_type warning
log_type notice
log_type information
log_type all
log_timestamp true

password_file /etc/mosquitto/conf.d/jp.pw
acl_file /etc/mosquitto/conf.d/acl.conf

persistence true
persistence_location /var/lib/mosquitto/
persistence_file mosquitto.db
persistent_client_expiration 1m
autosave_interval 600
retained_persistence true

listener 8883
tls_version tlsv1.2

cafile /etc/mosquitto/ca_certificates/ca.crt
certfile /etc/mosquitto/ca_certificates/cert.crt
keyfile /etc/mosquitto/ca_certificates/cert.key
require_certificate false
allow_anonymous false

acl.conf has this, may be unnecessary:

user test
topic #
1
What exactly are you subscribing to? the $SYS topics will not show up in a # subscription. You have to subscribe to $SYS/# to see all the datahardillb
yes @hardillb , I am subscribing to specific topics like $SYS/broker/clients/active or $SYS/broker/uptimegcw
In that case edit the question to include your mosquitto.conf and any ACL you have set up so we can see what you've got setuphardillb
just done it, @hardillb. thanks.gcw
Add a extra topic line that ends in $SYS/# just in case the came matching for topics is used for checking ACLshardillb

1 Answers

5
votes

The topic filter in the ACL applies the same rules as normal wildcard handling so just allowing access to # will not cover the `$SYS/#' topics.

You need to add a extra topic line to the ACL to include the $SYS topics:

user test
topic #
topic $SYS/#