graphite-project / carbonate

Utilities for managing graphite clusters
MIT License
516 stars 80 forks source link

Show short address information in carbon-lookup #17

Closed jssjr closed 10 years ago

jssjr commented 10 years ago

The carbon-lookup tool can be more useful in a scripting environment by only returning the IP address or hostname of the matched nodes. This allows scripts to skip a common grep or awk pipe when consuming this information.

% carbon-lookup my.metric
127.0.0.2:2004:1

and

% carbon-lookup -s my.metric
127.0.0.2

Think,

for node in $(carbon-lookup -s "$metric") ; do
    ssh carbon@$node -- do_something_cool
done