ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » How can I know Qmangager status?

Post new topic  Reply to topic
 How can I know Qmangager status? « View previous topic :: View next topic » 
Author Message
Woo-Shoo, Jeong
PostPosted: Wed Feb 08, 2006 1:05 am    Post subject: How can I know Qmangager status? Reply with quote

Newbie

Joined: 18 Nov 2005
Posts: 5

Hello.

How can I know whether Qmanager lives or not periodically?
Back to top
View user's profile Send private message MSN Messenger
vennela
PostPosted: Wed Feb 08, 2006 1:07 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 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
View user's profile Send private message Send e-mail Visit poster's website
Woo-Shoo, Jeong
PostPosted: Wed Feb 08, 2006 1:40 am    Post subject: Reply with quote

Newbie

Joined: 18 Nov 2005
Posts: 5

Thank you for your reply.

dspmq() is DOS command, But I want to know a fuction or API.
Back to top
View user's profile Send private message MSN Messenger
vennela
PostPosted: Wed Feb 08, 2006 1:55 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 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
View user's profile Send private message Send e-mail Visit poster's website
jefflowrey
PostPosted: Wed Feb 08, 2006 5:30 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 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
View user's profile Send private message
mvic
PostPosted: Wed Feb 08, 2006 5:55 am    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

Woo-Shoo, Jeong wrote:
dspmq() is DOS command, But I want to know a fuction or API.

If you need to start and read stdout/stderr from a console-only app, then have a look at this MSDN article: http://msdn.microsoft.com/library/en-us/dllproc/base/creating_a_child_process_with_redirected_input_and_output.asp
Back to top
View user's profile Send private message
wschutz
PostPosted: Wed Feb 08, 2006 6:47 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Quote:
Hello.

How can I know whether Qmanager lives or not periodically?
or..write a simple program to try and MQCONN to the qmgr in question.... if it works, its "alive"
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
JT
PostPosted: Wed Feb 08, 2006 7:09 am    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

........but conversely, if it doesn't work, it doesn't necessarily mean its "dead".
Back to top
View user's profile Send private message
wschutz
PostPosted: Wed Feb 08, 2006 7:19 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 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
View user's profile Send private message Send e-mail AIM Address
kevinf2349
PostPosted: Wed Feb 08, 2006 4:25 pm    Post subject: Reply with quote

Grand Master

Joined: 28 Feb 2003
Posts: 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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » How can I know Qmangager status?
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.