Your can learn a lot about your applications by collecting and reviewing your IBM MQ Accounting data. In this post I want to show you an example of how you can get a view of your data when you have masses of it and can’t easily look at each individual record. I’ll show examples using both MO71 and MQSCX to view this data collected by MQEV. You can read this post by opening up the section for the tool you prefer to use.
The first and perhaps most obvious step when you have masses of accounting records is to add up all the records for the same application name. One of the reasons why you might have masses of accounting data records is because short lived applications cut a record at MQDISC time, so even if your accounting interval (ACCTINT) is 30 minutes, you might get 120 records for one application in that time if it connects 4 times each minute.
So here’s how to create a total for each application name.
Total up by Application name (MQSCX)
DISPLAY ACCTMQI(*) SUM(APPL) -INTVLEND CHANNEL CONNAME USERID ALLPUT
The output will be a list with one row for each unique application name.
N.B. If you’re wondering what the -INTVLEND is doing, I’m just trimming the display to show only what I need. Read this post for more about that.
ACCTMQI(Employee) USERID(ppadams) CHANNEL(HR.SVRCONN) CONNAME(136.40.22.98) ALLPUT(3464) ACCTMQI(ExtOrder) USERID(*) CHANNEL(PROC.SVRCONN) CONNAME(*) ALLPUT(2927) ACCTMQI(Invoice) USERID(*) CHANNEL(PROC.SVRCONN) CONNAME(*) ALLPUT(8847) ACCTMQI(Payroll) USERID(*) CHANNEL(PAYROLL.TLS) CONNAME(136.40.22.98) ALLPUT(8342) ACCTMQI(Work Order) USERID(wrkadmin) CHANNEL(WORK.SVRCONN) CONNAME(134.23.19.20) ALLPUT(1218) ACCTMQI(Work Request) USERID(*) CHANNEL(WORK.SVRCONN) CONNAME(*) ALLPUT(3727)
Total up by Application name (MO71)
The output will be a list with one row for each unique application name. I’ve used Alter List to change the columns I want to see.
Now you may see in the output that some of the fields, for example, the Connection Name field, contain an asterisk (‘*’). This means that the records which were totalled together contain different values. That is, the same application name connected to the queue manager from different IP addresses, i.e. different client machines. This is probably not at all surprising if the same application is used by many different people. As a result, you may well want to see a row per application name and the IP address it connected from. So let’s try that now.
Total up by Application name and IP address (MQSCX)
Issue a command like the following. This has one change from the command we previously issued, in that we have added the CONNAME field to list provided in the SUM attribute.
DISPLAY ACCTMQI(*) SUM(APPL,CONNAME) -INTVLEND CHANNEL CONNAME USERID ALLPUT
The output will be a list with one row for each unique combination of application name and connection name.
ACCTMQI(Employee) USERID(ppadams) CHANNEL(HR.SVRCONN) CONNAME(136.40.22.98) ALLPUT(3464) ACCTMQI(ExtOrder) USERID(djones) CHANNEL(PROC.SVRCONN) CONNAME(137.46.28.126) ALLPUT(1473) ACCTMQI(ExtOrder) USERID(mjsmith) CHANNEL(PROC.SVRCONN) CONNAME(137.46.28.128) ALLPUT(1454) ACCTMQI(Invoice) USERID(pwharper) CHANNEL(PROC.SVRCONN) CONNAME(137.46.28.67) ALLPUT(2997) ACCTMQI(Invoice) USERID(djones) CHANNEL(PROC.SVRCONN) CONNAME(137.46.28.126) ALLPUT(2949) ACCTMQI(Invoice) USERID(mjsmith) CHANNEL(PROC.SVRCONN) CONNAME(137.46.28.128) ALLPUT(2901) ACCTMQI(Payroll) USERID(*) CHANNEL(PAYROLL.TLS) CONNAME(136.40.22.98) ALLPUT(8342) ACCTMQI(Work Order) USERID(wrkadmin) CHANNEL(WORK.SVRCONN) CONNAME(134.23.19.20) ALLPUT(1218) ACCTMQI(Work Request) USERID(nsmith) CHANNEL(WORK.SVRCONN) CONNAME(134.23.19.116) ALLPUT(434) ACCTMQI(Work Request) USERID(khull) CHANNEL(WORK.SVRCONN) CONNAME(134.23.19.114) ALLPUT(788) ACCTMQI(Work Request) USERID(sjones) CHANNEL(WORK.SVRCONN) CONNAME(134.23.19.112) ALLPUT(626) ACCTMQI(Work Request) USERID(apbolt) CHANNEL(WORK.SVRCONN) CONNAME(134.23.19.110) ALLPUT(1879)
Total up by Application name and IP address (MO71)
We’ve got fewer asterisk (‘*’) characters in the output now, but still one row showing that the records totalled together contained different values for the User Identifier field. This shows that while the same application was being run from the same machine, it was run under different user IDs. To dig into that further we can change our totalling pattern a little further and include the user ID field. To reduce the output for the purposes of showing it here I’ll also just focus in on that one application in the next command.
Total up by Application name, IP address and User ID (MQSCX)
Issue a command like the following. This has two changes from the command we previously issued, in that we have added the USERID field to list provided in the SUM attribute, and we have restricted the application names returned to only those called 'Payroll'.
DISPLAY ACCTMQI('Payroll') SUM(APPL,CONNAME,USERID) -INTVLEND CHANNEL CONNAME USERID ALLPUT
The output will be a list with one row for each unique combination of application name, connection name and user ID.
ACCTMQI(Payroll) USERID(ppadams) CHANNEL(PAYROLL.TLS) CONNAME(136.40.22.98) ALLPUT(581) ACCTMQI(Payroll) USERID(payrlate) CHANNEL(PAYROLL.TLS) CONNAME(136.40.22.98) ALLPUT(1681) ACCTMQI(Payroll) USERID(payradmn) CHANNEL(PAYROLL.TLS) CONNAME(136.40.22.98) ALLPUT(5911)
Total up by Application name, IP address and User ID (MO71)
The output will be a list with one row for each unique application name, IP address and User ID combination for the Payroll application.
As you can see, totalling up your MQ Accounting data can give you an easy way to see exactly what applications you have running against your queue manager, and where/how they are running, without the need to trawl through masses of individual records.
This concept can be very useful to answer all sorts of other questions. Consider the following options:
SUM() value | Meaning |
APPL | Return a record for each Application Useful if you want to know what’s doing the most messaging etc |
CHANNEL | Return a unique record for each Channel Useful for determining which channels are used the most and perhaps which are no-longer used. |
USERID | Return a record for each unique Userid Useful for seeing who is doing what to your Queue Manager |
RPRODUCT | Sum by remote product identifier Useful to know what remote clients are connected to your Queue Manager. Are people using JMS, C, .Net Java etc |
APPL,RPRODUCT | Similar to the one above but now you get a record for each Application/Product combination. This is useful for seeing which applications are using which clients. |
RVERSION | Sum by remote version number Useful to know what version of MQ Client people are using. For example, are people still using an old out of date product |
APPL,RPRODUCT,RVERSION | Similar to the one above but now you get a record for each Application/Product Version combination. This is useful for seeing which applications are which version of client. |
CONNAME | Sum by remote IP address Useful to know how many machine are connecting to you and where from. |
Of course there are many more combinations and each combination has the potential to show you something interesting.