[rabbitmq-discuss] "rabbitmqctl cluster_status" output - quoted or not quoted?

Jerry Kuch jerryk at rbcon.com
Wed Nov 7 22:23:24 GMT 2012


Hi, Jerry:

Note those '-' signs in the quoted ones.  Erlang's demanding that an atom
name be escaped in single quotes so that the hyphen doesn't get taken as a
minus sign, thereby producing a gibberish expression.

If you're writing something to systematically parse things like this, you
might find looking at an Erlang reference useful so you can get a sense for
what types are involved in such expressions, and what the syntactic
conventions and requirements are on their structures...

Best regards,
Jerry

On Wed, Nov 7, 2012 at 2:08 PM, Jerry Bao <hijerrybao at gmail.com> wrote:

> Why do some "rabbitmqctl cluster_status" outputs have single quote around
> the nodes, others do not?
>
> For example,
> *[root at jbao-vm1 ~]# rabbitmqctl cluster_status*
> *Cluster status of node 'rabbit at jbao-vm1' ...*
> *[{nodes,[{disc,['rabbit at jbao-vm2','rabbit at jbao-vm1']}]},*
> * {running_nodes,['rabbit at jbao-vm2',*
> *                 'rabbit at jbao-vm1']}]*
> *...done.*
> *
> *
> On another cluster, I have somthing like this:
>
> rabbit1$ *rabbitmqctl cluster_status*
> Cluster status of node rabbit at rabbit1 ...
> [{nodes,[{disc,[rabbit at rabbit1,rabbit at rabbit2]},{ram,[rabbit at rabbit3]}]},
>  {running_nodes,[rabbit at rabbit2,rabbit at rabbit1]}]
> ...done.
>
> They are same version of RabbitMQ/Erlang/OTP, all on the same CentOS 5.7
> 64bit.
>
> I am trying to write a script to parse it so I can monitor the status of
> the cluster. I have been working with RabbitMQ for a while but am
> relatively new to Erlang. Does anybody know why? Is this a Erlang or OS
> locale issue?
>
> I know I can write my parser to handle both cases but just want to know
> what is causing that.
>
> Thanks,
>
> Jerry
>
>
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20121107/2e99844f/attachment.htm>


More information about the rabbitmq-discuss mailing list