From ca42b01c0524552dd1ecb6b4daa02aca02baaacd Mon Sep 17 00:00:00 2001 From: yo Date: Thu, 23 Dec 2021 11:58:10 +0100 Subject: [PATCH] first commit --- Makefile | 51 +++++++++++++++++++++++++++++++++ distinfo | 37 ++++++++++++++++++++++++ files/elasticsearch_exporter.in | 42 +++++++++++++++++++++++++++ pkg-descr | 3 ++ pkg-plist | 2 ++ 5 files changed, 135 insertions(+) create mode 100644 Makefile create mode 100644 distinfo create mode 100644 files/elasticsearch_exporter.in create mode 100644 pkg-descr create mode 100644 pkg-plist diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..eeef49e --- /dev/null +++ b/Makefile @@ -0,0 +1,51 @@ +# $FreeBSD: head/sysutils/elasticsearch_exporter/Makefile 517745 2021-12-23 10:52:39Z yo $ + +PORTNAME= elasticsearch_exporter +PORTVERSION= 1.3.0 +PORTREVISION= 1 +CATEGORIES= sysutils + +MAINTAINER= johan@nosd.in +COMMENT= Export elasticsearch metrics in Prometheus format + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +USES= go +USE_GITHUB= yes +GH_ACCOUNT= prometheus-community +GH_PROJECT= elasticsearch_exporter + +USERS= prometheus +GROUPS= prometheus + +GH_TUPLE= \ + alecthomas:kingpin:v2.2.6:alecthomas_kingpin/vendor/gopkg.in/alecthomas/kingpin.v2 \ + alecthomas:template:fb15b899a751:alecthomas_template/vendor/github.com/alecthomas/template \ + alecthomas:units:f65c72e2690d:alecthomas_units/vendor/github.com/alecthomas/units \ + beorn7:perks:v1.0.1:beorn7_perks/vendor/github.com/beorn7/perks \ + blang:semver:3c1074078d32:blang_semver/vendor/github.com/blang/semver \ + cespare:xxhash:v2.1.1:cespare_xxhash_v2/vendor/github.com/cespare/xxhash/v2 \ + go-kit:log:v0.2.0:go_kit_log/vendor/github.com/go-kit/log \ + go-logfmt:logfmt:v0.5.1:go_logfmt_logfmt/vendor/github.com/go-logfmt/logfmt \ + golang:protobuf:v1.4.3:golang_protobuf/vendor/github.com/golang/protobuf \ + golang:sys:ebe580a85c40:golang_sys/vendor/golang.org/x/sys \ + imdario:mergo:v0.3.12:imdario_mergo/vendor/github.com/imdario/mergo \ + matttproud:golang_protobuf_extensions:v1.0.1:matttproud_golang_protobuf_extensions/vendor/github.com/matttproud/golang_protobuf_extensions \ + prometheus:client_golang:v1.11.0:prometheus_client_golang/vendor/github.com/prometheus/client_golang \ + prometheus:client_model:v0.2.0:prometheus_client_model/vendor/github.com/prometheus/client_model \ + prometheus:common:v0.31.1:prometheus_common/vendor/github.com/prometheus/common \ + prometheus:procfs:v0.6.0:prometheus_procfs/vendor/github.com/prometheus/procfs \ + protocolbuffers:protobuf-go:v1.26.0-rc.1:protocolbuffers_protobuf_go/vendor/google.golang.org/protobuf + +#GO_BUILDFLAGS= -mod=mod + +GO_PKGNAME= github.com/${GH_ACCOUNT}/${GH_PROJECT} +GH_TAGNAME= v1.3.0 + +USE_RC_SUBR= elasticsearch_exporter + +pre-test: + ${SETENV} GOPATH="${WRKDIR}" + +.include diff --git a/distinfo b/distinfo new file mode 100644 index 0000000..c6818af --- /dev/null +++ b/distinfo @@ -0,0 +1,37 @@ +TIMESTAMP = 1640255090 +SHA256 (prometheus-community-elasticsearch_exporter-1.3.0-v1.3.0_GH0.tar.gz) = fad6ba25a1f0020fa0fc9343570d3944431c70b65b1d79d5442e63c5e5a8222b +SIZE (prometheus-community-elasticsearch_exporter-1.3.0-v1.3.0_GH0.tar.gz) = 93489 +SHA256 (alecthomas-kingpin-v2.2.6_GH0.tar.gz) = 4624eae43489de8a71ea60efaf6744c581b6bd62909f7514c484c1ea0efaba5a +SIZE (alecthomas-kingpin-v2.2.6_GH0.tar.gz) = 44383 +SHA256 (alecthomas-template-fb15b899a751_GH0.tar.gz) = 2e2a44375eca48ce941182504b5d13aa98182b9a3f64ace33bfda52208bd0f5e +SIZE (alecthomas-template-fb15b899a751_GH0.tar.gz) = 55339 +SHA256 (alecthomas-units-f65c72e2690d_GH0.tar.gz) = ece06024b01821e013bd7158dfe8ec8cc697f586ce8d3cfaa22edde8c2f022c3 +SIZE (alecthomas-units-f65c72e2690d_GH0.tar.gz) = 4925 +SHA256 (beorn7-perks-v1.0.1_GH0.tar.gz) = 98db84bb0224a26094e6adba91b7ee7a1a7ace28cb648d818f8e779e6a19f825 +SIZE (beorn7-perks-v1.0.1_GH0.tar.gz) = 10867 +SHA256 (blang-semver-3c1074078d32_GH0.tar.gz) = 0de84b648331ebaa3f5f169b3027d7204f1a78f63e586c9e1e77327f78617b04 +SIZE (blang-semver-3c1074078d32_GH0.tar.gz) = 14868 +SHA256 (cespare-xxhash-v2.1.1_GH0.tar.gz) = 0ee31178d2c5a1249be4e26294a2f428008dc4e1ecbbfbe47f74e41026df1148 +SIZE (cespare-xxhash-v2.1.1_GH0.tar.gz) = 9292 +SHA256 (go-kit-log-v0.2.0_GH0.tar.gz) = 5dfaf2a831debe95b84ce6e9c889a9cff162720a73fd0ab61cb151d2cc649b5c +SIZE (go-kit-log-v0.2.0_GH0.tar.gz) = 29069 +SHA256 (go-logfmt-logfmt-v0.5.1_GH0.tar.gz) = a9a93f7cbb92a53a587fda196bc040264a625e76064495e95cb3e907f9a93499 +SIZE (go-logfmt-logfmt-v0.5.1_GH0.tar.gz) = 12115 +SHA256 (golang-protobuf-v1.4.3_GH0.tar.gz) = 5736f943f8647362f5559689df6154f3c85d261fb088867c8a68494e2a767610 +SIZE (golang-protobuf-v1.4.3_GH0.tar.gz) = 171969 +SHA256 (golang-sys-ebe580a85c40_GH0.tar.gz) = b70e2301ad08c3ae255b004b8160f866798b95c0c1f88f12641343ed81ce523b +SIZE (golang-sys-ebe580a85c40_GH0.tar.gz) = 1197502 +SHA256 (imdario-mergo-v0.3.12_GH0.tar.gz) = f0ad95fe47f1a9c15545fe3e8abf4364b8163a0f872ce25d6f6ae85e7c885302 +SIZE (imdario-mergo-v0.3.12_GH0.tar.gz) = 22319 +SHA256 (matttproud-golang_protobuf_extensions-v1.0.1_GH0.tar.gz) = 2def0ee6f6b12b1efc0e3007d89f598608a072610e805c3655ea9d13c3ead49b +SIZE (matttproud-golang_protobuf_extensions-v1.0.1_GH0.tar.gz) = 37184 +SHA256 (prometheus-client_golang-v1.11.0_GH0.tar.gz) = a3bc3312bde4182e507042ca0e7ca88aac6656bbf8d516d732e34c3f14bb612a +SIZE (prometheus-client_golang-v1.11.0_GH0.tar.gz) = 168706 +SHA256 (prometheus-client_model-v0.2.0_GH0.tar.gz) = 4ab1be9cdfa702d7f49beeb09a256bcc6a2aad55e8a0a37e7732a46934264e12 +SIZE (prometheus-client_model-v0.2.0_GH0.tar.gz) = 10986 +SHA256 (prometheus-common-v0.31.1_GH0.tar.gz) = 1c4184c0b052052f2f08903ee66d17dba001b9954a737805d3c0ee328f758d5c +SIZE (prometheus-common-v0.31.1_GH0.tar.gz) = 145691 +SHA256 (prometheus-procfs-v0.6.0_GH0.tar.gz) = 6ad7a23cf4db9fa5dbf2c5d8fbd0fbf5ffe48e3ddb7bf15f9359813d764ce73c +SIZE (prometheus-procfs-v0.6.0_GH0.tar.gz) = 169898 +SHA256 (protocolbuffers-protobuf-go-v1.26.0-rc.1_GH0.tar.gz) = a2b3581fb291ffdfe080cc16eb7b0b13295105a441fc0554a105368b7e208e66 +SIZE (protocolbuffers-protobuf-go-v1.26.0-rc.1_GH0.tar.gz) = 1270311 diff --git a/files/elasticsearch_exporter.in b/files/elasticsearch_exporter.in new file mode 100644 index 0000000..236205d --- /dev/null +++ b/files/elasticsearch_exporter.in @@ -0,0 +1,42 @@ +#!/bin/sh + +# $FreeBSD: head/sysutils/elasticsearch_exporter/files/elasticsearchg_exporter.in 529909 2020-03-30 19:18:03Z decke $ +# +# PROVIDE: elasticsearch_exporter +# REQUIRE: DAEMON +# KEYWORD: shutdown +# +# elasticsearch_exporter_enable (bool): Set to "YES" to enable elasticsearchg_exporter. +# (default: "NO") +# +# elasticsearch_exporter_listen (str): Exporter listening address +# (default: ":9114") +# +# elasticsearch_exporter_endpoint (str): Protocol, host and port on which elasticsearch +# listen +# (default: "http://localhost:9200") +# +# elasticsearch_exporter_log_level (str): Only log messages with the given severity +# or above. [debug,info,warn,error] +# (default: "info") +# + +. /etc/rc.subr + +name=elasticsearch_exporter +rcvar=elasticsearch_exporter_enable + +load_rc_config $name + +: ${elasticsearch_exporter_enable="NO"} +: ${elasticsearch_exporter_listen=":9114"} +: ${elasticsearch_exporter_endpoint="http://localhost:9200"} +: ${elasticsearch_exporter_log_level="info"} +: ${elasticsearch_exporter_pidfile:="/var/run/elasticsearch_exporter.pid"} +: ${elasticsearch_exporter_user:="prometheus"} + +command="/usr/local/bin/elasticsearch_exporter" +command_args="--es.uri=\${elasticsearch_exporter_endpoint} --web.listen-address=\${logstash_exporter_listen} --log.level=\${logstash_exporter_log_level}" +start_cmd="/usr/sbin/daemon -u ${elasticsearch_exporter_user} ${command} ${command_args}" + +run_rc_command "$1" diff --git a/pkg-descr b/pkg-descr new file mode 100644 index 0000000..866102d --- /dev/null +++ b/pkg-descr @@ -0,0 +1,3 @@ +Export ElasticSearch metrics in Prometheus format. + +WWW: https://github.com/prometheus-community/elasticsearch_exporter diff --git a/pkg-plist b/pkg-plist new file mode 100644 index 0000000..6f0ccde --- /dev/null +++ b/pkg-plist @@ -0,0 +1,2 @@ +bin/elasticsearch_exporter +etc/rc.d/elasticsearch_exporter