aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2012-03-21 14:41:41 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2012-03-21 13:48:09 +0000
commit36d09d5b6774ec30ffb5f996fd849cf42bcf7012 (patch)
tree492a49dfcdb02c48e1299f8fcbf9db869fc47658
parentddba36b95362ceac759500d05d236339697fe4b8 (diff)
downloadalpine_aports-36d09d5b6774ec30ffb5f996fd849cf42bcf7012.tar.bz2
alpine_aports-36d09d5b6774ec30ffb5f996fd849cf42bcf7012.tar.xz
alpine_aports-36d09d5b6774ec30ffb5f996fd849cf42bcf7012.zip
testing/rrdcollect: Version bump. Init.d scripts. Patching default rrdcollect.conf to work with alpine linux
-rw-r--r--testing/rrdcollect/APKBUILD35
-rw-r--r--testing/rrdcollect/rrdcollect.conf.patch46
-rw-r--r--testing/rrdcollect/rrdcollect.confd3
-rwxr-xr-xtesting/rrdcollect/rrdcollect.initd27
4 files changed, 105 insertions, 6 deletions
diff --git a/testing/rrdcollect/APKBUILD b/testing/rrdcollect/APKBUILD
index 36e55972bd..688ccdd374 100644
--- a/testing/rrdcollect/APKBUILD
+++ b/testing/rrdcollect/APKBUILD
@@ -1,7 +1,7 @@
1# Contributor: Michael Mason <ms13sp@gmail.com> 1# Contributor: Michael Mason <ms13sp@gmail.com>
2# Maintainer: Michael Mason <ms13sp@gmail.com> 2# Maintainer: Michael Mason <ms13sp@gmail.com>
3pkgname=rrdcollect 3pkgname=rrdcollect
4pkgver=0.2.4 4pkgver=0.2.9
5pkgrel=1 5pkgrel=1
6pkgdesc="Read system statistical data and feed it to RRDtool" 6pkgdesc="Read system statistical data and feed it to RRDtool"
7url="http://rrdcollect.sourceforge.net/" 7url="http://rrdcollect.sourceforge.net/"
@@ -11,22 +11,45 @@ depends="rrdtool"
11makedepends="libpcap-dev" 11makedepends="libpcap-dev"
12install= 12install=
13subpackages="$pkgname-doc" 13subpackages="$pkgname-doc"
14source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz" 14source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz
15rrdcollect.conf.patch
16rrdcollect.confd
17rrdcollect.initd"
18
19_builddir="$srcdir/$pkgname-$pkgver"
20prepare() {
21 cd "$_builddir"
22 for i in $source; do
23 case $i in
24 *.patch)
25 msg "Applying $i"
26 patch -p1 -i "$srcdir"/$i || return 1
27 ;;
28 esac;
29 done
30}
15 31
16build() { 32build() {
17 cd "$srcdir/$pkgname-$pkgver" 33 cd "$_builddir"
18 34
19 ./configure --prefix=/usr \ 35 ./configure --prefix=/usr \
20 --sysconfdir=/etc \ 36 --localstatedir=/var \
37 --sysconfdir=/etc/rrdcollect \
21 --mandir=/usr/share/man \ 38 --mandir=/usr/share/man \
22 --infodir=/usr/share/info 39 --infodir=/usr/share/info
23 make || return 1 40 make || return 1
24} 41}
25 42
26package() { 43package() {
27 cd "$srcdir/$pkgname-$pkgver" 44 cd "$_builddir"
28 make DESTDIR="$pkgdir" install 45 make DESTDIR="$pkgdir" install
29 46
47 install -m755 -D "$srcdir"/rrdcollect.initd "$pkgdir"/etc/init.d/rrdcollect || return 1
48 install -m644 -D "$srcdir"/rrdcollect.confd "$pkgdir"/etc/conf.d/rrdcollect || return 1
49 install -m755 -d "$pkgdir"/var/lib/rrdtool || return 1
30} 50}
31 51
32md5sums="fd7ac95195e3e5cbab0677629505d9be rrdcollect-0.2.4.tar.gz" 52md5sums="1e94eb0f8d55ebf0f042c10baebc2d3d rrdcollect-0.2.9.tar.gz
53e09d7a588e31c9ecfc44fd1747ad732b rrdcollect.conf.patch
54b3f64ec3e4578fb4de9614c20c6ea232 rrdcollect.confd
55edef974fb5a27279f9347d9eacda4a26 rrdcollect.initd"
diff --git a/testing/rrdcollect/rrdcollect.conf.patch b/testing/rrdcollect/rrdcollect.conf.patch
new file mode 100644
index 0000000000..9b1d7b3558
--- /dev/null
+++ b/testing/rrdcollect/rrdcollect.conf.patch
@@ -0,0 +1,46 @@
1--- rrdcollect-0.2.9.org/doc/sample-rrdcollect.conf
2+++ rrdcollect-0.2.9/doc/sample-rrdcollect.conf
3@@ -4,12 +4,12 @@
4 # Configuration values:
5
6 #step = 60
7-#directory = /var/lib/rrdtool
8+directory = /var/lib/rrdtool
9 #loglevel = LOG_NOTICE
10
11 # System statistics:
12 file:///proc/stat
13-"cpu %d %d %d %d" stat.rrd:cpu_user,cpu_nice,cpu_system,cpu_idle
14+"cpu %d %d %d %d %d %d %d" stat.rrd:cpu_user,cpu_nice,cpu_system,cpu_idle,cpu_iowait,cpu_irq,cpu_softirq
15 "ctxt %u" stat.rrd:ctxt
16 "page %u %u" stat.rrd:page_in,page_out
17 "processes %u" stat.rrd:processes
18@@ -21,15 +21,15 @@
19 "Swap: %*d %d %*d" memory.rrd:swap_used
20
21 # S.M.A.R.T. HDD temperature:
22-file:///proc/ide/hda/smart_values
23-7:"%*04x %*04x %02x%*02x" temperature.rrd:hda
24-file:///proc/ide/hdb/smart_values
25-7:"%*04x %*04x %02x%*02x" temperature.rrd:hdb
26+#file:///proc/ide/hda/smart_values
27+#7:"%*04x %*04x %02x%*02x" temperature.rrd:hda
28+#file:///proc/ide/hdb/smart_values
29+#7:"%*04x %*04x %02x%*02x" temperature.rrd:hdb
30
31 # Net: statistics
32 file:///proc/net/dev
33 " eth0: %d %d %*d %*d %*d %*d %*d %*d %d %d" eth0.rrd:bytes_in,pkts_in,bytes_out,pkts_out
34-" eth1: %d %d %*d %*d %*d %*d %*d %*d %d %d" eth1.rrd:bytes_in,pkts_in,bytes_out,pkts_out
35+#" eth1: %d %d %*d %*d %*d %*d %*d %*d %d %d" eth1.rrd:bytes_in,pkts_in,bytes_out,pkts_out
36
37 # NEW!
38 # exec:/// -- instead of reading from /proc/ file data is read from
39@@ -40,5 +40,5 @@
40 #
41 # To use it, you must compile with --enable-exec
42 # Remember, programs run with root permissions. Use at your own risk.
43-exec:///bin/df
44-"/dev/hda1 %*d %d %d" hda1.rrd:used,empty
45+#exec:///bin/df
46+#"/dev/sda1 %*d %d %d" sda1.rrd:used,empty
diff --git a/testing/rrdcollect/rrdcollect.confd b/testing/rrdcollect/rrdcollect.confd
new file mode 100644
index 0000000000..eb7e4fa828
--- /dev/null
+++ b/testing/rrdcollect/rrdcollect.confd
@@ -0,0 +1,3 @@
1# rrdcollect params suitable for running as a daemon
2
3RRD_OPTS=""
diff --git a/testing/rrdcollect/rrdcollect.initd b/testing/rrdcollect/rrdcollect.initd
new file mode 100755
index 0000000000..da566116e1
--- /dev/null
+++ b/testing/rrdcollect/rrdcollect.initd
@@ -0,0 +1,27 @@
1#!/sbin/runscript
2
3description="rrdcollect daemon"
4pidfile="/var/run/${RC_SVCNAME}.pid"
5command="/usr/sbin/rrdcollect"
6runas="root"
7
8start_pre() {
9 checkpath --directory --owner ${runas}:${runas} --mode 775 ${pidfile%/*}
10}
11
12start() {
13 ebegin "Starting ${RC_SVCNAME}"
14 start-stop-daemon --start \
15 --user ${runas} \
16 --pidfile ${pidfile} \
17 --exec ${command} \
18 -- ${RRD_OPTS}
19 eend $?
20}
21
22stop() {
23 ebegin "Stopping ${RC_SVCNAME}"
24 start-stop-daemon --stop \
25 --pidfile ${pidfile}
26 eend $?
27}