| Author | Message | 
		
		  | Woo-Shoo, Jeong | 
			  
				|  Posted: Wed Feb 08, 2006 1:05 am    Post subject: How can I know Qmangager status? |   |  | 
		
		  | Newbie
 
 
 Joined: 18 Nov 2005Posts: 5
 
 
 | 
			  
				| Hello. 
 How can I know whether Qmanager lives or not periodically?
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | vennela | 
			  
				|  Posted: Wed Feb 08, 2006 1:07 am    Post subject: |   |  | 
		
		  |  Jedi Knight
 
 
 Joined: 11 Aug 2002Posts: 4055
 Location: Hyderabad, India
 
 | 
			  
				| dspmq 
 
   
	| Code: |  
	| C:\Documents and Settings\admin>dspmq QMNAME(QM1)                                               STATUS(Running)
 QMNAME(WBRK_QM)                                           STATUS(Running)
 
 C:\Documents and Settings\admin>
 |  |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | Woo-Shoo, Jeong | 
			  
				|  Posted: Wed Feb 08, 2006 1:40 am    Post subject: |   |  | 
		
		  | Newbie
 
 
 Joined: 18 Nov 2005Posts: 5
 
 
 | 
			  
				| Thank you for your reply. 
 dspmq() is DOS command, But I want to know a fuction or API.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | vennela | 
			  
				|  Posted: Wed Feb 08, 2006 1:55 am    Post subject: |   |  | 
		
		  |  Jedi Knight
 
 
 Joined: 11 Aug 2002Posts: 4055
 Location: Hyderabad, India
 
 | 
			  
				| 
   
	| Woo-Shoo, Jeong wrote: |  
	| Thank you for your reply. 
 dspmq() is DOS command, But I want to know a fuction or API.
 |  Not available
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | jefflowrey | 
			  
				|  Posted: Wed Feb 08, 2006 5:30 am    Post subject: |   |  | 
		
		  | Grand Poobah
 
 
 Joined: 16 Oct 2002Posts: 19981
 
 
 | 
			  
				| 
   
	| vennela wrote: |  
	| 
   
	| Woo-Shoo, Jeong wrote: |  
	| Thank you for your reply. 
 dspmq() is DOS command, But I want to know a fuction or API.
 |  Not available
 |  
 Other than through the same language standard way of invoking an external program, like the system function in C/Perl/etc.
 _________________
 I am *not* the model of the modern major general.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | mvic | 
			  
				|  Posted: Wed Feb 08, 2006 5:55 am    Post subject: |   |  | 
		
		  |  Jedi
 
 
 Joined: 09 Mar 2004Posts: 2080
 
 
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | wschutz | 
			  
				|  Posted: Wed Feb 08, 2006 6:47 am    Post subject: |   |  | 
		
		  |  Jedi Knight
 
 
 Joined: 02 Jun 2005Posts: 3316
 Location: IBM (retired)
 
 | 
			  
				| 
  or..write a simple program to try and MQCONN to the qmgr in question.... if it works, its "alive" 
	| Quote: |  
	| Hello. 
 How can I know whether Qmanager lives or not periodically?
 |   _________________
 -wayne
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | JT | 
			  
				|  Posted: Wed Feb 08, 2006 7:09 am    Post subject: |   |  | 
		
		  | Padawan
 
 
 Joined: 27 Mar 2003Posts: 1564
 Location: Hartford, CT.
 
 | 
			  
				| ........but conversely, if it doesn't work, it doesn't necessarily mean its "dead".  |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | wschutz | 
			  
				|  Posted: Wed Feb 08, 2006 7:19 am    Post subject: |   |  | 
		
		  |  Jedi Knight
 
 
 Joined: 02 Jun 2005Posts: 3316
 Location: IBM (retired)
 
 | 
			  
				| ...of course, it depends on what you get back.. but 2059 is usually a good sign that its "not alive"..... 
 since we don't know exactly why Jeong wants to know this info, all solutions are open for consideration ....
 _________________
 -wayne
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | kevinf2349 | 
			  
				|  Posted: Wed Feb 08, 2006 4:25 pm    Post subject: |   |  | 
		
		  |  Grand Master
 
 
 Joined: 28 Feb 2003Posts: 1311
 Location: USA
 
 | 
			  
				| On Windows you can get the status from the registry. You just read the registry like you would for any other value. 
 On z/OS you can inquire of the subsystem Interface.  I believe the code I put here (http://www.angelfire.com/ga/bowstore/MQ.html) shows the status on z/OS
 
 On the Unix platforms and As/400 I have no idea
   
 Hope this helps.
 
 Edit:
 
 Here is the registry code (in VB.Net)
 
 
 
   
	| Code: |  
	| qmgrlist = vbCrLf & vbCrLf & "QMGR         Status" & vbCrLf & "------------------------" & vbCrLf Dim dir As DirectoryInfo = New DirectoryInfo(DirName)
 QmgrRegistryPath = "Software\IBM\MQSeries\currentversion\status\queuemanager"
 For Each DirInfo In dir.GetDirectories
 Try
 Key = Registry.LocalMachine.OpenSubKey(QmgrRegistryPath & "\" & DirInfo.Name & "\queuemanagerstatus", True)
 If Key Is Nothing Then 'if the key doesn't exist
 Throw New Exception("The registry key doesn't exist")
 End If
 CurrentStatus = Key.GetValue("CurrentStatus")
 Catch eh As Exception
 MsgBox(" Error occurs in ReadRegistry for Version " & vbCrLf & vbCrLf & eh.Message)
 End Try
 qmgrlist = qmgrlist & DirInfo.Name.Replace("!", ".") & "    " & CurrentStatus & vbCrLf
 Next
 |  |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  |  |