Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 3 down vote accepted

I'm probably missing something here, 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?

runmqsc queue_manager_name display ql(queue_name) CURDEPTH
share|improve this answer
Turns out I needed to use amqspsd to resolve the name of the queue. After resolving I was able to use runmqsc. – brianegge Sep 17 '09 at 3:30
Which version of MQ does this work on? I keep getting invalid syntax, then the list of options. – Pred Jan 5 '15 at 21:36

This command should work:

echo "display ql(queue_name) curdepth" | runmqsc queue_manager_name
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.