1 |
commit: f3ed20bf98a108f2cf0ab0a58bd9200d3292d924 |
2 |
Author: William Hubbs <williamh <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Mar 26 02:54:11 2018 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Mar 26 02:55:38 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f3ed20bf |
7 |
|
8 |
net-analyzer/kapacitor: New package |
9 |
|
10 |
This is a framework for processing, monitoring and alerting on time series data. |
11 |
|
12 |
Package-Manager: Portage-2.3.24, Repoman-2.3.6 |
13 |
|
14 |
net-analyzer/kapacitor/Manifest | 1 + |
15 |
net-analyzer/kapacitor/files/kapacitor.confd | 12 +++++++ |
16 |
net-analyzer/kapacitor/files/kapacitor.rc | 31 +++++++++++++++++ |
17 |
net-analyzer/kapacitor/kapacitor-1.4.1.ebuild | 48 +++++++++++++++++++++++++++ |
18 |
net-analyzer/kapacitor/metadata.xml | 12 +++++++ |
19 |
5 files changed, 104 insertions(+) |
20 |
|
21 |
diff --git a/net-analyzer/kapacitor/Manifest b/net-analyzer/kapacitor/Manifest |
22 |
new file mode 100644 |
23 |
index 00000000000..f2322b6bb56 |
24 |
--- /dev/null |
25 |
+++ b/net-analyzer/kapacitor/Manifest |
26 |
@@ -0,0 +1 @@ |
27 |
+DIST kapacitor-1.4.1.tar.gz 7543899 BLAKE2B 142ea7899be3728d2e857a83beebb8ff32dae6b7a71097de1474878a1728c6597937d03a828746af2464d6406ae80796b11579a10baacb66843bd535f971d940 SHA512 315e01e97f6a89afbbd0e36c17ee64d2744bc8ccce2e318f17ad5fba75599fdc55c303069c32aed07ba73c8ba9cdbacdb76c7ffe0c81681c1ef0be0ba405802e |
28 |
|
29 |
diff --git a/net-analyzer/kapacitor/files/kapacitor.confd b/net-analyzer/kapacitor/files/kapacitor.confd |
30 |
new file mode 100644 |
31 |
index 00000000000..d58906ae3e7 |
32 |
--- /dev/null |
33 |
+++ b/net-analyzer/kapacitor/files/kapacitor.confd |
34 |
@@ -0,0 +1,12 @@ |
35 |
+#The convention in this file is to show the default setting commented |
36 |
+#out. |
37 |
+#To change the setting, uncomment it then change the value. |
38 |
+ |
39 |
+#This is the kapacitor error log: |
40 |
+#error_log="/var/log/kapacitor/kapacitor.log" |
41 |
+ |
42 |
+#This is the kapacitor output log: |
43 |
+#output_log="/dev/null" |
44 |
+ |
45 |
+# Extra options to pass to kapacitord: |
46 |
+#kapacitor_opts="" |
47 |
|
48 |
diff --git a/net-analyzer/kapacitor/files/kapacitor.rc b/net-analyzer/kapacitor/files/kapacitor.rc |
49 |
new file mode 100644 |
50 |
index 00000000000..8ee907f66d5 |
51 |
--- /dev/null |
52 |
+++ b/net-analyzer/kapacitor/files/kapacitor.rc |
53 |
@@ -0,0 +1,31 @@ |
54 |
+#!/sbin/openrc-run |
55 |
+ |
56 |
+config=/etc/kapacitor/kapacitor.conf |
57 |
+pidfile=/var/run/kapacitord.pid |
58 |
+command=/usr/bin/kapacitord |
59 |
+command_args="-config ${config} ${kapacitor_opts}" |
60 |
+command_background=yes |
61 |
+make_pidfile=yes |
62 |
+command_user="kapacitor:kapacitor" |
63 |
+ |
64 |
+# Logging |
65 |
+error_log="${error_log:-/var/log/influxdb/influxd.log}" |
66 |
+output_log="${output_log:-/dev/null}" |
67 |
+ |
68 |
+# Max open files |
69 |
+rc_ulimit="-n 65536" |
70 |
+ |
71 |
+start_pre() { |
72 |
+ # Check if config file exist |
73 |
+ if [ ! -r ${config} ]; then |
74 |
+ eerror "config file ${config} doesn't exist" |
75 |
+ return 1 |
76 |
+ fi |
77 |
+ if [ ! -f "$error_log" ]; then |
78 |
+ mkdir -p "$(dirname $error_log)" |
79 |
+ fi |
80 |
+ if [ ! -f "$output_log" ]; then |
81 |
+ mkdir -p "$(dirname $output_log)" |
82 |
+ fi |
83 |
+ return 0 |
84 |
+} |
85 |
|
86 |
diff --git a/net-analyzer/kapacitor/kapacitor-1.4.1.ebuild b/net-analyzer/kapacitor/kapacitor-1.4.1.ebuild |
87 |
new file mode 100644 |
88 |
index 00000000000..dd499480fbd |
89 |
--- /dev/null |
90 |
+++ b/net-analyzer/kapacitor/kapacitor-1.4.1.ebuild |
91 |
@@ -0,0 +1,48 @@ |
92 |
+# Copyright 1999-2018 Gentoo Foundation |
93 |
+# Distributed under the terms of the GNU General Public License v2 |
94 |
+ |
95 |
+EAPI=6 |
96 |
+EGO_PN=github.com/influxdata/kapacitor |
97 |
+ |
98 |
+inherit golang-build golang-vcs-snapshot systemd user |
99 |
+ |
100 |
+DESCRIPTION="Monitoring, processing and alerting on time series data" |
101 |
+HOMEPAGE="https://www.influxdata.com" |
102 |
+SRC_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
103 |
+ |
104 |
+LICENSE="MIT" |
105 |
+SLOT="0" |
106 |
+KEYWORDS="~amd64" |
107 |
+IUSE="" |
108 |
+ |
109 |
+pkg_setup() { |
110 |
+ enewgroup kapacitor |
111 |
+ enewuser kapacitor -1 -1 /var/lib/kapacitor kapacitor |
112 |
+} |
113 |
+ |
114 |
+src_compile() { |
115 |
+ pushd "src/${EGO_PN}" > /dev/null || die |
116 |
+ set -- env GOPATH="${S}" go build -v -work -x ./... |
117 |
+ echo "$@" |
118 |
+ "$@" || die "compile failed" |
119 |
+ popd > /dev/null |
120 |
+} |
121 |
+ |
122 |
+src_install() { |
123 |
+ pushd "src/${EGO_PN}" > /dev/null || die |
124 |
+ set -- env GOPATH="${S}" go install -v -work -x ./... |
125 |
+ echo "$@" |
126 |
+ "$@" || die |
127 |
+ dobin "${S}"/bin/kapacitor{,d} |
128 |
+ insinto /etc/kapacitor |
129 |
+doins etc/kapacitor/kapacitor.conf |
130 |
+keepdir /etc/kapacitor/load |
131 |
+ insinto /etc/logrotate.d |
132 |
+ doins etc/logrotate.d/kapacitor |
133 |
+ systemd_dounit scripts/kapacitor.service |
134 |
+ keepdir /var/log/kapacitor |
135 |
+ fowners kapacitor:kapacitor /var/log/kapacitor |
136 |
+ newconfd "${FILESDIR}"/kapacitor.confd kapacitor |
137 |
+ newinitd "${FILESDIR}"/kapacitor.rc kapacitor |
138 |
+ popd > /dev/null || die |
139 |
+} |
140 |
|
141 |
diff --git a/net-analyzer/kapacitor/metadata.xml b/net-analyzer/kapacitor/metadata.xml |
142 |
new file mode 100644 |
143 |
index 00000000000..ed7262b70f1 |
144 |
--- /dev/null |
145 |
+++ b/net-analyzer/kapacitor/metadata.xml |
146 |
@@ -0,0 +1,12 @@ |
147 |
+<?xml version="1.0" encoding="UTF-8"?> |
148 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
149 |
+<pkgmetadata> |
150 |
+ <maintainer type="person"> |
151 |
+ <email>williamh@g.o</email> |
152 |
+ <name>William Hubbs</name> |
153 |
+ </maintainer> |
154 |
+ <longdescription lang="en"> |
155 |
+ Open source framework for processing, monitoring and alerting on |
156 |
+ time series data. |
157 |
+ </longdescription> |
158 |
+</pkgmetadata> |