zoukankan      html  css  js  c++  java
  • perl 监控websphere 队列和通道状态

    [mqm@node01 queue]$ cat t4.pl 
      use MQSeries;
      use MQSeries::Command;
      use Data::Dumper;
        #
      if ( $#ARGV < 4 ){
           print "Usage ./get_mq_sessage SYSTAG YWJZZF_CZCB_SEND CHANNEL1 192.168.137.2 5015 :!
    ";
           exit(-1);
                     };
    
      my $systag=$ARGV[0];
      my $QueueManager=$ARGV[1];
      my $ChannelName=$ARGV[2];
      my $ip=$ARGV[3];
      my $port=$ARGV[4];
      my $qmgr_obj = MQSeries::QueueManager->new
        (
         QueueManager => "$QueueManager",
         ClientConn   => { 'ChannelName'    => "$ChannelName",
                           'TransportType'  => 'TCP', # Default
                           'ConnectionName' => "$ip($port)",
                           'MaxMsgLength'   => 16 * 1024 * 1024,
                         },
        ) || die("Unable to connect to queue manager
    ");
      my $command = MQSeries::Command->new(QueueManager   => $qmgr_obj,
                                   CommandVersion => MQSeries::MQCFH_VERSION_3) or die("Unable to instantiate command object
    ");
    
       @qnames = $command->InquireQueueNames() or die "Unable to list queue names
    ";
       @channels = $command->InquireChannelStatus();
       #print @channels;
       #print Dumper(@channels);
       foreach (@channels){
       if ( $_->{ChannelStatus} =~/BINDING|RETRYING|INITIALIZING/i){
       print $_->{ChannelName}."  Channel Status ->"; 
       print $_->{ChannelStatus};
       print "
    ";
       }};
       
       foreach my $qname(@qnames){
       $attr = $command->InquireQueue
            (
             QName          => $qname,
             QAttrs         => [qw(QType
                                   OpenInputCount
                                   OpenOutputCount
                                   CurrentQDepth
                                  )],
            ) or die "InquireQueue: " . MQReasonToText($command->Reason()) . "
    ";
       my $type=$attr->{QType};
       my $depth=$attr->{CurrentQDepth};
       if (( $type eq 'Local') and ($qname !~/^SYSTEM/) and ($qname !~/^PERL/) and ($depth >1) ) {
           print "$systag->$QueueManager->$qname->curdepth->$depth
    ";
          };
        };
        $qmgr_obj->Close();
    [mqm@node01 queue]$ perl t4.pl test YWJZZF_CZCB_SEND CHANNEL1 192.168.137.2 5015  
    YH_CZ  Channel Status ->Binding
    YH_CZ33  Channel Status ->Retrying
    test->YWJZZF_CZCB_SEND->CZ_RSP->curdepth->2
    test->YWJZZF_CZCB_SEND->SEND000->curdepth->2

  • 相关阅读:
    vue-cli脚手架 安装
    音视频
    移动端开发问题
    GIT提交命令清单
    关于cookie和$.cookie
    emoji表情进行编码以适配移动端用户emoji表情的输入和展示
    父组件如何使用子组件中的方法
    uniapp实现锚点跳转
    uniapp判断android还是iOS
    uniapp动态设置当前页面标题
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13349845.html
Copyright © 2011-2022 走看看