fixes + go version bump in __prometheus_exporter
This commit is contained in:
parent
f08ac264a0
commit
909431c269
2 changed files with 21 additions and 15 deletions
|
@ -16,6 +16,13 @@ Daemontools (or something compatible) must be installed (in particular, the comm
|
|||
This type installs and builds the latest version from git, using go get. A recent version of golang as well
|
||||
as build tools (make, g++, etc.) must be available.
|
||||
|
||||
Currently supported exporters:
|
||||
|
||||
- node
|
||||
- blackbox
|
||||
- ceph
|
||||
|
||||
|
||||
REQUIRED PARAMETERS
|
||||
-------------------
|
||||
None
|
||||
|
|
|
@ -10,41 +10,40 @@ __user prometheus --system
|
|||
case $exporter in
|
||||
node)
|
||||
TEXTFILES=/service/node-exporter/textfiles # path for the textfiles collector
|
||||
__directory $TEXTFILES --parents --mode 777
|
||||
require="$require __golang_from_vendor" __go_get github.com/prometheus/node_exporter
|
||||
|
||||
port=9100
|
||||
run="setuidgid prometheus $GOBIN/node_exporter -web.listen-address :$port -collector.textfile.directory=$TEXTFILES"
|
||||
|
||||
require="__golang_from_vendor" __go_get github.com/prometheus/node_exporter
|
||||
__directory $TEXTFILES --parents --mode 777
|
||||
;;
|
||||
blackbox)
|
||||
port=9115
|
||||
run="setuidgid prometheus $GOBIN/blackbox_exporter -config.file=/service/blackbox-exporter/blackbox.yml"
|
||||
|
||||
require="__daemontools_service/blackbox-exporter __user/prometheus" __config_file "/service/blackbox-exporter/blackbox.yml" \
|
||||
require="$require __daemontools_service/${exporter}-exporter __user/prometheus" __config_file "/service/${exporter}-exporter/blackbox.yml" \
|
||||
--source $__type/files/blackbox.yml \
|
||||
--group prometheus --mode 640 \
|
||||
--onchange "svc -h /service/blackbox-exporter"
|
||||
require="__golang_from_vendor" __go_get github.com/prometheus/blackbox_exporter
|
||||
--onchange "svc -h /service/${exporter}-exporter"
|
||||
require="$require __golang_from_vendor" __go_get github.com/prometheus/blackbox_exporter
|
||||
|
||||
port=9115
|
||||
run="setuidgid prometheus $GOBIN/blackbox_exporter -config.file=/service/${exporter}-exporter/blackbox.yml"
|
||||
;;
|
||||
ceph)
|
||||
__package librados-dev # dependency of ceph_exporter
|
||||
require="$require __golang_from_vendor __package/librados-dev" __go_get github.com/digitalocean/ceph_exporter
|
||||
|
||||
port=9128
|
||||
run="setuidgid ceph $GOBIN/ceph_exporter -ceph.config /etc/ceph/ceph.conf -telemetry.addr :$port"
|
||||
|
||||
__package librados-dev # dependency of ceph_exporter
|
||||
require="__golang_from_vendor __package/librados-dev" __go_get github.com/digitalocean/ceph_exporter
|
||||
;;
|
||||
*)
|
||||
echo "Unknown exporter: $exporter." >&2
|
||||
echo "Unsupported exporter: $exporter." >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
require="__daemontools" __daemontools_service ${exporter}-exporter --run "$run"
|
||||
require="$require __daemontools" __daemontools_service ${exporter}-exporter --run "$run"
|
||||
if [ -f "$__object/parameter/add-consul-service" ]; then
|
||||
__consul_service ${exporter}-exporter --port $port --check-http "http://localhost:$port/metrics" --check-interval 10s
|
||||
fi
|
||||
|
||||
#__daemontools --install-init-script
|
||||
__daemontools
|
||||
__golang_from_vendor --version 1.8.1 # required for many exporters
|
||||
__golang_from_vendor --version 1.9 # required for many exporters
|
||||
|
|
Loading…
Reference in a new issue