MQ Engineering Group > MQSeries-1.34 > MQSeries::FDC::Tail

Download:
MQSeries-1.34.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  8
Open  4
View/Report Bugs
Module Version: 1.34   Source  

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). An optional second argument specifies the maximum number of files that may be open at the same time; the default is 200, well under the default limit of 255 open files imposed by the stdio libraries of many vendors.

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)

syntax highlighting: