Author |
Message
|
tczielke |
Posted: Mon Nov 09, 2015 11:39 am Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
I just tried a simple error test with dmpmqcfg where I PUT disabled the SYSTEM.ADMIN.COMMAND.QUEUE (in a sandbox environment where this would not matter) and then ran the program and checked the return code status. It reported a zero (successful) return code, eventhough no output was created. So it looks like the return code reporting for dmpmcfg is not very reliable, so I would definitely not trust the return code for any type of assurance that it ran successfully. _________________ Working with MQ since 2010. |
|
Back to top |
|
 |
bruce2359 |
Posted: Mon Nov 09, 2015 11:47 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9472 Location: US: west coast, almost. Otherwise, enroute.
|
Any hint of problem in output? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
tczielke |
Posted: Mon Nov 09, 2015 11:51 am Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
No, nothing was written to standard error or standard out and a zero return code was returned from the dmpmqcfg program. Not very good error reporting, for sure. _________________ Working with MQ since 2010. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Nov 09, 2015 2:18 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
I usually try runmqsc display qmstatus first. It that returns fine, go for dmpmqcfg...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
PeterPotkay |
Posted: Mon Nov 09, 2015 4:26 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
fjb_saper wrote: |
I usually try runmqsc display qmstatus first. It that returns fine, go for dmpmqcfg...  |
But you are still left wondering if dmpmqcfg actually worked 100%. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
PeterPotkay |
Posted: Mon Nov 09, 2015 4:32 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
I submitted an RFE:
Please vote by clicking on the below link.
http://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=79539
Enhance MQ's dmpmqcfg command to allow us to determine whether it's output is complete
Description:
Currently there is no way to tell if the output of dmpmqcfg is complete. The output (if piped to a file) ends unceremoniously. You are left wondering if the last entry you are looking at is in fact the last entry the queue manager intended to provide. You also have no idea if the entries that are complete up to that point.
Please add a footer to confirm the end of the dmpmqcfg output. The footer should also give an indication of the number of records contained in the output. According this thread on mqseries.net, the dmpmqcfg command apparently exits with a zero completion code even if it does not get valid any response from the queue manager. That should be corrected as well. http://www.mqseries.net/phpBB2/viewtopic.php?t=71374&start=15
Use case:
I am writing a script to call dmpmqcfg in MQ Client mode to connect to all my QMs and take backups. This will be scheduled and run on its own. I am struggling to determine in a scripted and automated fashion, did the command actual work. We need the ability to check the results of dmpmqcfg and have some assurance the thing ran to completion and the output is correct and complete. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Nov 09, 2015 8:51 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
So voted ! _________________ MQ & Broker admin |
|
Back to top |
|
 |
bruce2359 |
Posted: Wed Nov 11, 2015 11:23 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9472 Location: US: west coast, almost. Otherwise, enroute.
|
|
Back to top |
|
 |
mqjeff |
Posted: Wed Nov 11, 2015 12:39 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I agree that this is a good idea, and I'll go vote for the RFE.
But again, you know that the output file is complete when dmpmqcfg finishes executing. it won't write to the file any more, so the file is complete.
If the data in the file is not complete is an entirely separate question. The footer helps with that, in that it will tell you how many objects were produced.
But if you're not asking for system objects, and you haven't defined any non-system objects, then you will get zeros. This is the same result as if dmpmqcfg couldn't do the things it tried to do.
So you still have to know what you are expecting to get in order to tell if your output is complete. Much less if it's correct. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
PeterPotkay |
Posted: Wed Nov 11, 2015 1:51 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
mqjeff wrote: |
So you still have to know what you are expecting to get in order to tell if your output is complete. Much less if it's correct. |
If I had something to compare to that was the authoritative source of what I should expect to see in the dmpmqcfg output, and I could do that validation in an automated scripted manner, I might ask myself, Why am I even bothering with dmpmqcfg? I'll just use my authoritative source to reconstruct the queue manager.
I think a header / footer upgrade with better exit code error handling would give us the ability to confirm in an automated fashion we have a dmpmqcfg output file that is complete in that it represents what the QM intended to convey to you per the command issued to it.
Using DataPower secure-backups as an example, that produces a set of files. If any of those files is missing or incomplete, the whole backup is useless. But they also provide a human readable file that lists the files you should expect to have, along with a byte count for each file. Not infallible, but something to check against to give yourself some assurance the backup file(s) you have are whole. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
gbaddeley |
Posted: Wed Nov 11, 2015 4:26 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
Here is a simple UNIX MQ backup script that detects errors by grepping for AMQ messages. It's not terribly robust and I'm not sure if this covers all failure cases.
Code: |
dmpmqcfg -m $QMGR -x object -t all -o mqsc >$QMGR-object.txt 2>&1
dmpmqcfg -m $QMGR -x authrec -t all -o mqsc >$QMGR-authrec.txt 2>&1
dmpmqcfg -m $QMGR -x chlauth -t all -o mqsc >$QMGR-chlauth.txt 2>&1
dmpmqcfg -m $QMGR -x sub -t all -o mqsc >$QMGR-sub.txt 2>&1
grep ^AMQ *.txt |
_________________ Glenn |
|
Back to top |
|
 |
bruce2359 |
Posted: Wed Nov 11, 2015 6:56 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9472 Location: US: west coast, almost. Otherwise, enroute.
|
|
Back to top |
|
 |
rammer |
Posted: Thu Nov 12, 2015 1:51 am Post subject: |
|
|
Partisan
Joined: 02 May 2002 Posts: 359 Location: England
|
So what could be possible would be to do a dmpmqcfg, then pipe it in to a runmqsc -v command and if it says 560 commands were successfull for example and no failures or something like that, it would give some peace of mind that it has carried out a decent backup? |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Nov 12, 2015 4:50 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
rammer wrote: |
So what could be possible would be to do a dmpmqcfg, then pipe it in to a runmqsc -v command and if it says 560 commands were successfull for example and no failures or something like that, it would give some peace of mind that it has carried out a decent backup? |
Interesting idea. But notice the way the dmpmqcfg output ends today...it just ends with no indication that the last record shown is the last record intended.
If 560 commands were successful with that runmqsc -v verification, I would smile, than frown and wonder, Are there really only 560 objects that need to be recreated? Or are there 561 and for some reason the dmpmqcfg output was truncated.
If we had a footer that confirmed how many records were written that matched a header indicating that is how many were going to be written, we would know 560 is the number. And then running it thru runmqsc -v would confirm each record was viable.
I get it, you can never be 1000% sure the output is complete and acurate. Eventually you just have to trust the software. But currently the lack of exit codes and the lack of a header/footer summary makes it tough to determine in a scripted and automated fashion that the output is very likely complete. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
gbaddeley |
Posted: Thu Nov 12, 2015 3:22 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
[quote="PeterPotkay"]
rammer wrote: |
... Are there really only 560 objects that need to be recreated? Or are there 561 and for some reason the dmpmqcfg output was truncated. ... |
If you are concerned about all objects being dumped, you would need to keep a history of past successful dumps and do a delta every time it runs. _________________ Glenn |
|
Back to top |
|
 |
|