You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Stein Wang <fw...@aim.com> on 2016/01/20 15:25:04 UTC

QPID QMF and QPID-TOOLS

Hi, 

I am trying to get some information from the broker via either QMF or
qpid-tools. The broker is established with ssl requirement and client
authentication requirement, with three files, namely, a certificate file, a
key file, and a trust file. Here are the questions I have when I tried to
get information from it:

1. I tried to use qpid-stat tool. The problem is, unlike -ssl-key option,
the connection options for qpid-stat don't have the --ssl-trust option. Is
there a way I can connect to the broker without --ssl-trust? I tried witout
--ssl-trust, but it doesn't work.

2. I've read the two files of Python QMF Examples, but I found that they
were different from the QMF Python Console Tutorial, as the former one uses
qmf2, and the latter qmf, etc. Can you please tell me why they are different
because I am kind of confused which one to use.

3. The properties and statistics shown in QMF Python Console Tutorial are
most of what I want to see right now, but again, I cannot connect to the
broker when calling the method addBroker(). I called the method like this:

url = "user_name/password@localhost:4703"
conn_opts = {
                   'transport' : 'ssl',
                   'ssl_keyfile' : "xxx,key.pem",
                   'ssl_certificate': "xxx1.pem.cer",
                   'ssl_trustfile: "xxx2.pem.cer",
                   'ssl_skip_hostname_check' : True,
                  }
sess.addBroker(url, **conn_opts)

This would return a fail and I still cannot connect to the broker. Could you
please tell me what to do?

4. I also tried as shown in the Python QMF examples. With the connection
method in qpid.messaging.Connection, I can successfully connected to the
broker. The problem for me this time is that I don't know how to get the
properties and statistics from the managed objects.

Thanks in advance for your kind help. 

Best regards,
Stein  





--
View this message in context: http://qpid.2158936.n2.nabble.com/QPID-QMF-and-QPID-TOOLS-tp7636902.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: QPID QMF and QPID-TOOLS

Posted by Stein Wang <fw...@aim.com>.
Thank you so much for your great help, Ted! I really appreciate it.

I borrowed some code from qpid-printevents and wrote my own. After several
connection failures and fixes, it is working fine now. :)

Best regards,
Stein



--
View this message in context: http://qpid.2158936.n2.nabble.com/QPID-QMF-and-QPID-TOOLS-tp7636902p7636988.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: QPID QMF and QPID-TOOLS

Posted by Ted Ross <tr...@redhat.com>.

On 01/21/2016 03:36 AM, Stein Wang wrote:
> Hi,
>
> I also want to get the event for a specific class, but in module
> qpidtoollibs.broker, there are only two classes about events, EventHelper
> and BrokerEvent. I've no idea what to do to get the event of my interested
> classes. Could anybody give some suggestions? Thanks.

You can look at the source of qpid-printevents to see an example of the 
usage of the EvenHelper class.

Here's a summary of how it works:

EventHelper.eventAddress creates a subscription address for receiving 
events from the broker.  It defaults to all events, but you can use the 
"cls" argument to specify a specific class of events you wish to 
receive.  You can also select on package and severity.

Create a receiver with the address from eventAddress and receive 
messages.  Each message represents one event.  You can use 
EventHelper.event to convert the raw message into an object that is 
easily queried and viewed.

If you like, I can provide a more concrete example.

-Ted

>
>
>
> --
> View this message in context: http://qpid.2158936.n2.nabble.com/QPID-QMF-and-QPID-TOOLS-tp7636902p7636938.html
> Sent from the Apache Qpid users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: QPID QMF and QPID-TOOLS

Posted by Stein Wang <fw...@aim.com>.
Hi, 

I also want to get the event for a specific class, but in module
qpidtoollibs.broker, there are only two classes about events, EventHelper
and BrokerEvent. I've no idea what to do to get the event of my interested
classes. Could anybody give some suggestions? Thanks. 



--
View this message in context: http://qpid.2158936.n2.nabble.com/QPID-QMF-and-QPID-TOOLS-tp7636902p7636938.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: QPID QMF and QPID-TOOLS

Posted by Stein Wang <fw...@aim.com>.
Thank you so much, Ted!

I tried your instruction this morning, and I got most of the information I
need. I haven't got all the methods I can call on these objects, and I have
to explore more. If you have some tutorials on this, it would be great!:)

Do you have any idea about my other questions? I still want to know why it
cannot connect, and what should I do to make it right. Thanks. 



--
View this message in context: http://qpid.2158936.n2.nabble.com/QPID-QMF-and-QPID-TOOLS-tp7636902p7636937.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: QPID QMF and QPID-TOOLS

Posted by Ted Ross <tr...@redhat.com>.
On 01/20/2016 09:25 AM, Stein Wang wrote:
> Hi,
>
> I am trying to get some information from the broker via either QMF or
> qpid-tools. The broker is established with ssl requirement and client
> authentication requirement, with three files, namely, a certificate file, a
> key file, and a trust file. Here are the questions I have when I tried to
> get information from it:
>
> 1. I tried to use qpid-stat tool. The problem is, unlike -ssl-key option,
> the connection options for qpid-stat don't have the --ssl-trust option. Is
> there a way I can connect to the broker without --ssl-trust? I tried witout
> --ssl-trust, but it doesn't work.
>
> 2. I've read the two files of Python QMF Examples, but I found that they
> were different from the QMF Python Console Tutorial, as the former one uses
> qmf2, and the latter qmf, etc. Can you please tell me why they are different
> because I am kind of confused which one to use.
>
> 3. The properties and statistics shown in QMF Python Console Tutorial are
> most of what I want to see right now, but again, I cannot connect to the
> broker when calling the method addBroker(). I called the method like this:
>
> url = "user_name/password@localhost:4703"
> conn_opts = {
>                     'transport' : 'ssl',
>                     'ssl_keyfile' : "xxx,key.pem",
>                     'ssl_certificate': "xxx1.pem.cer",
>                     'ssl_trustfile: "xxx2.pem.cer",
>                     'ssl_skip_hostname_check' : True,
>                    }
> sess.addBroker(url, **conn_opts)
>
> This would return a fail and I still cannot connect to the broker. Could you
> please tell me what to do?
>
> 4. I also tried as shown in the Python QMF examples. With the connection
> method in qpid.messaging.Connection, I can successfully connected to the
> broker. The problem for me this time is that I don't know how to get the
> properties and statistics from the managed objects.

Since you have this correctly connecting, you should consider using the 
QMF client helper in:

     tools/src/py/qpidtoollibs/broker.py

An object of class BrokerAgent can be created (providing an already open 
connection for communication).  This object has accessor methods for 
querying, viewing, and adding managed objects in the broker.

-Ted


>
> Thanks in advance for your kind help.
>
> Best regards,
> Stein
>
>
>
>
>
> --
> View this message in context: http://qpid.2158936.n2.nabble.com/QPID-QMF-and-QPID-TOOLS-tp7636902.html
> Sent from the Apache Qpid users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org