使用rabbitmqadmin能夠獲取信息。bash
下載code
wget http://ip:15672/cli/rabbitmqadminrabbitmq
#!/bin/bash count=$(./rabbitmqadmin -u guest -p guest list queues|grep send_sync_s|awk '{print $7}') echo "count: $count" if [[ $count > 10 ]] then mainmq=$(kubectl get po |grep mq-main|awk '{print $1}') kubectl delete po $mainmq echo $mainmq fi