qmgr not recognized
( total pymqi noob here )
I am trying to write some code that will allow us to monitor queue depth and return messages. I downloaded and installed pymqi and it seemed to go well, but when I try using it, I get 2058 errors.
Using runmqsc, the queue manager is there :
-bash-3.00$ runmqsc MTASOEAST
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
Starting MQSC for queue manager MTASOEAST.
end
1 : end
No MQSC commands read.
No commands have a syntax error.
All valid MQSC commands were processed.
But when I try to run the program that talks to the queue manager, I get 2058 ( aka you can't spell the queue manager name )
-bash-3.00$ python qd.py
MQI Error. Comp: 2, Reason 2058: FAILED: MQRC_Q_
Source : there's a lot more : this is just pared down to the minimum :
from pymqi import *
import sys, os
from optparse import OptionParser
usage='Usage: %s [options] QMGRNAME QNAME'
def main(argv=None):
if argv is None:
argv = sys.argv
try:
#open queue manager
qmgr = QueueManager(
except MQException, err:
print '[ERROR]
print usage % (sys.argv[0],)
return err.code
except MQMIError,err:
if err.reason==2033:
#no messages
print 'No messages.'
else:
print err
return err.reason
#MQException class that holds application specific error codes
#and error messages
class MQException(
errorCodes={'1': 'QMGRNAME, QNAME or MESSAGE missing.',
'2': 'Too many arguments.',
'3': 'File does not exist.',
'4': 'QMGRNAME or QNAME missing.',
'5': 'Index error. Not so many messages in queue.',
}
code=0
def __init__(self, code):
self.code=code
self.msg = str(code)
if __name__ == "__main__":
sys.
Any ideas ?
Thanks,
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- PyMQI Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- ccremers
- Solved:
- Last query:
- Last reply: