🎄 Happy Holidays! 🥳
Most of Solace is closed December 24–January 1 so our employees can spend time with their families. We will re-open Thursday, January 2, 2024. Please expect slower response times during this period and open a support ticket for anything needing immediate assistance.
Happy Holidays!
Please note: most of Solace is closed December 25–January 2, and will re-open Tuesday, January 3, 2023.
[Solace-prometheus-exporter] Monitor mqtt broker status
Hi everyone !
First of all, sorry for my english. I started to use Solace prometheus exporter from solacecommunity. I'am a beginner with all of these things (Solace included).
We use docker-compose to start Solace-broker:
solace-broker:
image: solace/solace-pubsub-standard:9.9.0.23
container_name: solace-broker
# For details about default configuration, see:
# https://docs.solace.com/Configuring-and-Managing/SW-Broker-Specific-Config/SW-Broker-Configuration-Defaults.htm
environment:
- username_admin_globalaccesslevel=xxx
- username_admin_password=xxx
ports:
- 55555:55555 # Solace Message Format (SMF)
- 1883:1883 # MQTT ('default' VPN)
- 8883:8883 # MQTT TLS / SSL('default' VPN)
I just downloaded exporter from here https://github.com/solacecommunity/solace-prometheus-exporter and trying to run it from docker with env.txt file.
This line should help me to link exporter with my broker SOLACE_SCRAPE_URI=http://[ip-of-my-broker]:1883 (here for MQTT ('default' VPN)).
My questions are: why there is 3 ports ? What's the difference ? How could I set SOLACE_SCRAPE_URI for all these ports ?
Because here is my issue:
I have solace_up{error=""} 1for solace-vpn-det but solace_up{error="Get \"http://[ip-of-my-broker]:1883/SEMP\": EOF"} 0 for others (like solace-broker-std).
Well maybe because i set 1883 for SOLACE_SCRAPE_URI
Our purpose is to monitor MQTT broker status.
I know this question may be so stupid, but I would like to improve on these things.
Thank you a lot and happy new year !
Answers
-
Hi @Didy7,
Your first question: Why are there so many ports ?
Solace PubSub+ can handle many protocols at the same time - you can even publish with protocal 1 and subscribe with protocol 2... and all that protocols need different ports.
For example: You can publish with SMF on port 55555 and consume your messages with MQTT over TLS on port 8883.55555 is the default port for the Solace specific messaging format (called SMF). On our homepage there are client-libraries for different programming languages available for SMF.
1883 is the standard port for plain text MQTT.
8883 is the standard port for MQTT over TLS.Your 2nd question: What does the error from the Solace prometheus exporter mean ?
Solace brokers have an option to configure and monitor things inside the broker. For this, protocols named "SEMP" and "SEMPv2" are used. Both protocols are HTTP based, both protocols are not used for messaging, but only for managing (conifguring and monitoring) the broker.
For that you need a different service inside the broker, most often available on port 80 (http plaintext) or 1943 (https). If you set this as your scrape URI that will work.Feel free to ask if you have any additional questions.
Uli
0 -
Hey.
Thank you for your answer. Wish all the best for the next year !
Here was I did :
solace-broker:
image: solace/solace-pubsub-standard:9.9.0.23
container_name: solace-broker
environment:- username_admin_globalaccesslevel=xxx
username_admin_password=xxx
ports:55555:55555 # Solace Message Format (SMF)
- 1883:1883 # MQTT ('default' VPN)
- 8883:8883 # MQTT TLS / SSL('default' VPN)
- 8080:80 # SEMP http
SOLACE_SCRAPE_URI=http://[broker-ip]:8080
Result :
solace_up{error="Get \"http://[broker-ip]:8080/SEMP\": read tcp 172.17.0.2:57812->[broker-ip]:8080: read: connection reset by peer"} 0
Did i do something wrong ?
Thank you !
0 -
hi @Didy7,
Let's check:
Can you access (with curl or wget or browser) http://[broker-ip]:8080 ?If not, please try:
docker exec -it solace cli (inside cli): show service
There are all services and ports inside the container listed and we expect something like:
... Service TP S C R VRF MsgVpn Port A O Failed Reason ---------- --- ----- ----- --------------- ----- --- -------------------------- SEMP TCP N - - Mgmt 8080 U U SEMP TCP Y - - Mgmt 1943 U U
Import here:
There is "U U" in the line with "SEMP" and "TCP" and "N" (N= no TLS).
What is port number listed here ?Please ensure that you have some port mapping in the docker run command to that port.
Uli
0 -
Hi @uherbst,
Thank you for your reply and your patience.
EDIT: I can access to my broker-ip:8080. They ask for identification.
I was using the wrong ip address...I have the same port number as you.
SEMP TCP N - - Mgmt 8080 U U
SEMP TCP Y - - Mgmt 1943 U D No Cert
---Press any key to continue, or `q' to quit---I'll try with the correct ip.
I think i need to improve eheh !For my solace-broker I use a docker-compose file. 8080 is mapped to 8080 right ?
55555:55555 # Solace Message Format (SMF)
1883:1883 # MQTT ('default' VPN)
8883:8883 # MQTT TLS / SSL('default' VPN)
8080:8080 # SEMP httpI have this on my exporter.
http://0.0.0.0:9628/solace-broker-stdsolace_up{error="Get \"http://[solace-broker]:8080/SEMP\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)"} 0
0 -
I was using the wrong ip for solace-broker. Sorry about that.
I have the same port :
SEMP TCP N - - Mgmt 8080 U U
SEMP TCP Y - - Mgmt 1943 U D No CertThis is my docker-compose.yml for my solace-broker.
55555:55555 # Solace Message Format (SMF)
1883:1883 # MQTT ('default' VPN)
8883:8883 # MQTT TLS / SSL('default' VPN)
8080:8080 # SEMP http8080 is mapped on 8080 right ? So my SOLACE_SCRAPE_URI=http://[solace-broker]:8080 should be ok ?
Now I have this on http://0.0.0.0:9628/solace-broker-std
solace_up{error="Get \"http://[solace-broker]:8080/SEMP\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)"} 0
Thank you for your help and for your patience !
0 -
Hi @Didy7,
we're getting results :-)
Obviously:
- your port mapping in docker is correct
- your SEMP port is on 8080.
Just checked the prometheus-exporter....
your definition should be:
scrapeUri=http://[solace-broker]:8080/
(Without trailing "SEMP").
Uli
0 -
Hi !
You means the scrapeuri set by my env.txt on solace exporter ?
Because I have: SOLACE_SCRAPE_URI=http://[solace-broker]:8080
There is no SEMP there.Or maybe are you talking about other thing ?
To be honest on the solace_up result of my exporter I don't know why there is /SEMP..0 -
You can ask those questions directly to the solace-prometheus-community: https://github.com/solacecommunity/solace-prometheus-exporter
0