This article shows a way to automate the first step in How to Detect Policies that Enable Classic Queue Mirroring for RabbitMQ services running on Tanzu Elastic Application Runtime. This may be useful if you have a large amount of service instances to check.
SERVICE_OFFERING=$(cf curl '/v3/service_offerings?per_page=5000' | jq -r '.resources[] | select(.name=='\"p.rabbitmq\"').guid')
SERVICE_PLANS=$(cf curl "/v3/service_plans?per_page=5000&service_offering_guids=$SERVICE_OFFERING" | jq -r '.resources[].guid' | tr '\n' ',')
RMQ_DEPLOYMENT_NAMES=$(cf curl "/v3/service_instances?per_page=5000&service_plan_guids=$SERVICE_PLANS" | jq -r '.resources[].guid' | sed 's/^/service-instance_/g')
for deployment in $RMQ_DEPLOYMENT_NAMES; do bosh -d $deployment ssh rabbitmq-server -r -c 'source /etc/profile.d/rabbitmq-server-env.sh; sudo /var/vcap/packages/rabbitmq-server/bin/rabbitmq-diagnostics check_if_cluster_has_classic_queue_mirroring_policy'; done
Using deployment 'service-instance_#############'
Task 1257. Done
Instance rabbitmq-server/#############'
Stdout Checking if cluster has any classic queue mirroring policy ...
Cluster reported no policies that enable classic queue mirroring
Stderr Unauthorized use is strictly prohibited. All access and activity
is subject to logging and monitoring.
Connection to ###.###.###.### closed.
Exit Code 0
Error -