An IBM MQ AMQERR log file contains list of events that are logged by IBM MQ and its QMgrs. Each event (also known as a log record) is to notify users about an error, informational event, or warning. Most important field of a log record is the AMQnnnn code that gives details on type event occurred. This log file is the primary source to monitor and explore the status of IBM MQ Infrastructure in an organization. Log files vary in sizes, from few kilobytes to many megabytes. More information about the IBM MQ AMQERR log files can be found at IBM MQ Knowledge Centre(Using IBM MQ Logs).
This article assumes that
- You have a valid IBM Bluemix account created. Refer to IBM Bluemix registration
- Python v2.6.6 or above installed.
- Curl(with openssl or winssl) installed.
In this article, we will focus on IBM Cloud Product Insights-Log Management software: how to configure it to process IBM MQ logs(example: AMQERR01.LOG), send the log records to Product Insights-Log Management service on IBM Bluemix and how to use Kibana-v4 to view and explore the data to monitor your IBM MQ infrastructure.
Below steps will guide you to setup and configure Product Insights-Log management
- Download the Product Insights–Log Management software
- Setup and Configure filebeat agent.
- Viewing Log Management dashboards to monitor and explore the AMQERR logs.
- If you have used the IBM Cloud Product Insights capability in IBM MQ v9.0.2 to register a queue manager, then you can create a Product Insights Log Management service in IBM Bluemix and access the IBM MQ log data from the service dashboard. This provides a single point access for IBM MQ Registration and Usage metrics as well as helps to analyze and explore IBM MQ logs. More Information at IBM Cloud Product Insights-Log Management Service
The IBM Cloud Product Insights service runs within Bluemix and receives information from the enabled on-premises IBM software products. This information is then shown within the service instance dashboard. Product Insights connects to on-premises IBM software products to build a cross-product inventory and provide insights into product usage metrics. For more information refer to IBM Bluemix Doc
- For older versions of IBM MQ (that are prior to IBM MQ v9.0.2) follow the steps to setup and configure Product Insights-Log management.
- Product Insights - Log management service is currently offered as an experimental service on IBM Bluemix.
Step#1 - Download latest “IBM Cloud Product Insights – Log Management” software
Step#2 - Configuring filebeat agent with your on-premise IBM MQ
For each on-premise server with logs that you want to send to the Product Insights–Log Management service on IBM Bluemix, perform the following steps:
Note: It can be configured to send single or multiple QMgr AMQERR logs to Product Insights–Log Management service.
- Create a new directory named BluemixLogging and unzip the downloaded package to that directory.
- At the command line, change to the BluemixLogging directory and run the following command to execute the configuration utility:
python bluemixLogSetup.py -u BluemixUserName -p BluemixPassword -o BluemixOrganizationName -s BluemixSpaceName -r BluemixRegion -d dashboardNames
- bluemixUserName is your BluemixAccount Name
- bluemixPassword is the password associated with the specified bluemixUserName. This is an optional command line input, if not set, during command execution, a password prompt will appear for you to key-in. Please refer to example below.
- bluemixOrganizationName is the Bluemix organization that you want to use (described in Setting up an IBM Bluemix account)
- bluemixSpaceName is a defined space within the specified Bluemix organization
- BluemixRegion can be either us-south or eu-gb
- dashboardNames is a comma separated list of products whose dashboards you want to publish. Accepted value for IBM MQ: "mq"
- example : python bluemixLogSetup.py -u email@example.com -o firstname.lastname@example.org -s dev -r us-south -d mq
Here is an example of the command output:
Enter password for Bluemix ID 'email@example.com' :
Connecting to Bluemix us-south region
Your Kibana 4 dashboards can be accessed at the following location:
The Kibana 4 dashboards that have been uploaded include:
IBM MQ AMQERR Dashboard
In order to complete the setup, perform the following steps:
1. edit c2clogging.yml
2. uncomment prospector for your logtype.
each prospectors start with -input_type
3. change paths under the propspector to point to your log files
4. yml file is space and indent sensitive.
ensure you are not adding additional spaces or deleting
spaces while editing this file
5. Start filebeat using ./filebeat -c ./c2clogging.yml &
When you run the command, the configuration utility creates the required certificates to send logs to Product Insights–Log Management service on Bluemix and sets up dashboards for the products that you have listed. The configuration utility also creates a filebeat agent configuration file named c2clogging.yml.
- Modify the c2clogging.yml file
- Uncomment the MQ Prospector section.
- Update the path so that it references the paths of your IBM MQ log files; you can set multiple paths, that is, both IBM MQ logs as well as QMgr specific log paths, for example:
- - var/mqm/errors/AMQERR01.LOG
- - var/mqm/errors/qmgrs/<QMgr Name1>/errors/AMQERR01.LOG
- - var/mqm/errors/qmgrs/<QMgr Name2>/errors/AMQERR01.LOG
- Uncomment the date format as per your computer's setting.
- In the "processors:" section, uncomment the IBM MQ related item(- drop_fields:)
- Screenshot below shall guide you doing this activity
- At the command line, start the filebeat agent by running the following command:
./filebeat -c ./c2clogging.yml &
- Once the filebeat agent is started, it begins to send log data to Product Insights–Log Management service in IBM Bluemix. To confirm that the filebeat agent is working, check the following log file: filebeat.log
Step#3 - Access the IBM Cloud Product Insights – Log Management dashboards
- Start your browser and go to the URL that was generated by the configuration utility during setup (example: https://logmet.ng.bluemix.net/app/#/kibana4 ) and log into IBM Bluemix to view the Product Insights–Log Management dashboard.
- To reload the dashboard index pattern, in the Kibana-v4 dashboard, click Settings > Indices and select the existing index pattern. Click the reload icon to refresh the index pattern. (Screenshot below shows the same).
1. For the first time users, this step has to be done before loading/viewing the dashboard.
2. Do not click the reload icon until you have sent data to your Bluemix space using filebeat agent.
- To view dashboard, Select "Dashboard" tab next to highlighted "Settings" tab in above screen shot. On the Dashboard page, click on the "open folder" icon towards right end of the search bar and select - "IBM MQ AMQERR Dashboard". (Screenshot below shows the same).
- Here's an example of a AMQERR dashboard
- Default Time interval used with the Dashboard is 24hours. This can be configured to range of values starting from 15mins. (Screenshot below shows how to configure time interval).
- You can setup Auto Refresh interval for Dashboard.(Screenshot below shows how to configure refresh interval).
IBM MQ AMQERR Dashboard provides an "Overview" visualization that gives information about various visualizations and charts used on the dashboard. This helps you understand the metrics and aggregations on the aspects of data shown.
- It has an Area chart(positioned at top right of the dashboard) that shows the number of log entries per queue manager in 30 min intervals since last 24hours. This visualization helps to identify the queue managers that are frequently logging.
- It has a Bar chart(positioned at center of the dashboard) that shows number of entries per logged entry code (AMQnnn), split by queue manager. This visualization helps to identify top AMQ codes that are most logged by the queue managers.
- It has a data table that shows the list of hosts & its queue managers whose logs are shown and for your reference another data table with complete log records as-is included.
Using this information provided in the dashboard, you can quickly get the insights from your entire IBM MQ deployment and filter them to analyze the status and also identify root cause of any issue observed.
- In some cases, when the AMQERR log file is edited, it may create a temporary file with "~" extension(for example : AMQERR01.LOG~). If this file exists, it may disrupt the filebeat agent. Hence, stop the filebeat agent, delete the temporary file with "~" extension and rerun the filebeat agent.
- Certain Date Formats may not work with the filebeat agent.(For example :02/01/06 15:04:05) Hence, suggestion is to set your system locale to use US date format(as shown in the c2clogging.yml configuration file).
- If Visualizations on Log management dashboard are not loading, then
- Check if filebeat agent is sending logs
- Check if there are any log records for the time interval used(by default time interval is last 24hours).
- Check if dashboard indices are reloaded(Point#2 in Step#3 above). Default dashboard indices caching interval is 24hours.