How to summarise the AMQ*.LOGs on distributed MQ
ColinPaice |July 1 2016 Updated
I was at a customer recently and had to review their MQ logs... I found these magic (Unix) commands to help
Suppressing boring messages
With the help of a friend I have found a way to suppress boring messages
Create a file such as AMQ.ignore with the messages numbers you want to suppress, for example
AMQ5022: The Channel Initiator has started. ProcessId(9568426).
AMQ5023: The Channel Initiator has ended. ProcessId(7864738).
AMQ5024: The Command Server has started. ProcessId(7078068).
AMQ5025: The Command Server has ended. ProcessId(9699812).
AMQ5026: The Listener 'BP14_LSR' has started. ProcessId(8257644).
AMQ5027: The Listener 'BP14_LSR' has ended. ProcessId(8257644).
AMQ5030: The Command 'MQSI_BREIBP14' has started. ProcessId(6619602).
AMQ5037: The Queue Manager task 'QPUBSUB-CTRLR' has started.
AMQ5041: The Queue Manager task 'LOGGEREV' has ended.
AMQ5806: WebSphere MQ Publish/Subscribe broker started for queue manager
AMQ5807: WebSphere MQ Publish/Subscribe broker for queue manager ........
AMQ5975: 'WebSphere MQ Distributed Pub/Sub Controller' has started.
AMQ5976: 'WebSphere MQ Distributed Pub/Sub Command Task' has ended.
AMQ6287: WebSphere MQ 7.0.1.12.
AMQ7030: Quiesce request accepted. The queue manager will stop when all
AMQ7229: 469 log records accessed on queue manager '........' during the log
AMQ7230: Log replay for queue manager '........' complete.
AMQ7231: 0 log records accessed on queue manager '........' during the recovery
AMQ7232: Transaction manager state recovered for queue manager '........'.
AMQ7233: 0 out of 0 in-flight transactions resolved for queue manager
AMQ7467: The oldest log file required to start queue manager ........ is
AMQ7468: The oldest log file required to perform media recovery of queue
AMQ8003: WebSphere MQ queue manager '........' started.
AMQ8004: WebSphere MQ queue manager '........' ended.
AMQ8024: WebSphere MQ channel initiator started.
AMQ9410: Repository manager started
AMQ9411: Repository manager ended normally.
AMQ9492: The TCP/IP responder program encountered an error.
AMQ9542: Queue manager is ending.
Use the unix commands
grep -e ^AMQ AMQ.ignore |awk '{print $1}'> AMQ.grep
to take the .ignore file and extract just the message numbers from column 1, and create a file called AMQ.grep
AMQ5975:
AMQ5976:
AMQ6287:
.....
then use a more complex command
grep -e AMQ AMQ*.LOG|grep -f AMQ.grep -v | sort -uk1,1
This says
grep -e AMQ AMQ*.LOG search for all lines with AMQ in them in the AMQ*.LOG files
|grep -f AMQ.grep -v | pipe them into grep which uses the lines in the AMQ.grep file, and pass on the lines that do not match (-v)
| sort -uk1,1 sort the data and make it unique on the first field
This gave me
AMQ9208: Error on receive from host 10.99.99.99 (10.99.99.99).
AMQ9209: Connection to host '10.99.99.99(110.99.99.99)' closed.
AMQ9259: Connection timed out from host 10.99.99.99'.
AMQ9508: Program cannot connect to the queue manager.
and suppressed all of the boring messages.
Summarize all messages
grep -h -e AMQ *.LOG|sort| uniq -c -w8
where
grep is the program to search for something
-h says do not put file name on the front
-e AMQ* says all the line with AMQ in them
*.LOG is the name of the files to look in. My fully qualified file names were /var/mqm/qmgrs/QMA/errors/*.LOG
|sort pipe this into the sort program which sorts by the error message number in the first column
|uniq pipe with parameters
-c count the lines
-w8 only the first 8 characters in the file
This gave me output which included
4642 AMQ7316: Failed to put message to statistics queue. Reason(2053)
2 AMQ7466: There is a problem with the size of the logfile.
22 AMQ7469 or AMQ7485 has been issued indicating if the transaction was rolled
So I had
- many problems putting to the stats queue
- A problem with the size of the log file
- and some other problem
All of which I need to look into.
You can then do
/var/mqm/qmgrs/QMA/errors-$grep -e AMQ7466 *.LOG
AMQERR03.LOG:AMQ7466: There is a problem with the size of the logfile.
AMQERR03.LOG:AMQ7466: There is a problem with the size of the logfile.
grep without -h puts the name of the file at the front. You can now use your favorite editor to look at the file.