I am using below script for rabbit MQ queue messages is solarwinds SAM component, when we are running this script getting below out put ,kindly check this script is right
No fields were recognized in the script output:
0 RMQ_HTTP_RESPONSE - Response is 200
P RMQ--DN_INTERNAL_QUEUE messages=0;500;1000|messages_ready=0;500;1000|messages_unacked=0;500;1000
#!/bin/bash
warn=500
cric=1000
rwarn=500
rcric=1000
uawarn=500
uacric=1000
IPAD=10.150.193.218
PRT=15672
RSPV=`curl -s -o /dev/null -I -w "%{http_code}" http://$IPAD:$PRT`
if [ $RSPV == 200 ]
then
echo "0 RMQ_HTTP_RESPONSE - Response is $RSPV"
Totalobjs=`curl -s -u admin:blowthis#1sc http://$IPAD:$PRT/api/queues///`
objslen=$(echo "$Totalobjs" | jq length)
objslen1=$(($objslen-1))
for i in $(seq 0 $objslen1)
do
rname=$(echo "$Totalobjs" | eval jq '.[$i].name' | sed 's/\"//g')
rmsg=$(echo "$Totalobjs" | eval jq '.[$i].messages')
rmsgua=$(echo "$Totalobjs" | eval jq '.[$i].messages_unacknowledged')
rmsgr=$(echo "$Totalobjs" | eval jq '.[$i].messages_ready')
echo "P RMQ--$rname messages=$rmsg;$warn;$cric|messages_ready=$rmsgr;$rwarn;$rcric|messages_unacked=$rmsgua;$uawarn;$uacric"
done
else
echo "2 RMQ_HTTP_RESPONSE - Response is $RSPV"
fi