|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
possible to export MQExplorer content page into Excel? |
« View previous topic :: View next topic » |
Author |
Message
|
pcelari |
Posted: Mon Mar 08, 2021 12:18 pm Post subject: possible to export MQExplorer content page into Excel? |
|
|
Chevalier
Joined: 31 Mar 2006 Posts: 411 Location: New York
|
Is there a way to export MQExplorer's content page into a spreadsheet?
Say, I want to document all sender channels attributes for reporting and documentation purpose, and I don't want all the fields. Is there a way to do that?
I wish runmqsc command can output result in comma delimited fields instead of one line with only one or two fields.
thanks much for any input. _________________ pcelari
-----------------------------------------
- a master of always being a newbie |
|
Back to top |
|
 |
hughson |
Posted: Mon Mar 08, 2021 11:44 pm Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 Location: Bay of Plenty, New Zealand
|
I don't know of a way to get MQ Explorer to do this I'm afraid.
<vendor_plug>
The MO71 GUI Administration tool by MQGem Software can export lists of objects as CSV. You can configure which fields are part of that display too.
If you'd like to learn more, see https://www.mqgem.com/mo71.html and/or contact us directly for more information.
</vendor_plug>
Cheers,
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
 |
markt |
Posted: Mon Mar 08, 2021 11:58 pm Post subject: |
|
|
 Knight
Joined: 14 May 2002 Posts: 508
|
The MS0P supportpac can be used to export Explorer tables as CSV.
But the recommended way to get parsable output is to use MQ's REST admin API. See for example https://marketaylor.synology.me/?p=825 with an example of dumping a qmgr's configuration. |
|
Back to top |
|
 |
RogerLacroix |
Posted: Tue Mar 09, 2021 4:06 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Michael Dag has a program called MQDocument that documents MQ objects.
Now if you want a cheap and dirty solution, I have 1 from the early 2000s. I wrote a simple REXX script to flatten the output of MS03 for a customer, so that the output could be checked into a source repository.
SupportPac MS03 is no longer around but you can use the replacement called dmpmqcfg
Example of running dmpmqcfg against your queue manager called MQA1:
Code: |
dmpmqcfg -m MQA1 -a > MQA1.all.mqsc |
Then you run it against my REXX script called fmt_dmpmqcfg.rex:
Code: |
rexx fmt_dmpmqcfg.rex MQA1.all.mqsc |
The REXX script will generate 1 file per MQ object type and each object will be on 1 line.
Here is the REXX script:
Code: |
/* Format output from dspmqcfg command to a single line for each entry. */
/* Put each command type into a different file. */
trace o
Parse Arg inFN .
if inFN = "" then
do
Say "Invalid number of parameters."
Say "i.e."
Say " fmt_dmpmqcfg.rex input_file_name"
Exit
end
types = "QMGR CHANNEL LISTENER NAMELIST PROCESS QALIAS QLOCAL QMODEL QREMOTE SERVICE SUB TOPIC AUTHREC AUTHINFO CHLAUTH COMMINFO"
/* open file */
Call Stream inFN,'C','OPEN READ'
/* Delete previous output and then open it. */
do i=1 to Words(types)
ptr = Word(types,i)
outFN = inFN||"."||ptr||".mqsc"
if (STREAM( outFN, 'C', 'QUERY EXIST' ) <> "") then
"ERASE "outFN
Call Stream outFN,'C','OPEN WRITE'
counts.ptr = 0
end
total = 0
mqscCmd = ""
do until Lines(inFN) = 0
inLine = Strip(LineIn(inFN)) /* read next line */
if (inLine = "") then
NOP /* blank line, forget-about-it */
else if (SubStr(inLine,1,1) = "*") then
NOP /* comment line, forget-about-it */
else
do
/* Last attribute in MQSC command? */
if (Length(inLine) <> LastPos('+',inLine)) then
do
mqscCmd = mqscCmd || " " || inLine /* add last attribute */
ptr = Word(mqscCmd, 2)
if (Pos("(", ptr) > 0) then
ptr = SubStr(ptr, 1, Pos("(", ptr) - 1)
nothing = LineOut(inFN||"."||ptr||".mqsc", mqscCmd) /* write to the file */
counts.ptr = counts.ptr + 1
total = total + 1
mqscCmd = ""
end
else
do
temp = Strip(SubStr(inLine,1,(LastPos('+',inLine) - 1))) /* remove '+' */
if (mqscCmd = "") then
mqscCmd = temp
else
mqscCmd = mqscCmd || " " || temp
end
end
end
/* close the files */
Call Stream inFN,'C','CLOSE'
do i=1 to Words(types)
ptr = Word(types,i)
outFN = inFN||"."||ptr||".mqsc"
Call Stream outFN,'C','CLOSE'
Say outFN || " contains " || counts.ptr || " MQSC formatted commands."
end
Say ""
Say "Total formatted MQSC commands was:" total
Exit |
If you don't have REXX interpreter installed on your PC/laptop then you can download and install ooRexx (Open Object Rexx).
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
pcelari |
Posted: Wed Mar 10, 2021 10:20 am Post subject: |
|
|
Chevalier
Joined: 31 Mar 2006 Posts: 411 Location: New York
|
thanks so much Roger for sharing your wonderful self-build tool! That's a great treasure! _________________ pcelari
-----------------------------------------
- a master of always being a newbie |
|
Back to top |
|
 |
