If you are having problems with an IBM MQ agent, it may be malfunctioning or it may lack sufficient privileges to carry out the tasks you are requesting.
Verifying IBM MQ agent operation
- Use the nsqcl utility program. This utility prompts you for the location of the local agent – enter host name and port number. Use conversational mode only. The utility prompts you for the Application Name – enter a random name if the host is running IBM MQ Level 2 systems. On IBM MQ Level 1 systems the Application Name should correspond to any available queue defined on the queue manager. The output of nsqcl command is in PCF format.
- Once the connection has been established the utility prompts you for PCF commands. Before entering any PCF commands, do the following (example is for Windows environments):
C:\>nsqcl (C)Copyright 2007, Nastel Technologies Inc. Reproduction, adaptation, or distribution without prior written permission is prohibited, except as allowed under the copyright laws. Sizeof MSHDR = 136 Manager = Sysname("Windows_XP") NodeName("INSHAPE") Release(" ") Enter Application name: xxx Enter host name (localhost): tag61 Enter service name: 5000 Mode of Connection ((S)ecure/(N)Secure) (N): Connection has been established ok! Enter Command Name:
- Issue EXCMD_INQUIRE_Q_MGR_NAMES command to test the discovery of queue managers on the host system, both active and inactive. For the object name enter an *. A list of all the queue managers is returned. For example:
Enter Command Name: EXCMD_INQUIRE_Q_MGR_NAMES Enter Object Name: * Command (EXCMD_INQUIRE_Q_MGR_NAMES) has been issued PCF RESPONSE FROM THE SERVER --> PCF Header (MQCFH): ->Type(2), StrucLength(36), Version(1), Command(10007) ->MsgSeqNum(1), Control(1), ParameterCount(3) ->CompCode(0), Reason(0) PCF String List (MQCFSL): ->Type(6), StrucLength(120), Parameter (2015), Count(2) ->StringLength(48), CharSetId(0) ->String List { (1) - "NAS_QM " (2) - "NASOAM_QM " }; PCF String (MQCFST): ->Type(4), StrucLength(24), Parameter(2015), CharSet(0) ->StringLength(1), String("*") PCF Integer (MQCFIN): ->Type(3), StrucLength(16), Parameter (20119), Value(7) THIS RECORD (LAST)
- Issue EXCMD_MQ_OPEN command. For the object-name, enter the name of the remote queue manager whose operations you would like to test. This command opens a connection to the local queue manager on the remote machine. For example:
Enter Command Name: EXCMD_MQ_OPEN Enter Object Name: NASOAM_QM Command (EXCMD_MQ_OPEN) has been issued PCF RESPONSE FROM THE SERVER --> PCF Header (MQCFH): ->Type(2), StrucLength(36), Version(1), Command(10008) ->MsgSeqNum(1), Control(1), ParameterCount(2) ->CompCode(0), Reason(0) PCF String (MQCFST): ->Type(4), StrucLength(32), Parameter(2015), CharSet(0) ->StringLength(9), String("NASOAM_QM") PCF Integer (MQCFIN): ->Type(3), StrucLength(16), Parameter (20119), Value(7) THIS RECORD (LAST)
- Issue the EXCMD_OPEN_EVENT command that enables the IBM MQ agent to attach to its event queue and send events to the nsqcl utility program. For example:
Enter Command Name: EXCMD_OPEN_EVENT Enter Object Name: NASTEL.EVENT.QUEUE
Ensure all the above commands succeed. Commands were successful if the CompCode and the Reason code of all responses are zero. If CompCode response is warning (1) or failure (2), write down the CompCode and Reason values and consult IBM’s PCF Reference for details on the command and the reason of the failure.
- Issue any of the MQCMD_XXX commands described in the IBM’s PCF Reference manual to verify operation of any IBM-supported PCF command. For example:
Enter Command Name: MQCMD_INQUIRE_Q_NAMES Enter Object Name: MQ* Command (MQCMD_INQUIRE_Q_NAMES) has been issued PCF RESPONSE FROM THE SERVER --> PCF Header (MQCFH): ->Type(2), StrucLength(36), Version(1), Command(18) ->MsgSeqNum(1), Control(1), ParameterCount(5) ->CompCode(0), Reason(0) PCF String List (MQCFSL): ->Type(6), StrucLength(216), Parameter (3011), Count(4) ->StringLength(48), CharSetId(0) ->String List { (1) - "NASTEL.MMF.AUDIT.QUEUE " (2) - "NASTEL.MMF.ADMIN.COMMAND.QUEUE " (3) - "NASTEL.REPLY.xxx1999031119025854 " (4) - "NASTEL.EVENT.QUEUE " }; PCF Integer (MQCFIN): ->Type(3), StrucLength(16), Parameter (20126), Value(10) PCF String (MQCFST): ->Type(4), StrucLength(24), Parameter(2016), CharSet(0) ->StringLength(3), String("MQ*") PCF Integer (MQCFIN): ->Type(3), StrucLength(16), Parameter (20), Value(1001) PCF Integer (MQCFIN): ->Type(3), StrucLength(16), Parameter (20119), Value(7) THIS RECORD (LAST)
Some commands will require attributes that NSQCL does not supply, and the command will fail.
When an IBM agent is functioning properly, all PCF commands should succeed with reason code equal to zero. Note that this rule does not apply to PCF commands that start/stop channels or other components, since their failure may be attributed to the IBM MQ configuration and authorization.
Checking IBM MQ agent parameters
The IBM MQ should have full privileges to access IBM MQ configuration files, queue managers and queues. If you suspect an IBM MQ agent has not been given the correct parameters, you should check the configuration files associated with it.
When you have located the configuration files, perform the following checks:
- Ensure that any environment variables (example: APWMQ_MQM) are defined and are valid.
- Ensure all necessary queues are defined on each queue manager.
- Ensure node registration was successful. Check the group registration file mqgroup.ini. Ensure the format is correct and that entries point to the correct workgroup server locations.
- On UNIX and Windows systems, ensure the IBM MQ agent is running within the MQM user group or as a Windows service under the SYSTEM account.