alfss/zabbix-rabbitmq — pull request #2 by Elzor (2013-12-03 16:18:17+00:00)
Title: fix regexp

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