gbaddeley |
Posted: Wed Mar 10, 2021 2:50 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
Example of running dmpmqcfg on UNIX platforms to generate separate files containing one line per object:
Code: |
#!/usr/bin/ksh
QMGR="$1"
dmpmqcfg -m $QMGR -x object -t all -o 1line >$QMGR-object.txt 2>&1
dmpmqcfg -m $QMGR -x authrec -t all -o 1line >$QMGR-authrec.txt 2>&1
dmpmqcfg -m $QMGR -x chlauth -t all -o 1line >$QMGR-chlauth.txt 2>&1
dmpmqcfg -m $QMGR -x sub -t all -o 1line >$QMGR-sub.txt 2>&1
grep ^AMQ *.txt |
grep shows any error messages.
The -t argument can be used for more granular dumping on types of object.
-c can be used to connect via MQ Client to a remote queue manager.
Substituting ") " with ")," will produce a basic CSV file:
Code: |
sed 's/) /),/g' <MQ1-object.txt >MQ1-object.csv |
_________________ Glenn |
|
Back to top |
|
 |
RogerLacroix |
Posted: Wed Mar 10, 2021 3:20 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hi pcelari,
I missed the part about wanting it in a CSV format. So, I updated the Rexx script and added a comma after each attribute. Here you go:
Code: |
/* Format output from dspmqcfg command to a single line for each entry. */
/* Put each command type into a different file. */
/* It will make the data in a csv format. */
trace o
Parse Arg inFN .
if inFN = "" then
do
Say "Invalid number of parameters."
Say "i.e."
Say " fmt_dmpmqcfg_csv.rex input_file_name"
Exit
end
types = "QMGR CHANNEL LISTENER NAMELIST PROCESS QALIAS QLOCAL QMODEL QREMOTE SERVICE SUB TOPIC AUTHREC AUTHINFO CHLAUTH COMMINFO"
/* open file */
Call Stream inFN,'C','OPEN READ'
/* Delete previous output and then open it. */
do i=1 to Words(types)
ptr = Word(types,i)
outFN = inFN||"."||ptr||".mqsc"
if (STREAM( outFN, 'C', 'QUERY EXIST' ) <> "") then
"ERASE "outFN
Call Stream outFN,'C','OPEN WRITE'
counts.ptr = 0
end
total = 0
mqscCmd = ""
do until Lines(inFN) = 0
inLine = Strip(LineIn(inFN)) /* read next line */
if (inLine = "") then
NOP /* blank line, forget-about-it */
else if (SubStr(inLine,1,1) = "*") then
NOP /* comment line, forget-about-it */
else
do
/* Last attribute in MQSC command? */
if (Length(inLine) <> LastPos('+',inLine)) then
do
mqscCmd = mqscCmd || ", " || inLine /* add last attribute */
ptr = Word(mqscCmd, 2)
if (Pos("(", ptr) > 0) then
ptr = SubStr(ptr, 1, Pos("(", ptr) - 1)
else if (Pos(",", ptr) > 0) then
ptr = SubStr(ptr, 1, Pos(",", ptr) - 1)
nothing = LineOut(inFN||"."||ptr||".mqsc", mqscCmd) /* write to the file */
counts.ptr = counts.ptr + 1
total = total + 1
mqscCmd = ""
end
else
do
temp = Strip(SubStr(inLine,1,(LastPos('+',inLine) - 1))) /* remove '+' */
if (mqscCmd = "") then
mqscCmd = temp
else
mqscCmd = mqscCmd || ", " || temp
end
end
end
/* close the files */
Call Stream inFN,'C','CLOSE'
do i=1 to Words(types)
ptr = Word(types,i)
outFN = inFN||"."||ptr||".mqsc"
Call Stream outFN,'C','CLOSE'
Say outFN || " contains " || counts.ptr || " MQSC formatted commands."
end
Say ""
Say "Total formatted MQSC commands was:" total
Exit |
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
zpat |
Posted: Fri Mar 12, 2021 12:22 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
I always find it "amusing" when IBM suggest using a rest API for administration.
Admin staff generally do not have the time or the skills to code in programming languages for everyday purposes.
MS0P is very useful and I hope it is maintained into the future.
I should also mention that MO71 can export into CSV files and is more flexible than MQ explorer in terms of combining multi-QM lists etc. _________________ Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error. |
|
Back to top |
|
 |
gbaddeley |
Posted: Sat Mar 13, 2021 4:02 am Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
markt wrote: |
The MS0P supportpac can be used to export Explorer tables as CSV.
But the recommended way to get parsable output is to use MQ's REST admin API. See for example https://marketaylor.synology.me/?p=825 with an example of dumping a qmgr's configuration. |
Blocked by corporate zscaler "Websites such as these often contain malicious software and inappropriate content." "Not allowed to browse : File host category" _________________ Glenn |
|
Back to top |
|
 |
PaulClarke |
Posted: Sat Mar 13, 2021 11:13 pm Post subject: |
|
|
 Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
zpat wrote: |
I should also mention that MO71 can export into CSV files and is more flexible than MQ explorer in terms of combining multi-QM lists etc. |
...and in case anyone missed the update we recently added, by customer request, the ability to export even blank columns so that exports from different times, versions and Queue Managers can be compared since they will all have the same columns regardless of data.
Regards,
Paul. _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|