This article shows how to configure and run Stream-JMX to monitor ActiveMQ brokers using JMX and connect it with meshIQ Observe or Track.
Prerequisites
- JMX access shall be enabled on your ActiveMQ Classic/Artemis brokers you want to monitor:
- See ActiveMQ JMX how to enable remote JMX access for ActiveMQ Classic.
- See Artemis Management how to enable remote JMX access for ActiveMQ Artemis.
- Your meshIQ platform monitoring application shall have (one of or both):
- meshIQ Observe shall have Process Wrapper deployed and running.
Accept TCP factsmust be enabled for it (properties tabTCP Options). Also chooseTCP portto bind your Process Wrapper instance (default is6060). Deployed Observe policies for ActiveMQ will make monitoring more robust and easier. - meshIQ Track shall have streaming token generated for your repository.
- meshIQ Observe shall have Process Wrapper deployed and running.
Setting up Stream-JMX
-
Configure your ActiveMQ JMX connection properties stanza in file config/connections.cfg:
{ activemq.vm: service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi ; activemq.vm: service:jmx:rmi:///jndi/rmi://${vm.host}:${vm.port}/jmxrmi ; activemq.vm.host: localhost ; activemq.vm.port: 1099 ; activemq.vm.user: admin ; activemq.vm.pass: admin activemq.vm.reconnect.sec: 10 activemq.agent.options: *:*!!10000!5000!10 # For ActiveMQ Classic activemq.source.fqn: SERVICE=@bean:org.apache.activemq:type=Broker,brokerName=localhost/?BrokerId#SERVER=@sjmx.serverName#APPL=ActiveMQ # For ActiveMQ Artemis ; activemq.source.fqn: SERVICE=@bean:org.apache.activemq.artemis:broker="0.0.0.0"/?NodeID#SERVER=@sjmx.serverName#APPL=ActiveMQ }You can have multiple connection stanzas for all ActiveMQ broker instances you want to monitor in the same config/connections.cfg file.
Or if multiple instances of ActiveMQ brokers run on the same VM, just on different ports, then you can have single stanza, just make it start like this:
activemq.vm: service:jmx:rmi:///jndi/rmi://${vm.host}:${vm.port}/jmxrmi activemq.vm.host: localhost activemq.vm.port: 1099;1098;1097If different hosts/IPs, but same port number then:
activemq.vm: service:jmx:rmi:///jndi/rmi://${vm.host}:${vm.port}/jmxrmi activemq.vm.host: host1;host2;host3 activemq.vm.port: 1099Or even different host/IP and port combinations:
activemq.vm: service:jmx:rmi:///jndi/rmi://${vm.address}/jmxrmi activemq.vm.address: host1:1099;host2:1098;host3:1097Note: Change
localhost,0.0.0.0, andhostXto values matching your environment. -
Configure your monitoring application connection properties in config/tnt4j_dual.properties:
- Choose your JMX metrics broadcasting sequence:
event.sink.factory.BroadcastSequence: ap,track.apstands for meshIQ Observe (old name AutoPilot) andtrackstands for meshIQ Track. It can be both or just one of them based on your needs. -
For meshIQ Observe:
event.sink.factory.EventSinkFactory.ap.Endpoint: localhost:6060
There, you must set the hostname (IP address) and port number for your meshIQ Observe Process Wrapper instance.
-
For meshIQ Track:
event.sink.factory.EventSinkFactory.track.Url: https://stream.meshiq.com event.sink.factory.EventSinkFactory.track.Token: YOUR-ACCESS-TOKEN
There, you must set the URL and streaming access token for your meshIQ Track repository.
- Choose your JMX metrics broadcasting sequence:
Running Stream-JMX
Run Stream-JMX using bash script bin/stream-jmx-connect-file-config.sh:
./bin/stream-jmx-connect-file-config.sh ./config/connections.cfg
If your ActiveMQ broker JMX connection requires SSL, then add an additional set of arguments:
./bin/stream-jmx-connect-file-config.sh ./config/connections.cfg . . "-sp:javax.net.ssl.keyStore=client-keystore.jks -sp:javax.net.ssl.keyStorePassword=changeit -sp:javax.net.ssl.trustStore=client-truststore.jks -sp:javax.net.ssl.trustStorePassword=changeit"
The -sp: argument passes JVM system properties as program arguments, so the naming and set of properties are the same as passing them with the JVM argument -D. One difference is that for -sp: you can set bin/utils/su.sh script encrypted passwords.