以下列举了一些典型的rabbitmq实时数据
1. 获取rabbitmq的consumer数目,以下为了节省空间,只显示多少列,实际需要把列出的所有值相加
# rabbitmqctl list_channels consumer_count
Listing channels ...
0
0
0
0
3
1
3
1
....
....
...
# rabbitmqctl list_channels consumer_count | wc
683 685 1385
2. 获取rabbitmq的队列数,需要减去非队列的几行
# rabbitmqctl list_queues | wc
629 1264 29893
注:消息队列数前10,可以对以上数据进行排序
3.获取rabbitmq的连接数
# rabbitmqctl list_connections | wc
649 2595 23243
4.获取rabbitmq的通道数
# rabbitmqctl list_channels|wc
9 47 616
5.获取rabbitmq的消息交换机数
# rabbitmqctl list_exchanges | wc
168 339 6050
6.获取rabbitmq其他的一些数据,通过rabbitmqctl status
# rabbitmqctl status
Status of node rabbit@rabbitmq-0.rabbitmq-discovery.openstack.svc.cluster.local ...
[{pid,212},
{running_applications,
[{rabbitmq_management,"RabbitMQ Management Console","3.7.0"},
{rabbitmq_web_dispatch,"RabbitMQ Web Dispatcher","3.7.0"},
{amqp_client,"RabbitMQ AMQP Client","3.7.0"},
{rabbitmq_management_agent,"RabbitMQ Management Agent","3.7.0"},
{rabbit,"RabbitMQ","3.7.0"},
{rabbit_common,
"Modules shared by rabbitmq-server and rabbitmq-erlang-client",
"3.7.0"},
{ranch_proxy_protocol,"Ranch Proxy Protocol Transport","1.4.2"},
{cowboy,"Small, fast, modern HTTP server.","2.0.0"},
{ranch,"Socket acceptor pool for TCP protocols.","1.4.0"},
{ssl,"Erlang/OTP SSL application","8.2.2"},
{public_key,"Public key infrastructure","1.5.1"},
{asn1,"The Erlang ASN1 compiler version 5.0.3","5.0.3"},
{recon,"Diagnostic tools for production use","2.3.2"},
{mnesia,"MNESIA CXC 138 12","4.15.1"},
{xmerl,"XML parser","1.3.15"},
{cowlib,"Support library for manipulating Web protocols.","2.0.0"},
{os_mon,"CPO CXC 138 46","2.4.3"},
{crypto,"CRYPTO","4.1"},
{inets,"INETS CXC 138 49","6.4.4"},
{jsx,"a streaming, evented json parsing toolkit","2.8.2"},
{lager,"Erlang logging framework","3.5.1"},
{goldrush,"Erlang event stream processor","0.1.9"},
{compiler,"ERTS CXC 138 10","7.1.3"},
{syntax_tools,"Syntax tools","2.1.3"},
{sasl,"SASL CXC 138 11","3.1"},
{stdlib,"ERTS CXC 138 10","3.4.2"},
{kernel,"ERTS CXC 138 10","5.4"}]},
{os,{unix,linux}},
{erlang_version,
"Erlang/OTP 20 [erts-9.1.5] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:256] [hipe] [kernel-poll:true]\n"},
{memory,
[{connection_readers,5402600},
{connection_writers,382992},
{connection_channels,2824400},
{connection_other,12328872},
{queue_procs,10452688},
{queue_slave_procs,9730768},
{plugins,26608736},
{other_proc,13696440},
{metrics,1319728},
{mgmt_db,25120144},
{mnesia,3137344},
{other_ets,3173528},
{binary,82004792},
{msg_index,197192},
{code,28169618},
{atom,1123529},
{other_system,18648293},
{allocated_unused,249823872},
{reserved_unallocated,0},
{strategy,rss},
{total,[{erlang,244321664},{rss,395993088},{allocated,494145536}]}]},//rss节点内存已使用
{alarms,[]},
{listeners,[{clustering,25672,"::"},{amqp,5672,"::"},{http,15672,"::"}]},
{vm_memory_calculation_strategy,rss},//rss节点内存已使用
{vm_memory_high_watermark,0.4},
{vm_memory_limit,14245483315},// 节点内存限制
{disk_free_limit,50000000},//节点磁盘限制大小
{disk_free,200411496448},//节点磁盘free总量
{file_descriptors,
[{total_limit,65436},//文件描述符总量
{total_used,173},//文件描述符已使用
{sockets_limit,58890},//socket限制
{sockets_used,165}]},//socket已使用
{processes,[{limit,1048576},{used,4066}]},
{run_queue,0},
{uptime,42587},
{kernel,{net_ticktime,60}}]