|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
how to use MQCMD_INQUIRE_CHANNEL_STATUS |
« View previous topic :: View next topic » |
Author |
Message
|
sebastia |
Posted: Wed Apr 03, 2013 12:31 pm Post subject: |
|
|
 Grand Master
Joined: 07 Oct 2004 Posts: 1003
|
MS03, great sample !
20/02/2009 - you sent me "190.373 bytes ... ms03_win.zip"
jejeje - I still keep it !
Thanks a lot, Jeff. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Apr 03, 2013 1:18 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
sebastia wrote: |
MS03, great sample !
20/02/2009 - you sent me "190.373 bytes ... ms03_win.zip"
jejeje - I still keep it !
Thanks a lot, Jeff. |
I'm sure I still have that email.
MS03 always shipped with source. |
|
Back to top |
|
 |
sebastia |
Posted: Wed Apr 03, 2013 2:22 pm Post subject: |
|
|
 Grand Master
Joined: 07 Oct 2004 Posts: 1003
|
So MS03 will survive ?
I thought it has been renamed to "dmpmqcfg" ...
Ah, you mean "dmpmqcfg" is shipped without source code ... That's true. |
|
Back to top |
|
 |
jacquesvdm |
Posted: Tue Oct 01, 2013 12:02 am Post subject: difference is result of PCF and mqsc command |
|
|
Apprentice
Joined: 18 Jan 2012 Posts: 29
|
Hi
I am trying to get exactly the same display using PCF commands than using mqsc to display channel status information.
When performing the mqsc command
dis chstatus(*)
I get a list of active channels and all its related client connection attributes
e.g if 4 connections exists to SYSTEM.DEF.SVRCONN , I will see four responses with its related CONNAME attribute.
when performing the PCF equivalent I get only one status (I modified the sample PCF_ChannelStatus.java slightly to request all channels and loop through multiple responses.
I also added the "MQOT_CURRENT_CHANNEL" but it had no effect
Code: |
public static void ChannelStatus(PCF_CommonMethods pcfCM)
throws MQDataException, IOException {
// Create the PCF message type for the inquire channel.
PCFMessage pcfCmd = new PCFMessage(
MQConstants.MQCMD_INQUIRE_CHANNEL_STATUS);
// Add the start channel mandatory parameters.
// Channel name.
pcfCmd.addParameter(MQConstants.MQCACH_CHANNEL_NAME, "*");
pcfCmd.addParameter(MQConstants.MQIACH_CHANNEL_INSTANCE_TYPE,MQConstants.MQOT_CURRENT_CHANNEL);
//pcfCmd.addParameter(MQConstants.MQIACH_CHANNEL_INSTANCE_TYPE,MQConstants.MQOT_SAVED_CHANNEL);
// Execute the command. The returned object is an array of PCF messages.
// If no object
// can be returned, then catch the exception as this may not be an
// error.
try {
PCFMessage[] pcfResponse = pcfCM.agent.send(pcfCmd);
for (int index = 0; index < pcfResponse.length; index++) {
PCFMessage response = pcfResponse[index];
int chStatus = ((Integer) (response
.getParameterValue(MQConstants.MQIACH_CHANNEL_STATUS)))
.intValue();
String name = (String) response.getParameterValue(MQConstants.MQCACH_CHANNEL_NAME);
String connName = (String) response.getParameterValue(MQConstants.MQCACH_CONNECTION_NAME);
String[] chStatusText = { "", "MQCHS_BINDING",
"MQCHS_STARTING", "MQCHS_RUNNING", "MQCHS_STOPPING",
"MQCHS_RETRYING", "MQCHS_STOPPED", "MQCHS_REQUESTING",
"MQCHS_PAUSED", "", "", "", "", "MQCHS_INITIALIZING" };
System.out.println("Channel "+ name + "status is "
+ chStatusText[chStatus] + " : Connection Name: "+ connName);
}
} catch (PCFException pcfe) {
// If the channel type is MQCHT_RECEIVER, MQCHT_SVRCONN or
// MQCHT_CLUSRCVR, then the
// only action is to enable the channel, not start it.
if (pcfe.reasonCode != MQConstants.MQRCCF_CHL_STATUS_NOT_FOUND) {
throw pcfe;
}
if (pcfCM.client) {
System.out.println("Either the queue manager \""
+ pcfCM.queueManager
+ "\" does not exist or is not listening on port \""
+ pcfCM.port + "\" or the channel \""
+ PCF_CommonMethods.pcfChannel
+ "\" does not exist on the queue manager.");
} else {
System.out.println("Either the queue manager \""
+ pcfCM.queueManager
+ "\" does not exist or the channel \""
+ PCF_CommonMethods.pcfChannel
+ "\" does not exist on the queue manager.");
}
}
return;
}
|
I understood from this IBM document that these commands are equivalent.
"ftp://ftp.software.ibm.com/software/integration/wmq/docs/V7.0/csqzax07.pdf"
The end result I am looking for is to dump a list of connected IP's to all channels in order to identify who/what is connected to our servers. (connection audit).
thanks
Jacques |
|
Back to top |
|
 |
shayanjameel08 |
Posted: Fri Oct 18, 2013 9:23 pm Post subject: |
|
|
Newbie
Joined: 12 Oct 2013 Posts: 6
|
It's frightfully easy in Java, but here's something close in C |
|
Back to top |
|
 |
bruce2359 |
Posted: Sat Oct 19, 2013 4:52 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
shayanjameel08 wrote: |
It's frightfully easy in Java, but here's something close in C |
really? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|