0
IBM MQのチャネルの状態を調べようとしています。 PowerShellの次のスニペットは私の試みです。 しかし、私はどのように私が非アクティブなチャネルのステータスを取得するかについて疑問に思っています。IBM MQ - チャネルの状態を照会してください
&{
$erroractionpreference='stop'
try{
$mq="${env:programfiles(x86)}\IBM\WebSphere MQ\bin\amqmdnet.dll"
[void][reflection.assembly]::loadfrom($mq)
$mqe=[ibm.wmq.mqenvironment]
$mqe::hostname='localhost'
$mqe::port=1414
$mqe::channel='SYSTEM.DEF.SVRCONN'
$mqc=[ibm.wmq.mqc]
$mqe::properties[$mqc::transport_property]=$mqc::transport_mqseries_managed
$mqe::properties[$mqc::ccsid_property]=$mqc::codeset_utf
$qm=new-object ibm.wmq.mqqueuemanager EKR_33
$ag=new-object ibm.wmq.pcf.pcfmessageagent
$ag.connect($qm)
$cmqcfc=[ibm.wmq.pcf.cmqcfc]
$rq=new-object ibm.wmq.pcf.pcfmessage $cmqcfc::mqcmd_inquire_channel_names
$rq.addparameter($cmqcfc::mqcach_channel_name,'*')
[email protected]{}
$ag.send($rq)|%{
$_.getstringlistparametervalue($cmqcfc::mqcach_channel_names)|%{
$chst[$_.trim()]='INACTIVE'
}
}
$rq=new-object ibm.wmq.pcf.pcfmessage $cmqcfc::mqcmd_inquire_channel_status
$rq.addparameter($cmqcfc::mqcach_channel_name,'*')
[email protected]{$cmqcfc::mqchs_binding='BINDING'
$cmqcfc::mqchs_inactive='INACTIVE'
$cmqcfc::mqchs_initializing='INITIALIZING'
$cmqcfc::mqchs_paused='PAUSED'
$cmqcfc::mqchs_requesting='REQUESTING'
$cmqcfc::mqchs_retrying='RETRYING'
$cmqcfc::mqchs_running='RUNNING'
$cmqcfc::mqchs_starting='STARTING'
$cmqcfc::mqchs_stopped='STOPPED'
$cmqcfc::mqchs_stopping='STOPPING'}
$ag.send($rq)|%{
$chst[$_.getstringparametervalue($cmqcfc::mqcach_channel_name).trim()]=
$st[$_.getintparametervalue($cmqcfc::mqiach_channel_status)]
}
$chst|ft -a
}finally{
if($ag){$ag.disconnect()}
if($qm){$qm.disconnect()}
}
}
いくつかの技術的な詳細:
OS:Windows Server 2008のR2の標準
のIBM WebSphere MQバージョン:7.1.0.5
2 JoshMcは:
は実際には、には何らかの誤りがない スニペット。まず
iは...チャンネルの非アクティブの状態を推定
$rq=new-object ibm.wmq.pcf.pcfmessage $cmqcfc::mqcmd_inquire_channel_names
$rq.addparameter($cmqcfc::mqcach_channel_name,'*') [email protected]{} $ag.send($rq)|%{
$_.getstringlistparametervalue($cmqcfc::mqcach_channel_names)|%{
$chst[$_.trim()]='INACTIVE' # My guess
}
}
...だけにして、実際に自分の状態を問い合わせます。
$rq=new-object ibm.wmq.pcf.pcfmessage $cmqcfc::mqcmd_inquire_channel_status
$rq.addparameter($cmqcfc::mqcach_channel_name,'*')
$ag.send($rq)|%{ # I have never got channels with inactive status through sending the 'mqcmd_inquire_channel_names' message.
$chst[$_.getstringparametervalue($cmqcfc::mqcach_channel_name).trim()]=
$st[$_.getintparametervalue($cmqcfc::mqiach_channel_status)]
私はそれが正しいかどうかわかりません。
これはタグ[[tag:ibm-mq]]に移動しました。これはIBM MQ製品に関連しているためです。あなたは受け取っているエラーを確認できますか?非アクティブなチャンネルステータスを取得することについて疑問がある場合は、拡張できますか? – JoshMc