The IBM RedBook instructions didn't help.
I need to give a script a queue manager and a queue/topic name, and have it return the number of messages queued up.
The IBM RedBook instructions didn't help.
I need to give a script a queue manager and a queue/topic name, and have it return the number of messages queued up.
This command should work:
echo "display ql(queue_name) curdepth" | runmqsc queue_manager_name
I'm probably missing something here (turns out I was), as it's been about a year since I dealt with MQ at all and even then it was only peripherally, but wouldn't this command from the doc you linked give you the queue depth for a particular queue?
Deleted old incorrect answer
Per Andrew's correct answer, you need to pipe the command to runmqsc.
echo "display ql(queue_name) curdepth" | runmqsc queue_manager_name