Original Message:
Sent: Thu December 12, 2024 04:50 PM
From: Vincent Greene
Subject: Any native Library for IBM MQ in Powershell
> You can let me know if you are interested in learning more about this. I won't write more just now.
I'm interested! I think I know what you are talking about, but if you happen to have a tutorial or some examples I'd love to see them.
I also think we should point out that if using the client, you are dependent of the queue manager being active and the channel the SVRCONN channel on the queue manager being active so you can communicate to it. If you can't communicate, it could be QM down, or channel down, or a communications failure, but it any of those cases you know its time to check on the queue manager directly.
------------------------------
Vincent Greene
IT Consultant
Technology Expert labs
IBM
Vincent.Greene@ibm.com
The postings on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Original Message:
Sent: Wed December 11, 2024 11:05 PM
From: Morag Hughson
Subject: Any native Library for IBM MQ in Powershell
Hi Naveen,
Thanks for that. Very helpful.
Let's look at each command in turn.
- The dspmq command can only be run local to the queue manager. I believe the REST interface gives you a similar view. However, if either of your next two commands fails to connect to the queue manager, i.e. before even getting as far as running the DISPLAY command, then you have as much of an answer about queue manager availability as you need.
- For runmqsc - you can connect as a client. For now we can do this quite simply with an environment variable for basic non-TLS connectivity to prove the point. However, you can also set this connectivity up with user ID/password or TLS and digital certificates should you need that when you get past just doing a PoC.
Set up the environment where you are running your script with:-
set MQSERVER=PSHELL.SVRCONN/TCP/ip-qm-machine(1414)
You can change "PSHELL.SVRCONN" to whatever you decide to call the SVRCONN channel name you define on your queue manager for this purpose. You must set "ip-qm-machine" to the IP address or hostname where your queue manager is running - you can try straight away by using localhost and running your script on the same machine, just connecting with a client instead of locally. You must set the port number where I have written 1414 to whatever your queue manager TCP/IP listener port is.
then use runmqsc with the -c parameter before the queue manager name. - See #2
I will say something else though. You might be interested to know that instead of having to ask your queue manager every 5 minutes whether there are any queues that have a depth that has gone over a particular threshold, or whether there are any channels that have had a problem, you can instead have your queue manager emit a notification when those things are true. There are several benefits to this:-
- You get timely notification instead of having to wait, in the worse case, nearly 5 minutes, to find out.
- Your queue manager doesn't have to expend effort in answering your queries, in order to tell you that there is nothing of interest.
You can let me know if you are interested in learning more about this. I won't write more just now.
Have a quick try of the runmqsc in client mode and see if you can get that working first and we can go from there. If you need help getting the SVRCONN and TCP/IP listener set up, just let me know.
Cheers,
Morag
------------------------------
Morag Hughson
MQ Technical Education Specialist
MQGem Software Limited
Website: https://www.mqgem.com
Original Message:
Sent: Wed December 11, 2024 10:32 PM
From: Naveen P
Subject: Any native Library for IBM MQ in Powershell
Thanks Morag. That will be helpful.
OS - Windows Server 2022
IBM MQ Server - 9.3
IBM MQ Explorer installed
4 Queue Managers in Active on that server
3 Commands are used as below:
1) "dspmq -m $queueManagerName " - This command is used to get the status of Each Queue Manager . If the STATUS is not RUNNING then send email to Team with Queue Manager Name
2) "runmqsc $queueManagerName DISPLAY QLOCAL(*) CURDEPTH " -- This command is used to get current depth of all the Local Queues in a Queue Manager. If the Current depth > Threshold then send email to Team with Queue Manager Name, Queue Name
3)"runmqsc $queueManagerName DISPLAY CHSTATUS(*) STATUS" -- This command is used to status of all the channels in a Queue Manager. If the status is not ACTIVE then send email to Team with Queue Manager Name, Channel Name
Powershell script is scheduled to run for every 5 mins. There is no increase in Queue Managers (Its always 4 Queue Managers, Only single instance )
------------------------------
Naveen P
Original Message:
Sent: Wed December 11, 2024 06:20 PM
From: Morag Hughson
Subject: Any native Library for IBM MQ in Powershell
MQ Client is free. It is licenced by means of the fact that you have a queue manager with a licence. The MQ Client is not much use without a queue manager to connect to!
The MQ Client would need to be installed on the machine where you wanted to run the tool you are using to do the inquiry if that is a different machine from where the queue manager is running.
So, help me to help you. What are you currently using to run commands in PowerShell on the local machine where your queue manager is running? We should be able to make that work with an MQ Client. I will help you if you can tell me what you are currently using.
I can also help you with getting the fields you want. But one thing at a time :-)
Cheers,
Morag
------------------------------
Morag Hughson
MQ Technical Education Specialist
MQGem Software Limited
Website: https://www.mqgem.com
Original Message:
Sent: Wed December 11, 2024 06:11 PM
From: Naveen P
Subject: Any native Library for IBM MQ in Powershell
Hi Morag,
I am doing a POC if the commands provided in the IBM MQ Doc are getting all the fields required for my requirement.
I have couple of questions on MQ Client -
1) The MQ Client is different service and should we need to have any seperate licence / subscription to use this or its Free ?
2) If I am not wrong, MQ Client needs to installed on the remote server to query multiple MQ Servers ?
Thanks
------------------------------
Naveen P
Original Message:
Sent: Wed December 11, 2024 06:03 PM
From: Morag Hughson
Subject: Any native Library for IBM MQ in Powershell
Hi Naveen,
What are you using to do that? Surely we can get those working with an MQ Client too?
Happy to help you try to do that.
Cheers,
Morag
------------------------------
Morag Hughson
MQ Technical Education Specialist
MQGem Software Limited
Website: https://www.mqgem.com
Original Message:
Sent: Wed December 11, 2024 05:50 PM
From: Naveen P
Subject: Any native Library for IBM MQ in Powershell
Thanks Morag. I tried same but couldn't install. For now, I am using powershell scripts on the MQ Server itself (Just for testing purpose) .
------------------------------
Naveen P
Original Message:
Sent: Wed December 11, 2024 05:44 PM
From: Morag Hughson
Subject: Any native Library for IBM MQ in Powershell
Hi Naveen - quick update. I tried to install MO74 on my x64 Windows 11 machine, and was unable to because of a requirement for .NET V2 ( I only have V8!). I have passed on my finding to the owner of MO74 and another IBMer and told them about your thread here. Hopefully they will reply soon.
Cheers,
Morag
------------------------------
Morag Hughson
MQ Technical Education Specialist
MQGem Software Limited
Website: https://www.mqgem.com
Original Message:
Sent: Sun December 08, 2024 11:16 PM
From: Naveen P
Subject: Any native Library for IBM MQ in Powershell
Hi ,
I am currently exploring options to implement a PowerShell script for retrieving key status information for IBM MQ queues, specifically focusing on:
- Queue depth
- Message rate
- Queue status
While researching this, I came across references to the MO74 package as well as using .NET client libraries to fetch this data. However, I noticed that the last update for the MO74 package was around 2015, and I'm hesitant to use this as it may be outdated.
Given this, I would like to inquire if there are more modern and widely used approaches to achieve the same goal-specifically, if the .NET client libraries are the recommended method for interacting with MQ and extracting queue metrics.
I would appreciate any insights on best practices for automating queue monitoring, especially with PowerShell, and whether the .NET client libraries are considered a more reliable and future-proof solution for this use case.
Thank you for your assistance!
------------------------------
Naveen P
Original Message:
Sent: Sun December 08, 2024 11:08 PM
From: Morag Hughson
Subject: Any native Library for IBM MQ in Powershell
Try this link for raising an MQ requirement: https://integration-development.ideas.ibm.com/
Could you tell us a little more about what doesn't work when you try to use MO74 please?
Cheers,
Morag
------------------------------
Morag Hughson
MQ Technical Education Specialist
MQGem Software Limited
Website: https://www.mqgem.com
Original Message:
Sent: Sun December 08, 2024 06:58 PM
From: Naveen P
Subject: Any native Library for IBM MQ in Powershell
Hi Ram,
Thank you for confirming. I tried this link but couldn't find "IBM MQ" in the product list. Could you let me know if there's another way to access it?
------------------------------
Naveen P
Original Message:
Sent: Fri December 06, 2024 02:56 AM
From: Ram Subba Rao Chalamalasetti
Subject: Any native Library for IBM MQ in Powershell
Hi,
MO74 is the only Powershell library available and it hasn't been updated since then. Please can you raise an RFE for it using the link here
------------------------------
Ram Subba Rao Chalamalasetti
Original Message:
Sent: Thu December 05, 2024 12:05 AM
From: Naveen P
Subject: Any native Library for IBM MQ in Powershell
Hi Team,
I am exploring how to query the IBM MQ Server using Powershell and the IBM MQ Client. Is there a native Powershell library available for this purpose? My research pointed me to the 'MO74' library, but it appears to be outdated (from 2012) which doesn't use MQ Client
My goal is to retrieve the status of queues, channels, and the depth of queues. Are there any recommended best practices for using Powershell to achieve this effectively?
I found these 2 options:
1) Can I use "MO74" library considering its old?
2) Use the MQ Client library and import the required IBM MQ .NET client libraries to the Powershell script and query from the .NET library?
Thanks.
------------------------------
Naveen P
------------------------------