There is a sample tool named amqsmon that allows you to query Queue/Channel statistics on a QM, ie
mqm@server1 /opt/mqm/samp/bin $ ./amqsmon -m MYQM1 -t statistics -q MYLOCALQ1 -b
MonitoringType: QueueStatistics
QueueManager: 'MYQM1'
IntervalStartDate: '2024-08-13'
IntervalStartTime: '10.04.52'
IntervalEndDate: '2024-08-13'
IntervalEndTime: '10.09.52'
QueueStatistics: 0
QueueName: 'MYLOCALQ1'
CreateDate: '2024-07-22'
CreateTime: '23.54.38'
QueueType: Local
...
I need to be able to use this same tool or output but connecting remotely to a different queue manager on a different server, does anyone know how I can accomplish this?
i.e., be able to query this on 10.0.0.2 port 1548 queue manager named TEST2 over TCP/IP.
Can I use this sample included tool or should I need to script with external connector, i.e. python or similar? and if so, how do you query statistics like these?
That same sample can be used to connect as a client to remote qmgrs. You can either use amqsmonc
to explicitly run as a client or set MQ_CONNECT_TYPE=CLIENT
environment variable.
And then it's the standard MQ mechanisms for connections - MQSERVER or CCDT configurations.
Review the instructions here to prepare your queue manager for client connections.
Review the instructions here to set up the MQSERVER
environment variable.