NAME
MQSeries::Config::QMgr -- Interface to read the queue manager configuration file
SYNOPSIS
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";
}
}
DESCRIPTION
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.
METHODS
new
Create a new MQSeries::Config::QMgr object. The constructor takes one required and one optional parameter:
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.
stanzas
Return an array with all stanza names. These can then be used as a parameter to lookup
.
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.
FILES
/var/mqm/mqs.ini /var/mqm/qmgrs/*/qm.ini
SEE ALSO
MQSeries(3), MQSeries::Config::Machine