from amqpstorm.management import ApiConnectionError
from amqpstorm.management import ApiError
from amqpstorm.management import ManagementApi

if __name__ == '__main__':
    API = ManagementApi('http://127.0.0.1:15672', 'guest', 'guest')
    try:
        result = API.aliveness_test('/')
        if result['status'] == 'ok':
            print("RabbitMQ is alive!")
        else:
            print("RabbitMQ is not alive! :(")
    except ApiConnectionError as why:
        print('Connection Error: %s' % why)
    except ApiError as why:
        print('ApiError: %s' % why)

[((6, 10, 6, 67), 'amqpstorm.management.ManagementApi', 'ManagementApi', ({(6, 24, 6, 48): '"""http://127.0.0.1:15672"""', (6, 50, 6, 57): '"""guest"""', (6, 59, 6, 66): '"""guest"""'}, {}), "('http://127.0.0.1:15672', 'guest', 'guest')", False, 'from amqpstorm.management import ManagementApi\n')]