@@ -0,0 +1,1792 @@
+#!/usr/bin/env python%0A%0Aimport requests%0Aimport sys%0A%0AOVERVIEW_URL = %22http://localhost:55672/api/overview%22%0ANODES_URL = %22http://localhost:55672/api/nodes%22%0AUSERNAME = 'guest'%0APASSWORD = 'guest'%0A%0AOVERVIEW_METRICS = %7B%22queue_totals%22: (%22messages%22,%0A                                     %22messages_ready%22,%0A                                     %22messages_unacknowledged%22),%0A                    %22message_stats%22: (%22get%22,%0A                                      %22ack%22,%0A                                      %22deliver_get%22,%0A                                      %22deliver%22,%0A                                      %22publish%22)%7D%0ANODES_METRICS = (%22proc_used%22,%0A                 %22proc_total%22,%0A                 %22fd_used%22,%0A                 %22fd_total%22,%0A                 %22sockets_used%22,%0A                 %22sockets_total%22,%0A                 %22mem_used%22,%0A                 %22mem_limit%22,%0A                 %22mem_alarm%22)%0A%0A%0Adef main():%0A    metrics = %7B%7D%0A%0A    try:%0A        r = requests.get(OVERVIEW_URL, auth=(USERNAME, PASSWORD))%0A    except requests.exceptions.ConnectionError:%0A        error()%0A%0A    if r.status_code == 200:%0A        for k in OVERVIEW_METRICS.keys():%0A            if k in r.json():%0A                for i in OVERVIEW_METRICS%5Bk%5D:%0A                    if i in r.json()%5Bk%5D:%0A                        metrics%5Bi%5D = r.json()%5Bk%5D%5Bi%5D%0A    else:%0A        error()%0A%0A    try:%0A        r = requests.get(NODES_URL, auth=(USERNAME, PASSWORD))%0A    except requests.exceptions.ConnectionError:%0A        error()%0A%0A    if r.status_code == 200:%0A        for i in NODES_METRICS:%0A            if i in r.json()%5B0%5D:%0A                metrics%5Bi%5D = r.json()%5B0%5D%5Bi%5D%0A    else:%0A        error()%0A%0A    print %22status ok%22%0A%0A    for k in metrics.keys():%0A        print k, metrics%5Bk%5D%0A%0A%0Adef error():%0A    print %22status error%22%0A    sys.exit(1)%0A%0A%0Aif __name__ == %22__main__%22:%0A    main()%0A

Return details about RabbitMQ server