ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » help with MQCMD_RESET_Q_STATS PCF command via perl

Post new topic  Reply to topic
 help with MQCMD_RESET_Q_STATS PCF command via perl « View previous topic :: View next topic » 
Author Message
blacksmith
PostPosted: Tue Feb 10, 2004 11:34 am    Post subject: help with MQCMD_RESET_Q_STATS PCF command via perl Reply with quote

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
View user's profile Send private message Send e-mail
blacksmith
PostPosted: Thu Feb 12, 2004 10:14 am    Post subject: Found the problem Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » help with MQCMD_RESET_Q_STATS PCF command via perl
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.