summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2018-03-25 21:54:11 -0500
committerWilliam Hubbs <williamh@gentoo.org>2018-03-25 21:55:38 -0500
commitf3ed20bf98a108f2cf0ab0a58bd9200d3292d924 (patch)
treedd5072f4704d512445693de7a22f5d4d7169ea42 /net-analyzer
parentmedia-tv/plex-media-server: version bump to 1.12.1 (diff)
downloadgentoo-f3ed20bf98a108f2cf0ab0a58bd9200d3292d924.tar.gz
gentoo-f3ed20bf98a108f2cf0ab0a58bd9200d3292d924.tar.bz2
gentoo-f3ed20bf98a108f2cf0ab0a58bd9200d3292d924.zip
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
Diffstat (limited to 'net-analyzer')
-rw-r--r--net-analyzer/kapacitor/Manifest1
-rw-r--r--net-analyzer/kapacitor/files/kapacitor.confd12
-rw-r--r--net-analyzer/kapacitor/files/kapacitor.rc31
-rw-r--r--net-analyzer/kapacitor/kapacitor-1.4.1.ebuild48
-rw-r--r--net-analyzer/kapacitor/metadata.xml12
5 files changed, 104 insertions, 0 deletions
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>williamh@gentoo.org</email>
+ <name>William Hubbs</name>
+ </maintainer>
+ <longdescription lang="en">
+ Open source framework for processing, monitoring and alerting on
+ time series data.
+ </longdescription>
+</pkgmetadata>