MQ Engineering Group


MQSeries::Config::QMgr -- Interface to read the queue manager configuration file


  use MQSeries::Config::QMgr;

  my $conf = MQSeries::Config::QMgr->new('your.queue.manager');

  print "All configuration sections: ", join(', ', $conf->stanzas()), "\n";

  my $tuning = $conf->lookup('TuningParameters');
  if (defined $tuning) {
      print "Tuning parameters:\n";
      foreach my $param (sort keys %$tuning) {
          print "\t$param: $tuning->{$param}\n";


The MQSeries::Config::QMgr class is an interface to a queue manager configuration file, typically /var/mqm/qmgrs/XXX/qm.ini for queue manager 'XXX'. This class will parse the file and allow you to lookup any group of settings in the class.

An MQSeries::Config::QMgr object will cache the parsed configuration file for efficiency, but will check the timestamp of the file at every lookup. Should the file change, it will be re-parsed, so that up-to-date information is always returned.



Create a new MQSeries::Config::QMgr object. The constructor takes one required and one optional parameter:

The name of the queue manager
The name of the base directory, if not /var/mqm

The constructor will use the machine configuration file (by default /var/mqm/mqs.ini) to map the queue manager name to the appropriate directory name.


Return an array with all stanza names. These can then be used as a parameter to lookup.


Lookup a stanza in the configuration file. Depending on the context, this returns either an array with one entry for each instance of the stanza found, or the latest stanza with that name. Each entry is a hash-reference with key-value pairs. For example, using $conf-lookup('QueueManager')> returns an array with one hash-reference for each locally-defined queue manager; each hash-reference will contain a 'Name' and 'Directory' field and whatever other fields the configuration file will contain.


/var/mqm/mqs.ini /var/mqm/qmgrs/*/qm.ini


MQSeries(3), MQSeries::Config::Machine