Skip to content

Instantly share code, notes, and snippets.

@veysby
Last active April 20, 2020 10:08
Show Gist options
  • Save veysby/cf89534dc023f668c499 to your computer and use it in GitHub Desktop.
Save veysby/cf89534dc023f668c499 to your computer and use it in GitHub Desktop.
Activemq: check health status using REST API
$curl http://localhost:8161/api/jolokia/read/org.apache.activemq:type=Broker,brokerName=localhost,service=Health
{"timestamp":1449776947,"status":200,"request":{"mbean":"org.apache.activemq:brokerName=localhost,service=Health,type=Broker","type":"read"},"value":{"CurrentStatus":"Good"}}
@petr-ujezdsky
Copy link

petr-ujezdsky commented Oct 2, 2019

I do not have jq installed in my docker image so I use much simpler version:

curl --silent --show-error "http://localhost:8161/api/jolokia/exec/org.apache.activemq:type=Broker,brokerName=localhost,service=Health/healthStatus" | tee /dev/tty | grep --silent 'Good'

The exit status give OK/KO condition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment