summaryrefslogtreecommitdiff
path: root/app-admin/diamond
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /app-admin/diamond
reinit the tree, so we can have metadata
Diffstat (limited to 'app-admin/diamond')
-rw-r--r--app-admin/diamond/Manifest11
-rw-r--r--app-admin/diamond/diamond-4.0-r1.ebuild74
-rw-r--r--app-admin/diamond/diamond-4.0.515.ebuild70
-rw-r--r--app-admin/diamond/diamond-9999.ebuild64
-rw-r--r--app-admin/diamond/files/diamond-4.0-psutil.patch48
-rw-r--r--app-admin/diamond/files/diamond.confd2
-rw-r--r--app-admin/diamond/files/diamond.initd19
-rw-r--r--app-admin/diamond/metadata.xml22
8 files changed, 310 insertions, 0 deletions
diff --git a/app-admin/diamond/Manifest b/app-admin/diamond/Manifest
new file mode 100644
index 000000000000..084e7ac04467
--- /dev/null
+++ b/app-admin/diamond/Manifest
@@ -0,0 +1,11 @@
+AUX diamond-4.0-psutil.patch 1842 SHA256 8654e35bfffdc84dbde798bf283ffd6fffc626fd8b12ae98848dae08d7bdf241 SHA512 4f59e7811df1419dcf29d231f62844de6db9e5a3f6e7600b11432d1bda994b62973172cce98d257d6ce03e940645df76dee2c3cd4fced18e960527bb23b1f1ea WHIRLPOOL 2fbee860112dc44a77999bfc1df24d5464b4c515461d3879271aaf25453bfaa070b8d32c1b8a6dac1c089f55cf17d495711e4c31f65debc613d0b642fe0e00f8
+AUX diamond.confd 57 SHA256 41941d406f48b5eca55d9146928eee185820fe27a3708d3fcaa71c3f78bf4adc SHA512 51b037902394b22f957a15ad1479ebdae5ac29384f2b7a5053ea8200bad05dc9c9060cc5c6c1a931e341e99b95327e55b06aaa9a828950533265f9c96a8dff55 WHIRLPOOL 80165d5cf5347dd3abeeec53f4df64d51f7f78445363574b2bc1b8f2fec9f1a0798c4986319dabe6d6a4b6b499c577fc8679b2fc65554107e48e3e13dac4e68b
+AUX diamond.initd 447 SHA256 3f429f97ffef0a72c30be17b6dcc4dacfc1f92a905dce4b8e5ddf7f6c77c3b29 SHA512 004b305ba945fa313da4cd51226050cec955886405026baacb15f7ab586b7ba650492b0e2cd9621b3854ec83ee6192a7b86ad4fd8239008df3c6c8bb5c8c84f3 WHIRLPOOL 843fc4b73a8999a1ea20368791af0d3dbd51fc773f1d760a62a52551de5a3f7783a3ca00a850016316c588826b6e5741e2e55d7cd7dcb18b6e9f5057648bbb46
+DIST python-diamond-4.0.515.tar.gz 620337 SHA256 3e8a1ff06b18d70a850d10689b3c8e041e91237aa8dee16db824ec368c04949f SHA512 8516e46f4f75400a55ca0127789344a897fc7cd6c10f0f8379d30db58de5a09ae676e340371cdf1a0c9ca894fd355699a1a0f430bfad148e32157d5eb97aaef5 WHIRLPOOL 39fe60e68b28e706a615c9b6068384b2ffac0710d06f26988341e1f032db4558d0018d7d746c7eef12ad0c0e04969decddd839f6cdc7fc1c01aca31c91e2591e
+DIST python-diamond-4.0.tar.gz 491433 SHA256 e84dd3c87b230d524306a07c3fc7c1db1d9796e3748025e8345a4fa18b162256 SHA512 c4a6e63bdc55f9e0ac2fbf3b644be91662635c08ecc864dfaaebf2fe62fb45609c099da63efd93ed498d2dc9e95bbcb64be09f715e21d59b30bce958a96dc56b WHIRLPOOL 2b1f6124001183058cf282d6e9c51bba0878f26308731266f2c31c549bb42db945c579b49b5a34666e0c05ccbda0163135662a11e59a482f8ef031c49c6005ba
+EBUILD diamond-4.0-r1.ebuild 2007 SHA256 c3a0524fe2685d32444da72f7fd92ae2d0dbe23a97ba1d6b88dd73e708a40eef SHA512 9385587aed2660c5872baa3a224e7a74be1b49c903b814fdf353a44401c79008e9f325b5b68eefc610b453dc91bee10730d87fca55397f1b94202441a73e6b4a WHIRLPOOL 26075b82b3c56853a42db8b66a0fb8953451f8898e71e18b400d23365247e6e9ae61654cc21401f6f93573706c4115c8a5e5b69b7daecb298cefe1a1c71d89b7
+EBUILD diamond-4.0.515.ebuild 1891 SHA256 678f904d75b67c1259905cb22231b3ef0a1b38509771a94457b74490ee0c7f43 SHA512 344ad91933e15d9d93fd7bd796650f98dc7bfd1a57a38053346251f852b7b6e9fdb56bcd386cf7310c87a56c847724b6dd91a13116fa9010f80f4662008230e2 WHIRLPOOL 5c485b5b623f6f04fdfb2d117306a7c8096c4b73f21f6f349fd200abcec63ccb199691843951e130fe19c062ee94763a398e75a662449dbdcfd43744921e1e0d
+EBUILD diamond-9999.ebuild 1663 SHA256 3c9121848e3c14f571b3c9dfa5fa004fbc7aa0d823bc18895a8a3f9affb8cf36 SHA512 d2b16d9339b1c724eda84377fe78d8abfb1c31f37f5363ae6718662ae4d1d02d7af0edc52247802da8dd449928ad17ef34028933e0d8fa52f7d0310eef3a1c2f WHIRLPOOL bcc965307301fb343b4dc4fac18b4867d54a28077ea06e36a6e3d04177fb2405ffb376c4b37fa69189546342f0f63902eebed296d07aec7d6fa0c58fe1ed257d
+MISC ChangeLog 2721 SHA256 9dd553d60e647e0537f925c20c607df3fe113fa2dd6bf587a87491451d13b0f9 SHA512 0c0a81087e1c021cdff56c4fc7301901d7985290ee1a51777e2d1a2b037116e3b54f8aaf78992a7911fbdec4caa0adae8faa78d1a56aaf71671400d45797ed95 WHIRLPOOL 43e069d320df9c7ae628aebd4f36a83d7de00aa3b3b8d258fd31097d974ae317a5b363824b5cf5171e7989b0a9e9fc0e1dff081d5fe10d39f5b8e555e0fac423
+MISC ChangeLog-2015 1669 SHA256 c3c0f1c7e902586b2beb10dc5cc61c430b08249babe64a8737d198f48b24ad98 SHA512 fcbf84aeb38c15657663bebf3f5a07175d477e54a450fee3316bb6fecb8bbb1faa421c81aa2831d43a5751a9463fce7a4530501ccb1da755f8eaa639bd3f6386 WHIRLPOOL ebbb5b4294a45c170862c70a98e043f47b14a2d464ef0740396005387528aeb463e68904c34454fd76b761c1dc033c5fd3f2a51c2c11388fbd61ff122199c4d6
+MISC metadata.xml 819 SHA256 27842866d9a6cea1f7c25ab9b498ae6c7db741fb22536e88773560cb530eec4a SHA512 9b6bdef19e94d5edd29301e79fd64f838f796baff373ae4a988e4428484561fc38a7d85c2dd7475b751655c8c6c974682d79e97f1ce1260222eb5a550db09b6f WHIRLPOOL 4a53cb31a20359ba60b1883c684f8966a9f868c3a00c6d803e6a40952b9ad014d10ad0efbe4d44a33ceeb2e761acc74b46abc1820f29d3870eca5bc82d07e6fb
diff --git a/app-admin/diamond/diamond-4.0-r1.ebuild b/app-admin/diamond/diamond-4.0-r1.ebuild
new file mode 100644
index 000000000000..90c4c2549e94
--- /dev/null
+++ b/app-admin/diamond/diamond-4.0-r1.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+if [[ ${PV} = 9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/python-diamond/Diamond.git"
+ S=${WORKDIR}/diamond-${PV}
+else
+ SRC_URI="https://github.com/python-diamond/Diamond/archive/v${PV}.tar.gz -> python-diamond-${PV}.tar.gz"
+ KEYWORDS="amd64 x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+ S=${WORKDIR}/Diamond-${PV}
+fi
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1 eutils prefix
+
+DESCRIPTION="Python daemon that collects and publishes system metrics"
+HOMEPAGE="https://github.com/python-diamond/Diamond"
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="test mongo mysql snmp redis"
+
+RDEPEND="dev-python/configobj
+ dev-python/setproctitle
+ mongo? ( dev-python/pymongo )
+ mysql? ( dev-python/mysql-python )
+ snmp? ( dev-python/pysnmp )
+ redis? ( dev-python/redis-py )
+ !kernel_linux? ( >=dev-python/psutil-3 )"
+DEPEND="${RDEPEND}
+ test? ( dev-python/mock )"
+
+src_prepare() {
+ # adjust for Prefix
+ hprefixify bin/diamond*
+
+ # fix necessary to make handlers honour their config, simple sed
+ # doing the same as upstream
+ # https://github.com/python-diamond/Diamond/commit/3cb29eedd117d2e4146823a5c5811d16cc77206a.patch
+ sed -i \
+ -e '/cls_name =/s/\.__class__//' \
+ src/diamond/utils/classes.py \
+ || die
+
+ epatch "${FILESDIR}"/${P}-psutil.patch
+
+ distutils-r1_src_prepare
+}
+
+python_test() {
+ "${PYTHON}" ./test.py || die "Tests fail with ${PYTHON}"
+}
+
+python_install() {
+ export VIRTUAL_ENV=1
+ distutils-r1_python_install
+ mv "${ED}"/usr/etc "${ED}"/ || die
+ rm "${ED}"/etc/diamond/*.windows # won't need these
+ sed -i \
+ -e '/pid_file =/s:/var/run:/run:' \
+ "${ED}"/etc/diamond/diamond.conf.example || die
+ hprefixify "${ED}"/etc/diamond/diamond.conf.example
+}
+
+src_install() {
+ distutils-r1_src_install
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+ keepdir /var/log/diamond
+}
diff --git a/app-admin/diamond/diamond-4.0.515.ebuild b/app-admin/diamond/diamond-4.0.515.ebuild
new file mode 100644
index 000000000000..a10298e45b41
--- /dev/null
+++ b/app-admin/diamond/diamond-4.0.515.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+if [[ ${PV} = 9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/python-diamond/Diamond.git"
+ S=${WORKDIR}/diamond-${PV}
+else
+ SRC_URI="https://github.com/python-diamond/Diamond/archive/v${PV}.tar.gz -> python-diamond-${PV}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+ S=${WORKDIR}/Diamond-${PV}
+fi
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1 prefix
+
+DESCRIPTION="Python daemon that collects and publishes system metrics"
+HOMEPAGE="https://github.com/python-diamond/Diamond"
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="test mongo mysql snmp redis"
+
+RDEPEND="dev-python/configobj
+ dev-python/setproctitle
+ mongo? ( dev-python/pymongo )
+ mysql? ( dev-python/mysql-python )
+ snmp? ( dev-python/pysnmp )
+ redis? ( dev-python/redis-py )
+ !kernel_linux? ( >=dev-python/psutil-3 )"
+DEPEND="${RDEPEND}
+ test? ( dev-python/mock )"
+
+src_prepare() {
+ # adjust for Prefix
+ hprefixify bin/diamond*
+
+ # fix the version (not set in GitHub archive)
+ sed -i -e "s/__VERSIONTOKENHERE__/${PV}/" src/diamond/version.py.tmpl || die
+ # fix symlink out of place
+ rm README.md || die
+ cp docs/index.md README.md || die
+
+ distutils-r1_src_prepare
+}
+
+python_test() {
+ "${PYTHON}" ./test.py || die "Tests fail with ${PYTHON}"
+}
+
+python_install() {
+ export VIRTUAL_ENV=1
+ distutils-r1_python_install
+ mv "${ED}"/usr/etc "${ED}"/ || die
+ rm "${ED}"/etc/diamond/*.windows # won't need these
+ sed -i \
+ -e '/pid_file =/s:/var/run:/run:' \
+ "${ED}"/etc/diamond/diamond.conf.example || die
+ hprefixify "${ED}"/etc/diamond/diamond.conf.example
+}
+
+src_install() {
+ distutils-r1_src_install
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+ keepdir /var/log/diamond
+}
diff --git a/app-admin/diamond/diamond-9999.ebuild b/app-admin/diamond/diamond-9999.ebuild
new file mode 100644
index 000000000000..c37ee683c298
--- /dev/null
+++ b/app-admin/diamond/diamond-9999.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+if [[ ${PV} = 9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/python-diamond/Diamond.git"
+ S=${WORKDIR}/diamond-${PV}
+else
+ SRC_URI="https://github.com/python-diamond/Diamond/archive/v${PV}.tar.gz -> python-diamond-${PV}.tar.gz"
+ KEYWORDS="~amd64 ~x86 ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+ S=${WORKDIR}/Diamond-${PV}
+fi
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1 prefix
+
+DESCRIPTION="Python daemon that collects and publishes system metrics"
+HOMEPAGE="https://github.com/python-diamond/Diamond"
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="test mongo mysql snmp redis"
+
+RDEPEND="dev-python/configobj
+ dev-python/setproctitle
+ mongo? ( dev-python/pymongo )
+ mysql? ( dev-python/mysql-python )
+ snmp? ( dev-python/pysnmp )
+ redis? ( dev-python/redis-py )
+ !kernel_linux? ( >=dev-python/psutil-3 )"
+DEPEND="${RDEPEND}
+ test? ( dev-python/mock )"
+
+src_prepare() {
+ # adjust for Prefix
+ hprefixify bin/diamond*
+
+ distutils-r1_src_prepare
+}
+
+python_test() {
+ "${PYTHON}" ./test.py || die "Tests fail with ${PYTHON}"
+}
+
+python_install() {
+ export VIRTUAL_ENV=1
+ distutils-r1_python_install
+ mv "${ED}"/usr/etc "${ED}"/ || die
+ rm "${ED}"/etc/diamond/*.windows # won't need these
+ sed -i \
+ -e '/pid_file =/s:/var/run:/run:' \
+ "${ED}"/etc/diamond/diamond.conf.example || die
+ hprefixify "${ED}"/etc/diamond/diamond.conf.example
+}
+
+src_install() {
+ distutils-r1_src_install
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+ keepdir /var/log/diamond
+}
diff --git a/app-admin/diamond/files/diamond-4.0-psutil.patch b/app-admin/diamond/files/diamond-4.0-psutil.patch
new file mode 100644
index 000000000000..e5f5d3bfb392
--- /dev/null
+++ b/app-admin/diamond/files/diamond-4.0-psutil.patch
@@ -0,0 +1,48 @@
+From 21ca284ffe6901b06e1136ce57dc07e0effd2a3e Mon Sep 17 00:00:00 2001
+From: Fabian Groffen <grobian@gentoo.org>
+Date: Mon, 3 Aug 2015 19:40:59 +0200
+Subject: [PATCH 1/2] NetworkCollector: psutil.network_io_counters was renamed
+
+---
+ src/collectors/network/network.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/collectors/network/network.py b/src/collectors/network/network.py
+index d835162..90c2f59 100644
+--- a/src/collectors/network/network.py
++++ b/src/collectors/network/network.py
+@@ -96,7 +96,7 @@ def collect(self):
+ self.log.error('No network metrics retrieved')
+ return None
+
+- network_stats = psutil.network_io_counters(True)
++ network_stats = psutil.net_io_counters(True)
+ for device in network_stats.keys():
+ network_stat = network_stats[device]
+ results[device] = {}
+
+From 314d6057ca95bae6d3e6369556522574eb905c3f Mon Sep 17 00:00:00 2001
+From: Fabian Groffen <grobian@gentoo.org>
+Date: Mon, 3 Aug 2015 19:41:20 +0200
+Subject: [PATCH 2/2] MemoryCollector: psutil renamed phymem_usage and
+ virtmem_usage
+
+---
+ src/collectors/memory/memory.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/collectors/memory/memory.py b/src/collectors/memory/memory.py
+index 7c9b1fb..9057115 100644
+--- a/src/collectors/memory/memory.py
++++ b/src/collectors/memory/memory.py
+@@ -103,8 +103,8 @@ def collect(self):
+ self.log.error('No memory metrics retrieved')
+ return None
+
+- phymem_usage = psutil.phymem_usage()
+- virtmem_usage = psutil.virtmem_usage()
++ phymem_usage = psutil.virtual_memory()
++ virtmem_usage = psutil.swap_memory()
+ units = 'B'
+
+ for unit in self.config['byte_unit']:
diff --git a/app-admin/diamond/files/diamond.confd b/app-admin/diamond/files/diamond.confd
new file mode 100644
index 000000000000..ad9939223182
--- /dev/null
+++ b/app-admin/diamond/files/diamond.confd
@@ -0,0 +1,2 @@
+# command line options for running diamond
+DIAMOND_OPTS=
diff --git a/app-admin/diamond/files/diamond.initd b/app-admin/diamond/files/diamond.initd
new file mode 100644
index 000000000000..168b175a788c
--- /dev/null
+++ b/app-admin/diamond/files/diamond.initd
@@ -0,0 +1,19 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --exec /usr/bin/diamond --pidfile /run/${SVCNAME}.pid -- -c /etc/diamond/${SVCNAME}.conf ${DIAMOND_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop -R 80 --pidfile /run/${SVCNAME}.pid
+ eend $?
+}
diff --git a/app-admin/diamond/metadata.xml b/app-admin/diamond/metadata.xml
new file mode 100644
index 000000000000..835af2947917
--- /dev/null
+++ b/app-admin/diamond/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>grobian@gentoo.org</email>
+ <name>Fabian Groffen</name>
+ </maintainer>
+ <longdescription lang="en">
+ Diamond is a python daemon that collects system metrics and
+ publishes them to Graphite (and others). It is capable of
+ collecting cpu, memory, network, i/o, load and disk metrics.
+ Additionally, it features an API for implementing custom
+ collectors for gathering metrics from almost any source.
+ </longdescription>
+ <use>
+ <flag name="mongo">Enable MongoDB support</flag>
+ <flag name="redis">Enable Redis support</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">python-diamond/Diamond</remote-id>
+ </upstream>
+</pkgmetadata>