Skip to content

Conversation

@Elzor
Copy link

@Elzor Elzor commented Dec 3, 2013

1)fix 1: change sed -n '3p' to sed -n '2p'
Command cluster_status returns 3 lines. 4 was expected
Ex:
/usr/sbin/rabbitmqctl cluster_status
Cluster status of node rabbit@storage ...
[{nodes,[{disc,[rabbit@storage]}]},{running_nodes,[rabbit@storage]}]
...done.

  1. I changed that:
    sed -n '/running_nodes,[.]},/p' | sed -r 's/[|]|{|}|running_nodes,//g')
    on this:
    perl -pe 's/.running_nodes,[(.)]}.
    /$1/g')
    It's more easy and flexibly

1)fix 1: change sed -n '3p' to sed -n '2p'
Command cluster_status returns 3 lines. 4 was expected 
Ex:
/usr/sbin/rabbitmqctl cluster_status
Cluster status of node rabbit@storage ...
[{nodes,[{disc,[rabbit@storage]}]},{running_nodes,[rabbit@storage]}]
...done.

2) I changed that:
sed -n '/running_nodes,\[.*\]\},/p' | sed  -r 's/\[|\]|\{|\}|running_nodes,//g')
on this:
perl -pe 's/.*running_nodes\,\[(.*)\]\}.*/$1/g')
It's more easy and flexibly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant