NAME

MQSeries::Config::Machine -- Interface to read the machine configuration file

SYNOPSIS

use MQSeries::Config::Machine;

my $conf = new MQSeries::Config::Machine;

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

my $default = $conf->lookup('DefaultQueueManager');
if (defined $default) {
    print "Default queue manager: $default->{'Name'}\n";
}

my $local = $conf->localqmgrs();
print "All local queue managers:\n";
while (my ($name, $data) = each %$local) {
    print "  $name - $data->{'Directory'}\n";
}

DESCRIPTION

The MQSeries::Config::Machine class is an interface to the machine configuration file, typically /var/mqm/mqs.ini. This class will parse the file and allow you to lookup any group of settings in the class. A utility function based on this will return a full list of all local queue managers and their base directory name.

An MQSeries::Config::Machine 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::Machine object. The constructor takes an optional filename parameter, used when your configuration file is not at the default location of /var/mqm/mqs.ini.

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.

localqmgrs

A convenience function written on top of lookup. This function returns a hash-reference mapping local queue manager names to configuration settings.

FILES

/var/mqm/mqs.ini

SEE ALSO

MQSeries(3), MQSeries::Config::QMgr