ARAVINDA VISHWANATHAPURA

gvolinfojson - A utility to convert xml output of gluster volume info to json

May 13, 2014
1 minute read.
glusterfs tools glusterfsblog

Today I wrote a small utility using Golang to convert xml output of command gluster volume info to json.

Download the binary from here and copy to /usr/local/bin directory(or any other directory, which is available in PATH).

wget https://github.com/aravindavk/gvolinfojson/releases/download/1.0/gvolinfojson
sudo cp gvolinfojson /usr/local/bin/
sudo chmod +x /usr/local/bin/gvolinfojson

Or

If you have golang installed(make sure $GOPATH/bin is available in PATH), then

go get github.com/aravindavk/gvolinfojson

To use it with gluster volume info command,

sudo gluster volume info --xml | gvolinfojson

Thats it, you will get the json output of volume info command. If you need pretty json output then

sudo gluster volume info --xml | gvolinfojson --pretty

Source code is available here.

C & S Welcome.

About Aravinda Vishwanathapura

Co-Founder & CTO at Kadalu Technologies, Creator of Sanka, Creator of Chitra, GlusterFS core team member, Maintainer of Kadalu Storage
Contact: Linkedin | Twitter | Facebook | Github | mail@aravindavk.in