eandersson / amqpstorm

Thread-safe Python RabbitMQ Client & Management library
MIT License
188 stars 36 forks source link

healthchecks currently not supported in management/api.py #39

Closed j-carpentier closed 7 years ago

j-carpentier commented 7 years ago

I'm currently working on a RabbitMQ plugins written in python to improve Openstack backend monitoring and I found that management API and saw that api/aliveness-test is here already

Expected returned HTTP body on a stopped RabbitMQ server

$ curl --silent -k -u monitor:$MonitorPass https://localhost:15671/api/healthchecks/node/rabbit@eulab-os-01-rmq02 | python -m json.tool

{
    "reason": "nodedown",
    "status": "failed"
}

Expected returned HTTP body on a running RabbitMQ server

$ curl --silent -k -u monitor:$MonitorPass https://localhost:15671/api/healthchecks/node/rabbit@eulab-os-01-rmq01 | python -m json.tool

{
    "status": "ok"
}

Official API doc : https://cdn.rawgit.com/rabbitmq/rabbitmq-management/rabbitmq_v3_6_10/priv/www/api/index.html