|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
help with MQCMD_RESET_Q_STATS PCF command via perl |
« View previous topic :: View next topic » |
Author |
Message
|
blacksmith |
Posted: Tue Feb 10, 2004 11:34 am Post subject: help with MQCMD_RESET_Q_STATS PCF command via perl |
|
|
Newbie
Joined: 29 Dec 2003 Posts: 3
|
Hello,
I have been trying to create a small perl executable to reset q statistics for a given queue and then print the appropriate response. Here is the code that I have been playing with:
Code: |
#!/usr/bin/perl
use MQSeries;
use MQSeries::Command;
my $command = MQSeries::Command->new
(
QueueManager => 'FIREBRAND',
) or die ("Unable to instantiate command object\n");
#@statistics = $command->ResetQueueStatistics( QName => 'PAT.SMITH') or die "Unable to resset queue stata\n";
@qnames = qw(PAT.SMITH SMITH.PAT);
foreach my $qname (@qnames)
{
print "$qname\n";
$attr = $command->ResetQueueStatistics
(
QName => $qname,
) or die "ResetQueueStatistics: " . MQReasonToText($command->Reason()) . "\n";
print "QName = $qname\n";
foreach my $key ( sort keys %$attr )
{
print "\t$key => $attr->{$key}\n";
}
}
|
When I run this command, the computer thinks for about 1.5 minutes and then coughs up the following:
[mqm@firebrand perl]$ ./pcf.pl
PAT.SMITH
Last response message never seen
at ./pcf.pl line 18
ResetQueueStatistics: Unexpected error occurred.
I'm not really sure what's going on here. I'm not really C or Java literate so I'm kind of stuck with the perl API. I have succesfully used the perl API on this particular server to browse queues, stop and start channels, putinhinit queues etc, so I don't think the mqseries build is off or anything. I do realize however that this is PCF and not run of the mill MQI.
Any help would be greatly appreciated
TIA
Pat _________________ Neutrinos don't have mass? I didn't even know they were Catholic! |
|
Back to top |
|
 |
blacksmith |
Posted: Thu Feb 12, 2004 10:14 am Post subject: Found the problem |
|
|
Newbie
Joined: 29 Dec 2003 Posts: 3
|
Hi there,
Just thought I'd post this for newbies like myself that might encounter a similar frustration. After a couple of days of running the scripts and reading lot's of documentation, I found the problem was that the amqpcsea (command server) process was not running. Thus the problem was not with the code, but rather with the set up of my mq install.
It seems that for MQ on NT, this process starts at initialization, where-as with Linux/Unix systems this process has to be stared manually with:
strmqcsv <qmgr name>
And stopped with
endmqcsv <qmgr name>
When I discoverd that the command server wasn't running, I strated it with the above and the scripts worked fine!
As a post-script to this episode, when I mentioned the final solution to one of my team mates, and that I would be modifying my init scripts for starting MQSeries on our Unix machines, she advised against starting amqpcsea autometically, but suggested rather manually starting and stopping the process with-in my scripts so as not to leave the command server vulnerable to uninvited messaging all the time.
Pat _________________ Neutrinos don't have mass? I didn't even know they were Catholic! |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|