From f3ed20bf98a108f2cf0ab0a58bd9200d3292d924 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Sun, 25 Mar 2018 21:54:11 -0500 Subject: net-analyzer/kapacitor: New package This is a framework for processing, monitoring and alerting on time series data. Package-Manager: Portage-2.3.24, Repoman-2.3.6 --- net-analyzer/kapacitor/Manifest | 1 + net-analyzer/kapacitor/files/kapacitor.confd | 12 +++++++ net-analyzer/kapacitor/files/kapacitor.rc | 31 +++++++++++++++++ net-analyzer/kapacitor/kapacitor-1.4.1.ebuild | 48 +++++++++++++++++++++++++++ net-analyzer/kapacitor/metadata.xml | 12 +++++++ 5 files changed, 104 insertions(+) create mode 100644 net-analyzer/kapacitor/Manifest create mode 100644 net-analyzer/kapacitor/files/kapacitor.confd create mode 100644 net-analyzer/kapacitor/files/kapacitor.rc create mode 100644 net-analyzer/kapacitor/kapacitor-1.4.1.ebuild create mode 100644 net-analyzer/kapacitor/metadata.xml (limited to 'net-analyzer/kapacitor') diff --git a/net-analyzer/kapacitor/Manifest b/net-analyzer/kapacitor/Manifest new file mode 100644 index 000000000000..f2322b6bb560 --- /dev/null +++ b/net-analyzer/kapacitor/Manifest @@ -0,0 +1 @@ +DIST kapacitor-1.4.1.tar.gz 7543899 BLAKE2B 142ea7899be3728d2e857a83beebb8ff32dae6b7a71097de1474878a1728c6597937d03a828746af2464d6406ae80796b11579a10baacb66843bd535f971d940 SHA512 315e01e97f6a89afbbd0e36c17ee64d2744bc8ccce2e318f17ad5fba75599fdc55c303069c32aed07ba73c8ba9cdbacdb76c7ffe0c81681c1ef0be0ba405802e diff --git a/net-analyzer/kapacitor/files/kapacitor.confd b/net-analyzer/kapacitor/files/kapacitor.confd new file mode 100644 index 000000000000..d58906ae3e7a --- /dev/null +++ b/net-analyzer/kapacitor/files/kapacitor.confd @@ -0,0 +1,12 @@ +#The convention in this file is to show the default setting commented +#out. +#To change the setting, uncomment it then change the value. + +#This is the kapacitor error log: +#error_log="/var/log/kapacitor/kapacitor.log" + +#This is the kapacitor output log: +#output_log="/dev/null" + +# Extra options to pass to kapacitord: +#kapacitor_opts="" diff --git a/net-analyzer/kapacitor/files/kapacitor.rc b/net-analyzer/kapacitor/files/kapacitor.rc new file mode 100644 index 000000000000..8ee907f66d56 --- /dev/null +++ b/net-analyzer/kapacitor/files/kapacitor.rc @@ -0,0 +1,31 @@ +#!/sbin/openrc-run + +config=/etc/kapacitor/kapacitor.conf +pidfile=/var/run/kapacitord.pid +command=/usr/bin/kapacitord +command_args="-config ${config} ${kapacitor_opts}" +command_background=yes +make_pidfile=yes +command_user="kapacitor:kapacitor" + +# Logging +error_log="${error_log:-/var/log/influxdb/influxd.log}" +output_log="${output_log:-/dev/null}" + +# Max open files +rc_ulimit="-n 65536" + +start_pre() { + # Check if config file exist + if [ ! -r ${config} ]; then + eerror "config file ${config} doesn't exist" + return 1 + fi + if [ ! -f "$error_log" ]; then + mkdir -p "$(dirname $error_log)" + fi + if [ ! -f "$output_log" ]; then + mkdir -p "$(dirname $output_log)" + fi + return 0 +} diff --git a/net-analyzer/kapacitor/kapacitor-1.4.1.ebuild b/net-analyzer/kapacitor/kapacitor-1.4.1.ebuild new file mode 100644 index 000000000000..dd499480fbdd --- /dev/null +++ b/net-analyzer/kapacitor/kapacitor-1.4.1.ebuild @@ -0,0 +1,48 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +EGO_PN=github.com/influxdata/kapacitor + +inherit golang-build golang-vcs-snapshot systemd user + +DESCRIPTION="Monitoring, processing and alerting on time series data" +HOMEPAGE="https://www.influxdata.com" +SRC_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" +IUSE="" + +pkg_setup() { + enewgroup kapacitor + enewuser kapacitor -1 -1 /var/lib/kapacitor kapacitor +} + +src_compile() { + pushd "src/${EGO_PN}" > /dev/null || die + set -- env GOPATH="${S}" go build -v -work -x ./... + echo "$@" + "$@" || die "compile failed" + popd > /dev/null +} + +src_install() { + pushd "src/${EGO_PN}" > /dev/null || die + set -- env GOPATH="${S}" go install -v -work -x ./... + echo "$@" + "$@" || die + dobin "${S}"/bin/kapacitor{,d} + insinto /etc/kapacitor +doins etc/kapacitor/kapacitor.conf +keepdir /etc/kapacitor/load + insinto /etc/logrotate.d + doins etc/logrotate.d/kapacitor + systemd_dounit scripts/kapacitor.service + keepdir /var/log/kapacitor + fowners kapacitor:kapacitor /var/log/kapacitor + newconfd "${FILESDIR}"/kapacitor.confd kapacitor + newinitd "${FILESDIR}"/kapacitor.rc kapacitor + popd > /dev/null || die +} diff --git a/net-analyzer/kapacitor/metadata.xml b/net-analyzer/kapacitor/metadata.xml new file mode 100644 index 000000000000..ed7262b70f1e --- /dev/null +++ b/net-analyzer/kapacitor/metadata.xml @@ -0,0 +1,12 @@ + + + + + williamh@gentoo.org + William Hubbs + + + Open source framework for processing, monitoring and alerting on + time series data. + + -- cgit v1.2.3-65-gdbad