{"id":341,"date":"2021-11-28T12:36:02","date_gmt":"2021-11-28T12:36:02","guid":{"rendered":"https:\/\/trindade.myphotos.cc\/lazysysadmin\/?p=341"},"modified":"2024-07-05T11:40:38","modified_gmt":"2024-07-05T10:40:38","slug":"basic-mq-commands","status":"publish","type":"post","link":"https:\/\/trindade.myphotos.cc\/lazysysadmin\/2021\/11\/28\/basic-mq-commands\/","title":{"rendered":"Basic <span class=\"caps\">MQ<\/span> commands"},"content":{"rendered":"<p>This should prob\u00ada\u00adbly be my first blog post about <span class=\"caps\">MQ<\/span>, but I con\u00adfess: I was too excit\u00aded to start writing.<\/p>\n<p>Late\u00adly I\u2019ve had lit\u00adtle time to post new stuff. This is prob\u00ada\u00adbly just an excuse to write some\u00adthing&nbsp;again.<\/p>\n<p>In the fol\u00adlow\u00ading lines, I\u2019ll give you an intro\u00adduc\u00adtion to the most used <span class=\"caps\">MQ<\/span> commands.<\/p>\n<p><!--more--><\/p>\n<p>There are dif\u00adfer\u00adent types of <span class=\"caps\">MQ<\/span> commands:<\/p>\n<ul>\n<li>Infor\u00adma\u00adtion\u00adal com\u00admands \u2014 These are com\u00admands to get infor\u00adma\u00adtion about the <span class=\"caps\">IBM<\/span> <span class=\"caps\">MQ<\/span> instal\u00adla\u00adtion and queue managers<\/li>\n<li>Con\u00adtrol com\u00admands \u2014 Com\u00admands to stop, start and con\u00adfig\u00adure&nbsp;<span class=\"caps\">MQ<\/span><\/li>\n<li>Sam\u00adple com\u00admands \u2014 Com\u00admands that are sup\u00adplied with source code as pro\u00adgram\u00adming sam\u00adples but are some\u00adwhat use\u00adful for the non-programmer<\/li>\n<\/ul>\n<h1>Information commands<\/h1>\n<p>Infor\u00adma\u00adtion\u00adal com\u00admands are com\u00admands that are used to dis\u00adplay sev\u00ader\u00adal types of infor\u00adma\u00adtion about the work\u00adings of <span class=\"caps\">MQ<\/span>. The fol\u00adlow\u00ading list is not exhaus\u00adtive; only the most com\u00admon com\u00admands are&nbsp;shown.<\/p>\n<ul>\n<li><strong>dsp\u00admq<\/strong><br>\nDis\u00adplay sta\u00adtus infor\u00adma\u00adtion about queue managers<\/li>\n<li><strong>dsp\u00admqaut<\/strong><br>\nDis\u00adplays the autho\u00adriza\u00adtions (per\u00admis\u00adsions) of a spe\u00adcif\u00adic <span class=\"keyword\"><span class=\"caps\">IBM<\/span> <span class=\"caps\">MQ<\/span><\/span> object.<\/li>\n<li><strong>dsp\u00admqinf<\/strong><br>\nDis\u00adplay <span class=\"caps\">IBM<\/span> <span class=\"caps\">MQ<\/span> con\u00adfig\u00adu\u00adra\u00adtion infor\u00adma\u00adtion (<span class=\"caps\">AIX<\/span>, Lin\u00adux, and Win\u00addows&nbsp;only).<\/li>\n<li><strong>dsp\u00admqinst<\/strong><br>\nDis\u00adplay instal\u00adla\u00adtion entries from mqinst.ini on <span class=\"caps\">AIX<\/span>, Lin\u00adux, and Win\u00addows, and dis\u00adplay license enti\u00adtle\u00adment information.<\/li>\n<li><strong>dsp\u00admqver<\/strong><br>\nDis\u00adplay <span class=\"caps\">IBM<\/span> <span class=\"caps\">MQ<\/span> ver\u00adsion and build information.<\/li>\n<\/ul>\n<h2>dspmq<\/h2>\n<p>Anal\u00ado\u00adgous to the <strong>ls<\/strong> <span class=\"caps\">UNIX<\/span> and Lin\u00adux com\u00admand, <strong>dsp\u00admq<\/strong> is the prob\u00ada\u00adbly the most used <span class=\"caps\">MQ<\/span> com\u00admand. It dis\u00adplay the sta\u00adtus of all queue man\u00adagers con\u00adfig\u00adured on one machine of the instances of a mul\u00adti-instance queue man\u00adag\u00ader (if you use the <strong>-x<\/strong> com\u00admand line option).<\/p>\n<p>Here\u2019s an example:<\/p>\n<p class=\"code-example\">mqm@ubuntuvm1:~$ dsp\u00admq<br>\n<span class=\"caps\">QMNAME<\/span>(<span class=\"caps\">MQ01<\/span>) <span class=\"caps\">STATUS<\/span>(Running)<br>\n<span class=\"caps\">QMNAME<\/span>(mqcl1n01) <span class=\"caps\">STATUS<\/span>(Running)<\/p>\n<p>As you can see, I have two queue man\u00adagers running.<\/p>\n<h2>dspmqaut<\/h2>\n<p>The dsp\u00admqaut com\u00admand will be cov\u00adered in a future arti\u00adcle about object autho\u00adriza\u00adtions. Basi\u00adcal\u00adly it is a com\u00admand that can be replaced with <span class=\"caps\">MQSC<\/span> com\u00admands and only exists for back\u00adwards com\u00adpat\u00adi\u00adbil\u00adi\u00adty with old\u00ader (7.x and old\u00ader) <span class=\"caps\">MQ<\/span> versions.<\/p>\n<h2>dspmqinf<\/h2>\n<p>The dsp\u00admqinf com\u00admand is used to dis\u00adplay infor\u00adma\u00adtion about a queue man\u00adag\u00ader. It\u2019s used in con\u00adjunc\u00adtion with the addmqinf com\u00admand, which is a nec\u00ades\u00adsary step for mul\u00adti-instance and failover high-avail\u00adabil\u00adi\u00adty configurations.<\/p>\n<h2>dspmqinst<\/h2>\n<p>This com\u00admand shows infor\u00adma\u00adtion about the <span class=\"caps\">MQ<\/span> instal\u00adla\u00adtions present in a machine.<\/p>\n<p class=\"code-example\">mqm@ubuntuvm1:~$ dsp\u00admqinst<br>\nInst\u00adName: Installation1<br>\nInstDesc:<br>\nIden\u00adti\u00adfi\u00ader:&nbsp;1<br>\nInst\u00adPath: \/opt\/mqm<br>\nVer\u00adsion: 9.2.0.0<br>\nPri\u00adma\u00adry:&nbsp;Yes<br>\nState: Available<br>\nLicense\u00adType: Production<br>\nEnti\u00adtle\u00adment: <span class=\"caps\">IBM<\/span> <span class=\"caps\">MQ<\/span> Advanced<br>\nFixes:<\/p>\n<p>As you can see for the above, there is only one <span class=\"caps\">MQ<\/span> instal\u00adla\u00adtion of <span class=\"caps\">MQ<\/span> ver\u00adsion 9.2.0.0 in the \/opt\/mqm directory.<\/p>\n<h2>dspmqver<\/h2>\n<p>Final\u00adly, the dsp\u00admqver dis\u00adplays infor\u00adma\u00adtion about the <span class=\"caps\">MQ<\/span> version(s) installed in the system.<\/p>\n<p class=\"code-example\">mqm@ubuntuvm1:~$ dsp\u00admqver<br>\nName: <span class=\"caps\">IBM<\/span>&nbsp;<span class=\"caps\">MQ<\/span><br>\nVer\u00adsion: 9.2.0.0<br>\nLev\u00adel: p920-L200709<br>\nBuild\u00adType: <span class=\"caps\">IKAP<\/span> \u2014 (Pro\u00adduc\u00adtion)<br>\nPlat\u00adform: <span class=\"caps\">IBM<\/span> <span class=\"caps\">MQ<\/span> for Lin\u00adux (x86-64 platform)<br>\nMode: 64-bit<br>\nO\/S: Lin\u00adux 5.4.0\u201372-generic<br>\nO\/S Details: Ubun\u00adtu 20.04.2 <span class=\"caps\">LTS<\/span> (Focal Fossa)<br>\nInst\u00adName: Installation1<br>\nInstDesc:<br>\nPri\u00adma\u00adry:&nbsp;Yes<br>\nInst\u00adPath: \/opt\/mqm<br>\nData\u00adPath: \/var\/mqm<br>\nMax\u00adCmdLev\u00adel:&nbsp;920<br>\nLicense\u00adType: Production<\/p>\n<p>Although some of this infor\u00adma\u00adtion is also dis\u00adplayed in the out\u00adput of the dsp\u00admqinst com\u00admand, this one is slight\u00adly different.<\/p>\n<h1>Control commands<\/h1>\n<p>Con\u00adtrol com\u00admands are the ones you can use to stop, start, and con\u00adfig\u00adure&nbsp;<span class=\"caps\">MQ<\/span>.<\/p>\n<p>The most used ones&nbsp;are:<\/p>\n<ul>\n<li><strong>str\u00admqm<\/strong><br>\nStart a queue manager<\/li>\n<li><strong>end\u00admqm<\/strong><br>\nStop a queue manager<\/li>\n<li><strong>str\u00admqweb<\/strong><br>\nStart the <span class=\"caps\">MQ<\/span> web con\u00adsole and the <span class=\"caps\">REST<\/span> Admin interface<\/li>\n<li><strong>end\u00admqweb<\/strong><br>\nStop the <span class=\"caps\">MQ<\/span> web con\u00adsole and the <span class=\"caps\">REST<\/span> Admin interface<\/li>\n<li><strong>addmqinf<\/strong><br>\nAdd <span class=\"caps\">MQ<\/span> con\u00adfig\u00adu\u00adra\u00adtion information<\/li>\n<li><strong>amqf\u00adsck<\/strong><br>\nCheck file sys\u00adtems for <span class=\"caps\">MQ<\/span> support<\/li>\n<li><strong>crt\u00admqm<\/strong><br>\nCre\u00adate a queue manager<\/li>\n<li><strong>dlt\u00admqm<\/strong><br>\nDelete a queue manager<\/li>\n<\/ul>\n<h2>strmqm<\/h2>\n<p>This com\u00admand is used to start a queue manager.<\/p>\n<p class=\"code-example\">str\u00admqm&nbsp;<span class=\"caps\">MQ1<\/span><\/p>\n<p>The above com\u00admand starts the <span class=\"caps\">MQ1<\/span> queue manager.<\/p>\n<h2>endmqm<\/h2>\n<p>This com\u00admand is used to stop a queue man\u00adag\u00ader. Like the str\u00admqm com\u00admand its syn\u00adtax is very simple:<\/p>\n<p class=\"code-example\">end\u00admqm&nbsp;<span class=\"caps\">MQ1<\/span><\/p>\n<p>The end\u00admqm com\u00admand has oth\u00ader options, but those should be used only if absolute\u00adly necessary.<\/p>\n<h2>strmqweb<\/h2>\n<p>The str\u00admqweb com\u00admand is used to start the <span class=\"caps\">IBM<\/span> <span class=\"caps\">MQ<\/span> Web Con\u00adsole and the <span class=\"caps\">REST<\/span> Admin\u00adis\u00adtra\u00adtion ser\u00advice. It has no com\u00admand line options.<\/p>\n<h2>dspmqweb<\/h2>\n<p>This com\u00admand is used to dis\u00adplay the sta\u00adtus of the <span class=\"caps\">IBM<\/span> <span class=\"caps\">MQ<\/span> Web Console.<\/p>\n<h2>endmqweb<\/h2>\n<p>This, as its name sug\u00adgests, is used to stop the <span class=\"caps\">IBM<\/span> <span class=\"caps\">MQ<\/span> Web Con\u00adsole and <span class=\"caps\">REST<\/span> Admin\u00adis\u00adtra\u00adtion service.<\/p>\n<h2>addmqinf<\/h2>\n<p>This com\u00admand is used when installing high\u00adly avail\u00adable or mul\u00adti-instance queue managers.<\/p>\n<p>It\u2019s used in tan\u00addem with the dsp\u00admqinf command.<\/p>\n<h2>amqfsck<\/h2>\n<p>This com\u00admand is use\u00adful when you want to test the file sys\u00adtem\u2019s com\u00adpat\u00adi\u00adbil\u00adi\u00adty with the <span class=\"caps\">MQ<\/span> mul\u00adti-instance feature.<\/p>\n<h2>ctrmqm<\/h2>\n<p>This is one of the most impor\u00adtant <span class=\"caps\">MQ<\/span> com\u00admands. It\u2019s used to cre\u00adate a queue man\u00adag\u00ader. This com\u00admand takes at least the name of the queue man\u00adag\u00ader to be created.<\/p>\n<h2>dltmqm<\/h2>\n<p>This com\u00admand is used to remove a queue man\u00adag\u00ader from the system.<\/p>\n<p><span class=\"caps\">WARNING<\/span>: it\u2019s effects are irre\u00adversible. After you delete one queue man\u00adag\u00ader, in order to use it again, you have to recre\u00adate&nbsp;it.<\/p>\n<h1>Sample commands<\/h1>\n<p>There are some sam\u00adple com\u00admands that are use\u00adful, spe\u00adcial\u00adly for trou\u00adbleshoot\u00ading and testing.<\/p>\n<ul>\n<li><strong>amqsput<\/strong><br>\nPut mes\u00adsages into queues<\/li>\n<li><strong>amqs\u00adget<\/strong><br>\nGet mes\u00adsages from queues<\/li>\n<li><strong>amqs\u00adrua<\/strong><br>\nDis\u00adplay met\u00adrics and mon\u00adi\u00adtor\u00ading info gen\u00ader\u00adat\u00aded by&nbsp;<span class=\"caps\">MQ<\/span><\/li>\n<li><strong>amqs\u00admon<\/strong><br>\nGet sta\u00adtis\u00adtics or account\u00ading infor\u00adma\u00adtion gen\u00ader\u00adat\u00aded by&nbsp;<span class=\"caps\">MQ<\/span><\/li>\n<\/ul>\n<h2>amqsput<\/h2>\n<p>This com\u00admand allows you to write mes\u00adsages to a queue. It\u2019s invoked as follows:<\/p>\n<p class=\"code-example\">\/usr\/mqm\/samp\/bin\/amqsput &lt;queue&gt; [&lt;queue manager&gt;]<\/p>\n<p>on <span class=\"caps\">AIX<\/span>.<\/p>\n<p>On Lin\u00adux, use the following:<\/p>\n<p class=\"code-example\">\/opt\/mqm\/samp\/bin\/amqsput &lt;queue&gt; [&lt;queue manager&gt;]<\/p>\n<p>The <span style=\"font-family: andalemono,monospace;\">&lt;queue man\u00adag\u00ader&gt;<\/span> para\u00adme\u00adter is optional.<\/p>\n<p>The mes\u00adsages to be sent are read from stan\u00addard in, one mes\u00adsage per&nbsp;line.<\/p>\n<p>This util\u00adi\u00adty is sup\u00adplied with source code in C, in the file \/usr\/mqm\/samp\/amqsput0.c (in the default <span class=\"caps\">AIX<\/span> instal\u00adla\u00adtion loca\u00adtion) or \/opt\/mqm\/samp\/amqsput0.c (in the default Lin\u00adux instal\u00adla\u00adtion location).<\/p>\n<h2>amqsget<\/h2>\n<p>This sam\u00adple util\u00adi\u00adty is the coun\u00adter\u00adpart of <span style=\"font-family: andalemono,monospace;\">amqsput<\/span>.<\/p>\n<p>It\u2019s used to read mes\u00adsages from a&nbsp;queue.<\/p>\n<p>Its invo\u00adca\u00adtion is just as <span style=\"font-family: andalemono,monospace;\">amqsput<\/span>:<\/p>\n<p class=\"code-example\">\/opt\/mqm\/samp\/bin\/amqsget &lt;queue&gt; [&lt;queue manager&gt;]<\/p>\n<p>The <span style=\"font-family: andalemono,monospace;\">&lt;queue man\u00adag\u00ader&gt;<\/span> para\u00adme\u00adter is optional.<\/p>\n<p>This util\u00adi\u00adty is sup\u00adplied with source code in C, in the file \/usr\/mqm\/samp\/amqsget0.c (in the default <span class=\"caps\">AIX<\/span> instal\u00adla\u00adtion loca\u00adtion) or \/opt\/mqm\/samp\/amqsget0.c (in the default Lin\u00adux instal\u00adla\u00adtion location).<\/p>\n<h2>amqsrua<\/h2>\n<p>This is util\u00adi\u00adty allows you to col\u00adlect per\u00adfor\u00admance infor\u00adma\u00adtion from MQ\u2019s sys\u00adtem per\u00adfor\u00admance topics.<\/p>\n<p>It will be described in a future post about <span class=\"caps\">MQ<\/span> performance.<\/p>\n<h2>aqmsmon<\/h2>\n<p>This is tool that allows you to get MQ\u2019s sta\u00adtis\u00adtics and account\u00ading&nbsp;data.<\/p>\n<p>It will be detailed in a future post about <span class=\"caps\">MQ<\/span> sta\u00adtis\u00adtics and accounting.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This should prob\u00ada\u00adbly be my first blog post about <span class=\"caps\">MQ<\/span>, but I con\u00adfess: I was too excit\u00aded to start writ\u00ading. Late\u00adly I\u2019ve had lit\u00adtle time to post new stuff. This is prob\u00ada\u00adbly just an excuse to write some\u00adthing&nbsp;again. In the \u2026 <a href=\"https:\/\/trindade.myphotos.cc\/lazysysadmin\/2021\/11\/28\/basic-mq-commands\/\">Con\u00adtin\u00adue read\u00ading <span class=\"meta-nav\">\u2192<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"wp_typography_post_enhancements_disabled":false,"footnotes":""},"categories":[20,2,3],"tags":[12,4,8],"class_list":["post-341","post","type-post","status-publish","format-standard","hentry","category-basics","category-middleware","category-mq","tag-ibmmq","tag-mq","tag-mqseries"],"featured_image_src":null,"featured_image_src_square":null,"author_info":{"display_name":"Ant\u00f3nio Trindade","author_link":"https:\/\/trindade.myphotos.cc\/lazysysadmin\/author\/trindade\/"},"_links":{"self":[{"href":"https:\/\/trindade.myphotos.cc\/lazysysadmin\/wp-json\/wp\/v2\/posts\/341","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trindade.myphotos.cc\/lazysysadmin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trindade.myphotos.cc\/lazysysadmin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trindade.myphotos.cc\/lazysysadmin\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/trindade.myphotos.cc\/lazysysadmin\/wp-json\/wp\/v2\/comments?post=341"}],"version-history":[{"count":14,"href":"https:\/\/trindade.myphotos.cc\/lazysysadmin\/wp-json\/wp\/v2\/posts\/341\/revisions"}],"predecessor-version":[{"id":362,"href":"https:\/\/trindade.myphotos.cc\/lazysysadmin\/wp-json\/wp\/v2\/posts\/341\/revisions\/362"}],"wp:attachment":[{"href":"https:\/\/trindade.myphotos.cc\/lazysysadmin\/wp-json\/wp\/v2\/media?parent=341"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trindade.myphotos.cc\/lazysysadmin\/wp-json\/wp\/v2\/categories?post=341"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trindade.myphotos.cc\/lazysysadmin\/wp-json\/wp\/v2\/tags?post=341"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}