diff --git a/Makefile b/Makefile index 2a963e4..2bd5487 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,7 @@ SUM_FILES = build/sha256sum build/md5sum GO_FLAGS = GO_BUILD = go build $(GO_FLAGS) -ldflags "-X 'main.version=$(VERSION)'" -o $@ $< +export GO111MODULE=on .PHONY: all clean docker test version diff --git a/README.md b/README.md index 1b6af1b..eddac33 100644 --- a/README.md +++ b/README.md @@ -84,17 +84,25 @@ replaceWith = "servers.HOSTNAME.software.pdns" ``` This will ask Grafsy to replace all kinds of metric starting with **pdns** or aggregation prefixes **^(SUM|AVG|MIN|MAX).pdns** to **servers.HOSTNAME.software.pdns** where *HOSTNAME* will be replaced with os.Hostname() output +# Client + +The `grafsy-client` binary is implemented for easy metrics sending from generators to a grafsy daemon. You only need to specify the config file, if a not-default one is used. +It sends either metrics from specified files or from STDIN. + +``` +Usage: ./build/grafsy-client [args] [file1 [fileN...]] + Or: metrics-generator | ./build/grafsy-client [args] +``` + # Installation - Install go https://golang.org/doc/install -- Make a proper structure of directories: `mkdir -p /opt/go/src /opt/go/bin /opt/go/pkg` -- Setup g GOPATH variable: `export GOPATH=/opt/go` -- Clone this project to src: `go get github.com/leoleovich/grafsy` -- Fetch dependencies: `cd /opt/go/github.com/leoleovich/grafsy && go get ./...` -- Compile project: `go install github.com/leoleovich/grafsy/grafsy` -- Copy config file: `mkdir /etc/grafsy && cp /opt/go/src/github.com/leoleovich/grafsy/grafsy.toml /etc/grafsy/` +- Clone this project: `git clohe https://github.com/leoleovich/grafsy.git && cd grafsy` +- Compile project: `make` +- Copy a config file: `mkdir /etc/grafsy && cp grafsy.toml /etc/grafsy/` - Change your settings, e.g. `carbonAddrs` -- Run it `/opt/go/bin/grafsy` +- Run it `./build/grafsy` +- Send metrics via client `metrics-generator | ./build/grafsy-client` ## Docker