NAME
MQSeries::FDC::Tail -- Watch MQSeries FDC error files
SYNOPSIS
use MQSeries::FDC::Tail;
my $fdc_log = new MQSeries::FDC::Tail("/var/mqm/errors");
while (1) {
my @entries = $fdc_log->process();
process_fdc_entries(@entries) if (@entries);
sleep(10) unless (@entries);
}
sub process_fdc_entries {
my (@fdc_entries) = @_;
foreach my $entry (@fdc_entries) {
# Send off to syslog or whatever
}
}
DESCRIPTION
The MQSeries::FDC::Tail class provides a mechanism to watch the FDC logs, which are generally written to if a fatal MQSeries error, or internal MQSeries error, occurs.
Every time the process() method is invoked, it will return a (possibly empty) array of MQSeries::FDC::Entry objects, which can in turn be analyzed and shipped off to syslog or other monitoring tools.
The MQSeries::FDC::Tail class will notice new FDC files appearing; files being truncated (e.g. by housekeeping jobs) or files being removed.
METHODS
new
Create a new MQSeries::FDC::Tail object. The argument is the directory to watch (/var/mqm/errors for a typical installation).
process
Process any changes since the previous invocation (or the constructor). Read any data found, parse it and return the MQSeries::FDC::Entry objects that were read.
SEE ALSO
MQSeries(3), MQSeries::FDC::Parser(3), MQSeries::FDC::Entry(3), MQSeries::ErrorLog::Tail(3)