MQSeries::ErrorLog::Entry -- One entry in an MQSeries error-log file
# # Assuming we get an array of parsed MQSeries::ErrorLog::Entry # objects from somewhere, here's how we dump them to syslog. # use Sys::Syslog; openlog($0, 'pid', 'daemon'); sub process_errorlog_entries { foreach my $entry (@_) { syslog('info', "$entry"); # Overloaded operator-"" } }
The MQSeries::ErrorLog::Entry class is not used directly, but invoked through the MQSeries::ErrorLog::Parser class.
When the MQSeries::ErrorLog::Tail or MQSeries::ErrorLog::Parser classes return an array of entries, these can be queried for their error-codes, summary, parsed fields, etc.
This class has overloaded the '""' (to-string) operator, which means that printing an object results in reasonable results.
Create a new MQSeries::ErrorLog::Entry object. The parameters are not documented; use the MQSeries::ErrorLog::Parser class to create these.
Return the error code (e.g., AMQ9001)
Return the original time-stamp from the entry, in Unix time() format
Return the original summary
Get (one parameter) or set (two parameters) detailed parsed fields, such as 'QMgr', 'Channel', 'Host', etc. See the 'descriptions.pl' files used by the MQSeries::ErrorLog::Parser class for a list of supported messages and the fields parsed.
Get a list of all field names supported by this entry.
Return a string with the details of this entry; also invoked by the overloaded operator-"".
The file 'descriptions.pl' contains a list of all error messages supported, in the form of regular expressions and a set of field names extracted from these expressions. Additions and corrections are welcome.
MQSeries(3), MQSeries::ErrorLog::Tail(3), MQSeries::ErrorLog::Parser(3)
To install MQSeries, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MQSeries
CPAN shell
perl -MCPAN -e shell install MQSeries
For more information on module installation, please visit the detailed CPAN module installation guide.