Skip Menu |
 

This queue is for tickets about the MQSeries CPAN distribution.

Report information
The Basics
Id: 52768
Status: open
Priority: 0/
Queue: MQSeries

People
Owner: Nobody in particular
Requestors: mark.frost1 [...] pepsi.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: warnings given with inquire channel status
Date: Mon, 14 Dec 2009 20:54:31 -0500
To: "bug-MQSeries [...] rt.cpan.org" <bug-MQSeries [...] rt.cpan.org>
From: "Frost, Mark {PBG}" <mark.frost1 [...] pepsi.com>
Download (untitled) / with headers
text/plain 2.8k
Hello. Thanks for writing this module. I was trying to write a Nagios check to count the number of channel instances on a particular channel. I've found that while I could successfully run the InquireChannelStatus command and get a result, I would get warnings if I used the "-w" flag. I could ignore those, but when turn through Nagios' embedded perl interpreter (epn), it forces -w on which causes the script to not work properly (unless I force epn off for the script which has other implications). In any case, here's the simplest case I could whip up to demonstrate this. Substitute qmgr parameters as variables. Run with '-w' and get something like: Use of uninitialized value in hash element at /usr/local/eam/perl5/x86_64-linux-thread-multi/MQSeries/Command/Base.pm line 444. Use of uninitialized value in hash element at /usr/local/eam/perl5/x86_64-linux-thread-multi/MQSeries/Command/Base.pm line 444. channel CLIENT.MQHTTP has 1 instances. I'm using MQSeries 1.29 and MQ version 7.0.1 on Opensuse 11.2 Linux. Here's my sample script: #!/usr/bin/perl -w # Check the number of connections on a channel (channel instances) use lib qw( /usr/local/eam/perl5/x86_64-linux-thread-multi /usr/local/eam/nagios/libexec /usr/local/eam/perl5 ); use strict; use warnings; # force usage of the client libraries rather than letting MQSeries.pm "guess" use MQClient::MQSeries; use MQSeries::Command; use vars qw( $DEFAULT_CHANNEL $warning $critical $QMGR $HOST $PORT $STATUS_CHANNEL ); # qmgr to connect to $QMGR = 'QMGR'; # hostname the qmgr lives on $HOST = 'hostname'; # qmgr's port number $PORT = 1422; # channel to use for connection $DEFAULT_CHANNEL = 'SYSTEM.ADMIN.SVRCONN'; # channel we want to count channel instances of $STATUS_CHANNEL = 'CHANNEL'; # Instead of passing in a string that's the name of the queue manager, # open a client connection using MQSeries::QueueManager and hand that # object to MQSeries::Command->new my $qmgr = MQSeries::QueueManager->new( QueueManager => $QMGR, ClientConn => { 'ChannelName' => $DEFAULT_CHANNEL, 'ConnectionName' => $HOST . '(' . $PORT . ')', 'TransportType' => 'TCP' } ) or die "Unable to instantiate queue manager object"; my $command = MQSeries::Command->new( QueueManager => $QMGR, Type => 'PCF', ) or die "Unable to instantiate command object" ; my @attrs; @attrs= $command->InquireChannelStatus ( ChannelName => $STATUS_CHANNEL, ChannelInstanceType => 'Current', ChannelInstanceAttrs => [ qw ( All ) ] ) or die "InquireChannelStatus(): " . MQReasonToText($command->Reason()); print "channel $STATUS_CHANNEL has ", $#attrs + 1, " instances.\n"; Thanks. Mark Frost PBG Enterprise Application Management (EAM) Ofc: 914.767.6894
Subject: Re: [rt.cpan.org #52768] warnings given with inquire channel status
Date: Tue, 15 Dec 2009 00:47:38 -0500
To: "Frost, Mark {PBG} via RT" <bug-MQSeries [...] rt.cpan.org>
From: Perl MQSeries Maintainers <perl-mqseries [...] morganstanley.com>
Download (untitled) / with headers
text/plain 1.8k
On Mon, Dec 14, 2009 at 08:54:57PM -0500, Frost, Mark {PBG} via RT wrote: Show quoted text
> Mon Dec 14 20:54:56 2009: Request 52768 was acted upon. > Transaction: Ticket created by mark.frost1@pepsi.com > Queue: MQSeries > Subject: warnings given with inquire channel status > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: mark.frost1@pepsi.com > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=52768 > > > > Hello. Thanks for writing this module.
you're welcome. Show quoted text
> I was trying to write a Nagios check to count the number of channel instances on a particular channel. I've found that while I could successfully run the InquireChannelStatus command and get a result, I would get warnings if I used the "-w" flag. I could ignore those, but when turn through Nagios' embedded perl interpreter (epn), it forces -w on which causes the script to not work properly (unless I force epn off for the script which has other implications).
the use of -w is anachronistic, precisely for situations like this, and has been replaced with the warnings module. but i'm sure you knew that. Show quoted text
> In any case, here's the simplest case I could whip up to demonstrate this. Substitute qmgr parameters as variables. Run with '-w' and get something like: > > Use of uninitialized value in hash element at /usr/local/eam/perl5/x86_64-linux-thread-multi/MQSeries/Command/Base.pm line 444. > Use of uninitialized value in hash element at /usr/local/eam/perl5/x86_64-linux-thread-multi/MQSeries/Command/Base.pm line 444. > channel CLIENT.MQHTTP has 1 instances. > > I'm using MQSeries 1.29 and MQ version 7.0.1 on Opensuse 11.2 Linux.
i don't have an environment which is precisely the same, but i cannot reproduce this with 1.27, 1.29, or 1.30. can you uncomment line 417 and tell us what that prints?
CC: mqcore [...] morganstanley.com
Subject: Re: [rt.cpan.org #52768] warnings given with inquire channel status
Date: Tue, 15 Dec 2009 07:29:08 -0500
To: bug-MQSeries [...] rt.cpan.org
From: Hildo Biersma <hildo.biersma [...] gmail.com>
Download (untitled) / with headers
text/plain 3.8k
Mark, The 1.30 release of the perl MQSeries module vastly reduces the number of unitiialized variable warnings. It ought to solve your problem - please give it a try. I am cc'ing the current maintainers of the module - I am no longer working on the perl MQSeries module. Regards, Hildo On Mon, Dec 14, 2009 at 8:54 PM, Frost, Mark {PBG} via RT <bug-MQSeries@rt.cpan.org> wrote: Show quoted text
> Mon Dec 14 20:54:56 2009: Request 52768 was acted upon. > Transaction: Ticket created by mark.frost1@pepsi.com >       Queue: MQSeries >     Subject: warnings given with inquire channel status >   Broken in: (no value) >    Severity: (no value) >       Owner: Nobody >  Requestors: mark.frost1@pepsi.com >      Status: new >  Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=52768 > > > > Hello.  Thanks for writing this module. > > I was trying to write a Nagios check to count the number of channel instances on a particular channel.  I've found that while I could successfully run the InquireChannelStatus command and get a result, I would get warnings if I used the "-w" flag.  I could ignore those, but when turn through Nagios' embedded perl interpreter (epn), it forces -w on which causes the script to not work properly (unless I force epn off for the script which has other implications). > > In any case, here's the simplest case I could whip up to demonstrate this.  Substitute qmgr parameters as variables.  Run with '-w' and get something like: > > Use of uninitialized value in hash element at /usr/local/eam/perl5/x86_64-linux-thread-multi/MQSeries/Command/Base.pm line 444. > Use of uninitialized value in hash element at /usr/local/eam/perl5/x86_64-linux-thread-multi/MQSeries/Command/Base.pm line 444. > channel CLIENT.MQHTTP has 1 instances. > > I'm using MQSeries 1.29 and MQ version 7.0.1 on Opensuse 11.2 Linux. > > Here's my sample script: > > #!/usr/bin/perl -w > > # Check the number of connections on a channel (channel instances) > > use lib qw( /usr/local/eam/perl5/x86_64-linux-thread-multi >            /usr/local/eam/nagios/libexec >            /usr/local/eam/perl5 ); > use strict; > use warnings; > > # force usage of the client libraries rather than letting MQSeries.pm "guess" > use MQClient::MQSeries; > use MQSeries::Command; > > use vars qw( >    $DEFAULT_CHANNEL $warning $critical >    $QMGR $HOST $PORT $STATUS_CHANNEL > ); > > # qmgr to connect to > $QMGR = 'QMGR'; > # hostname the qmgr lives on > $HOST = 'hostname'; > # qmgr's port number > $PORT = 1422; > # channel to use for connection > $DEFAULT_CHANNEL = 'SYSTEM.ADMIN.SVRCONN'; > # channel we want to count channel instances of > $STATUS_CHANNEL  = 'CHANNEL'; > > > # Instead of passing in a string that's the name of the queue manager, > # open a client connection using MQSeries::QueueManager and hand that > # object to MQSeries::Command->new > > my $qmgr = MQSeries::QueueManager->new( >            QueueManager => $QMGR, >            ClientConn => { >                'ChannelName'    => $DEFAULT_CHANNEL, >                'ConnectionName' => $HOST . '(' . $PORT . ')', >                'TransportType'  => 'TCP' >            } > ) or die "Unable to instantiate queue manager object"; > > my $command = MQSeries::Command->new( >                  QueueManager => $QMGR, >                  Type         => 'PCF', >              ) >  or die "Unable to instantiate command object" ; > > > my @attrs; > > @attrs= $command->InquireChannelStatus ( >    ChannelName => $STATUS_CHANNEL, >    ChannelInstanceType => 'Current', >    ChannelInstanceAttrs => [ qw ( All ) ] >    ) or die "InquireChannelStatus(): " . MQReasonToText($command->Reason()); > > print "channel $STATUS_CHANNEL has ", $#attrs + 1, " instances.\n"; > > > Thanks. > > Mark Frost > PBG Enterprise Application Management (EAM) > Ofc: 914.767.6894 > > > >
Subject: RE: [rt.cpan.org #52768] warnings given with inquire channel status
Date: Tue, 15 Dec 2009 10:09:13 -0500
To: "bug-MQSeries [...] rt.cpan.org" <bug-MQSeries [...] rt.cpan.org>
From: "Frost, Mark {PBG}" <mark.frost1 [...] pepsi.com>
Download (untitled) / with headers
text/plain 4.2k
Hmm. Thanks, Hildo. So then, shouldn't mail sent to the bug-MQSeries@rt.cpan.org list automatically go to the new maintainers? I was confused about the 1.30 release as it says "Unauthorized" all over it on CPAN. Thanks again, for all your work on this module. It's been very helpful. Mark Show quoted text
________________________________________ From: Hildo Biersma via RT [bug-MQSeries@rt.cpan.org] Sent: Tuesday, December 15, 2009 7:31 AM To: Frost, Mark {PBG} Subject: Re: [rt.cpan.org #52768] warnings given with inquire channel status <URL: http://rt.cpan.org/Ticket/Display.html?id=52768 > Mark, The 1.30 release of the perl MQSeries module vastly reduces the number of unitiialized variable warnings. It ought to solve your problem - please give it a try. I am cc'ing the current maintainers of the module - I am no longer working on the perl MQSeries module. Regards, Hildo On Mon, Dec 14, 2009 at 8:54 PM, Frost, Mark {PBG} via RT <bug-MQSeries@rt.cpan.org> wrote:
> Mon Dec 14 20:54:56 2009: Request 52768 was acted upon. > Transaction: Ticket created by mark.frost1@pepsi.com > Queue: MQSeries > Subject: warnings given with inquire channel status > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: mark.frost1@pepsi.com > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=52768 > > > > Hello. Thanks for writing this module. > > I was trying to write a Nagios check to count the number of channel instances on a particular channel. I've found that while I could successfully run the InquireChannelStatus command and get a result, I would get warnings if I used the "-w" flag. I could ignore those, but when turn through Nagios' embedded perl interpreter (epn), it forces -w on which causes the script to not work properly (unless I force epn off for the script which has other implications). > > In any case, here's the simplest case I could whip up to demonstrate this. Substitute qmgr parameters as variables. Run with '-w' and get something like: > > Use of uninitialized value in hash element at /usr/local/eam/perl5/x86_64-linux-thread-multi/MQSeries/Command/Base.pm line 444. > Use of uninitialized value in hash element at /usr/local/eam/perl5/x86_64-linux-thread-multi/MQSeries/Command/Base.pm line 444. > channel CLIENT.MQHTTP has 1 instances. > > I'm using MQSeries 1.29 and MQ version 7.0.1 on Opensuse 11.2 Linux. > > Here's my sample script: > > #!/usr/bin/perl -w > > # Check the number of connections on a channel (channel instances) > > use lib qw( /usr/local/eam/perl5/x86_64-linux-thread-multi > /usr/local/eam/nagios/libexec > /usr/local/eam/perl5 ); > use strict; > use warnings; > > # force usage of the client libraries rather than letting MQSeries.pm "guess" > use MQClient::MQSeries; > use MQSeries::Command; > > use vars qw( > $DEFAULT_CHANNEL $warning $critical > $QMGR $HOST $PORT $STATUS_CHANNEL > ); > > # qmgr to connect to > $QMGR = 'QMGR'; > # hostname the qmgr lives on > $HOST = 'hostname'; > # qmgr's port number > $PORT = 1422; > # channel to use for connection > $DEFAULT_CHANNEL = 'SYSTEM.ADMIN.SVRCONN'; > # channel we want to count channel instances of > $STATUS_CHANNEL = 'CHANNEL'; > > > # Instead of passing in a string that's the name of the queue manager, > # open a client connection using MQSeries::QueueManager and hand that > # object to MQSeries::Command->new > > my $qmgr = MQSeries::QueueManager->new( > QueueManager => $QMGR, > ClientConn => { > 'ChannelName' => $DEFAULT_CHANNEL, > 'ConnectionName' => $HOST . '(' . $PORT . ')', > 'TransportType' => 'TCP' > } > ) or die "Unable to instantiate queue manager object"; > > my $command = MQSeries::Command->new( > QueueManager => $QMGR, > Type => 'PCF', > ) > or die "Unable to instantiate command object" ; > > > my @attrs; > > @attrs= $command->InquireChannelStatus ( > ChannelName => $STATUS_CHANNEL, > ChannelInstanceType => 'Current', > ChannelInstanceAttrs => [ qw ( All ) ] > ) or die "InquireChannelStatus(): " . MQReasonToText($command->Reason()); > > print "channel $STATUS_CHANNEL has ", $#attrs + 1, " instances.\n"; > > > Thanks. > > Mark Frost > PBG Enterprise Application Management (EAM) > Ofc: 914.767.6894 > > > >
CC: mqcore [...] morganstanley.com
Subject: Re: [rt.cpan.org #52768] warnings given with inquire channel status
Date: Tue, 15 Dec 2009 17:20:15 -0500
To: bug-MQSeries [...] rt.cpan.org
From: Hildo Biersma <hildo.biersma [...] gmail.com>
Download (untitled) / with headers
text/plain 5.1k
There's some weirdness going on with the module handover that isn't resolved as of yet. I'm not sure what the problem is, but it's on the CPAN side. The new maintainer (still at Morgan Stanley) are absolutely authorized and are sure to do a good job. I'm no longer doing anything MQ or perl related as I'm now at Google - so please go with the 1.30 release and the new maintainers. Hildo On Tue, Dec 15, 2009 at 10:11 AM, Frost, Mark {PBG} via RT <bug-MQSeries@rt.cpan.org> wrote: Show quoted text
>       Queue: MQSeries >  Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=52768 > > > Hmm.  Thanks, Hildo. > > So then, shouldn't mail sent to the bug-MQSeries@rt.cpan.org list automatically go to the new maintainers? > > I was confused about the 1.30 release as it says "Unauthorized" all over it on CPAN. > > Thanks again, for all your work on this module.  It's been very  helpful. > > Mark > ________________________________________ > From: Hildo Biersma via RT [bug-MQSeries@rt.cpan.org] > Sent: Tuesday, December 15, 2009 7:31 AM > To: Frost, Mark {PBG} > Subject: Re: [rt.cpan.org #52768] warnings given with inquire channel status > > <URL: http://rt.cpan.org/Ticket/Display.html?id=52768 > > > Mark, > > The 1.30 release of the perl MQSeries module vastly reduces the number > of unitiialized variable warnings.  It ought to solve your problem - > please give it a try. > > I am cc'ing the current maintainers of the module - I am no longer > working on the perl MQSeries module. > > Regards, Hildo > > On Mon, Dec 14, 2009 at 8:54 PM, Frost, Mark {PBG} via RT > <bug-MQSeries@rt.cpan.org> wrote:
>> Mon Dec 14 20:54:56 2009: Request 52768 was acted upon. >> Transaction: Ticket created by mark.frost1@pepsi.com >>       Queue: MQSeries >>     Subject: warnings given with inquire channel status >>   Broken in: (no value) >>    Severity: (no value) >>       Owner: Nobody >>  Requestors: mark.frost1@pepsi.com >>      Status: new >>  Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=52768 > >> >> >> Hello.  Thanks for writing this module. >> >> I was trying to write a Nagios check to count the number of channel instances on a particular channel.  I've found that while I could successfully run the InquireChannelStatus command and get a result, I would get warnings if I used the "-w" flag.  I could ignore those, but when turn through Nagios' embedded perl interpreter (epn), it forces -w on which causes the script to not work properly (unless I force epn off for the script which has other implications). >> >> In any case, here's the simplest case I could whip up to demonstrate this.  Substitute qmgr parameters as variables.  Run with '-w' and get something like: >> >> Use of uninitialized value in hash element at /usr/local/eam/perl5/x86_64-linux-thread-multi/MQSeries/Command/Base.pm line 444. >> Use of uninitialized value in hash element at /usr/local/eam/perl5/x86_64-linux-thread-multi/MQSeries/Command/Base.pm line 444. >> channel CLIENT.MQHTTP has 1 instances. >> >> I'm using MQSeries 1.29 and MQ version 7.0.1 on Opensuse 11.2 Linux. >> >> Here's my sample script: >> >> #!/usr/bin/perl -w >> >> # Check the number of connections on a channel (channel instances) >> >> use lib qw( /usr/local/eam/perl5/x86_64-linux-thread-multi >>            /usr/local/eam/nagios/libexec >>            /usr/local/eam/perl5 ); >> use strict; >> use warnings; >> >> # force usage of the client libraries rather than letting MQSeries.pm "guess" >> use MQClient::MQSeries; >> use MQSeries::Command; >> >> use vars qw( >>    $DEFAULT_CHANNEL $warning $critical >>    $QMGR $HOST $PORT $STATUS_CHANNEL >> ); >> >> # qmgr to connect to >> $QMGR = 'QMGR'; >> # hostname the qmgr lives on >> $HOST = 'hostname'; >> # qmgr's port number >> $PORT = 1422; >> # channel to use for connection >> $DEFAULT_CHANNEL = 'SYSTEM.ADMIN.SVRCONN'; >> # channel we want to count channel instances of >> $STATUS_CHANNEL  = 'CHANNEL'; >> >> >> # Instead of passing in a string that's the name of the queue manager, >> # open a client connection using MQSeries::QueueManager and hand that >> # object to MQSeries::Command->new >> >> my $qmgr = MQSeries::QueueManager->new( >>            QueueManager => $QMGR, >>            ClientConn => { >>                'ChannelName'    => $DEFAULT_CHANNEL, >>                'ConnectionName' => $HOST . '(' . $PORT . ')', >>                'TransportType'  => 'TCP' >>            } >> ) or die "Unable to instantiate queue manager object"; >> >> my $command = MQSeries::Command->new( >>                  QueueManager => $QMGR, >>                  Type         => 'PCF', >>              ) >>  or die "Unable to instantiate command object" ; >> >> >> my @attrs; >> >> @attrs= $command->InquireChannelStatus ( >>    ChannelName => $STATUS_CHANNEL, >>    ChannelInstanceType => 'Current', >>    ChannelInstanceAttrs => [ qw ( All ) ] >>    ) or die "InquireChannelStatus(): " . MQReasonToText($command->Reason()); >> >> print "channel $STATUS_CHANNEL has ", $#attrs + 1, " instances.\n"; >> >> >> Thanks. >> >> Mark Frost >> PBG Enterprise Application Management (EAM) >> Ofc: 914.767.6894 >> >> >> >>
> > >
Subject: RE: [rt.cpan.org #52768] warnings given with inquire channel status
Date: Tue, 15 Dec 2009 20:55:11 -0500
To: "bug-MQSeries [...] rt.cpan.org" <bug-MQSeries [...] rt.cpan.org>
From: "Frost, Mark {PBG}" <mark.frost1 [...] pepsi.com>
Download (untitled) / with headers
text/plain 5.5k
Unfortunately, I see the same problem with the 1.30 version. Show quoted text
-----Original Message----- From: Hildo Biersma via RT [mailto:bug-MQSeries@rt.cpan.org] Sent: Tuesday, December 15, 2009 5:21 PM To: Frost, Mark {PBG} Subject: Re: [rt.cpan.org #52768] warnings given with inquire channel status <URL: http://rt.cpan.org/Ticket/Display.html?id=52768 > There's some weirdness going on with the module handover that isn't resolved as of yet. I'm not sure what the problem is, but it's on the CPAN side. The new maintainer (still at Morgan Stanley) are absolutely authorized and are sure to do a good job. I'm no longer doing anything MQ or perl related as I'm now at Google - so please go with the 1.30 release and the new maintainers. Hildo On Tue, Dec 15, 2009 at 10:11 AM, Frost, Mark {PBG} via RT <bug-MQSeries@rt.cpan.org> wrote:
>       Queue: MQSeries >  Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=52768 > > > Hmm.  Thanks, Hildo. > > So then, shouldn't mail sent to the bug-MQSeries@rt.cpan.org list automatically go to the new maintainers? > > I was confused about the 1.30 release as it says "Unauthorized" all over it on CPAN. > > Thanks again, for all your work on this module.  It's been very  helpful. > > Mark > ________________________________________ > From: Hildo Biersma via RT [bug-MQSeries@rt.cpan.org] > Sent: Tuesday, December 15, 2009 7:31 AM > To: Frost, Mark {PBG} > Subject: Re: [rt.cpan.org #52768] warnings given with inquire channel status > > <URL: http://rt.cpan.org/Ticket/Display.html?id=52768 > > > Mark, > > The 1.30 release of the perl MQSeries module vastly reduces the number > of unitiialized variable warnings.  It ought to solve your problem - > please give it a try. > > I am cc'ing the current maintainers of the module - I am no longer > working on the perl MQSeries module. > > Regards, Hildo > > On Mon, Dec 14, 2009 at 8:54 PM, Frost, Mark {PBG} via RT > <bug-MQSeries@rt.cpan.org> wrote:
>> Mon Dec 14 20:54:56 2009: Request 52768 was acted upon. >> Transaction: Ticket created by mark.frost1@pepsi.com >>       Queue: MQSeries >>     Subject: warnings given with inquire channel status >>   Broken in: (no value) >>    Severity: (no value) >>       Owner: Nobody >>  Requestors: mark.frost1@pepsi.com >>      Status: new >>  Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=52768 > >> >> >> Hello.  Thanks for writing this module. >> >> I was trying to write a Nagios check to count the number of channel instances on a particular channel.  I've found that while I could successfully run the InquireChannelStatus command and get a result, I would get warnings if I used the "-w" flag.  I could ignore those, but when turn through Nagios' embedded perl interpreter (epn), it forces -w on which causes the script to not work properly (unless I force epn off for the script which has other implications). >> >> In any case, here's the simplest case I could whip up to demonstrate this.  Substitute qmgr parameters as variables.  Run with '-w' and get something like: >> >> Use of uninitialized value in hash element at /usr/local/eam/perl5/x86_64-linux-thread-multi/MQSeries/Command/Base.pm line 444. >> Use of uninitialized value in hash element at /usr/local/eam/perl5/x86_64-linux-thread-multi/MQSeries/Command/Base.pm line 444. >> channel CLIENT.MQHTTP has 1 instances. >> >> I'm using MQSeries 1.29 and MQ version 7.0.1 on Opensuse 11.2 Linux. >> >> Here's my sample script: >> >> #!/usr/bin/perl -w >> >> # Check the number of connections on a channel (channel instances) >> >> use lib qw( /usr/local/eam/perl5/x86_64-linux-thread-multi >>            /usr/local/eam/nagios/libexec >>            /usr/local/eam/perl5 ); >> use strict; >> use warnings; >> >> # force usage of the client libraries rather than letting MQSeries.pm "guess" >> use MQClient::MQSeries; >> use MQSeries::Command; >> >> use vars qw( >>    $DEFAULT_CHANNEL $warning $critical >>    $QMGR $HOST $PORT $STATUS_CHANNEL >> ); >> >> # qmgr to connect to >> $QMGR = 'QMGR'; >> # hostname the qmgr lives on >> $HOST = 'hostname'; >> # qmgr's port number >> $PORT = 1422; >> # channel to use for connection >> $DEFAULT_CHANNEL = 'SYSTEM.ADMIN.SVRCONN'; >> # channel we want to count channel instances of >> $STATUS_CHANNEL  = 'CHANNEL'; >> >> >> # Instead of passing in a string that's the name of the queue manager, >> # open a client connection using MQSeries::QueueManager and hand that >> # object to MQSeries::Command->new >> >> my $qmgr = MQSeries::QueueManager->new( >>            QueueManager => $QMGR, >>            ClientConn => { >>                'ChannelName'    => $DEFAULT_CHANNEL, >>                'ConnectionName' => $HOST . '(' . $PORT . ')', >>                'TransportType'  => 'TCP' >>            } >> ) or die "Unable to instantiate queue manager object"; >> >> my $command = MQSeries::Command->new( >>                  QueueManager => $QMGR, >>                  Type         => 'PCF', >>              ) >>  or die "Unable to instantiate command object" ; >> >> >> my @attrs; >> >> @attrs= $command->InquireChannelStatus ( >>    ChannelName => $STATUS_CHANNEL, >>    ChannelInstanceType => 'Current', >>    ChannelInstanceAttrs => [ qw ( All ) ] >>    ) or die "InquireChannelStatus(): " . MQReasonToText($command->Reason()); >> >> print "channel $STATUS_CHANNEL has ", $#attrs + 1, " instances.\n"; >> >> >> Thanks. >> >> Mark Frost


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.