summaryrefslogtreecommitdiffstats
path: root/abs/extra/rrd_stats
diff options
context:
space:
mode:
authorCecil Hugh Watson <knoppmyth@gmail.com>2009-09-26 01:57:08 (GMT)
committerCecil Hugh Watson <knoppmyth@gmail.com>2009-09-26 01:57:08 (GMT)
commit7b29169fff9e7c624890c5edffe85def8a293136 (patch)
tree47753889faa3a2063b66d1c7e7681e703eb1b39a /abs/extra/rrd_stats
parentc491dea779dac29afff3578bf8245943817c2339 (diff)
downloadlinhes_pkgbuild-7b29169fff9e7c624890c5edffe85def8a293136.zip
linhes_pkgbuild-7b29169fff9e7c624890c5edffe85def8a293136.tar.gz
linhes_pkgbuild-7b29169fff9e7c624890c5edffe85def8a293136.tar.bz2
LinHES 6.01.00
Diffstat (limited to 'abs/extra/rrd_stats')
-rw-r--r--abs/extra/rrd_stats/PKGBUILD20
-rw-r--r--abs/extra/rrd_stats/rrd_stats.install34
-rw-r--r--abs/extra/rrd_stats/rrd_stats.tgzbin0 -> 7454 bytes
-rw-r--r--abs/extra/rrd_stats/run_rrd.sh8
4 files changed, 62 insertions, 0 deletions
diff --git a/abs/extra/rrd_stats/PKGBUILD b/abs/extra/rrd_stats/PKGBUILD
new file mode 100644
index 0000000..40f0536
--- /dev/null
+++ b/abs/extra/rrd_stats/PKGBUILD
@@ -0,0 +1,20 @@
+pkgname=rrd_stats
+pkgver=1
+pkgrel=16
+pkgdesc="graph system stats"
+arch=('i686' 'x86_64')
+url=""
+license=('GPL')
+source=(rrd_stats.tgz)
+depends=('hddtemp' 'sysstat' 'xmbmon' 'rrdtool' 'perl' 'local-website')
+backup=('etc/rrdsettings.cfg' 'data/srv/httpd/htdocs/index-rrd.html')
+install=rrd_stats.install
+build() {
+ cd $startdir/src/$pkgname
+ cp -a * $startdir/pkg
+ mkdir -p $startdir/pkg/var/lib/rrd
+ echo "RRD files are used by rrd_stats" > $startdir/pkg/var/lib/rrd/README
+ mv $startdir/pkg/data/srv/httpd/htdocs/rrd/index.html $startdir/pkg/data/srv/httpd/htdocs/rrd/index-rrd.html
+ chown -R http:users $startdir/pkg/data/srv/httpd
+ chmod -R 755 $startdir/pkg/data/srv/httpd
+}
diff --git a/abs/extra/rrd_stats/rrd_stats.install b/abs/extra/rrd_stats/rrd_stats.install
new file mode 100644
index 0000000..126e4f0
--- /dev/null
+++ b/abs/extra/rrd_stats/rrd_stats.install
@@ -0,0 +1,34 @@
+post_install() {
+ PFIX="/data/srv/httpd/htdocs/rrd"
+ if [ ! -e $PFIX/index.html.orig ]
+ then
+ mv $PFIX/index.html $PFIX/index.html.orig
+ ln -s $PFIX/index-rrd.html $PFIX/index.html
+ fi
+
+ ct=`crontab -l`
+ echo $ct | grep -q run_rrd.sh
+ if [ $? != 0 ]
+ then
+ line="*/5 * * * * /usr/bin/run_rrd.sh > /dev/null"
+ (crontab -l; echo "$line") | crontab -
+ fi
+
+
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+
+pre_remove() {
+ crontab -l | grep -v run_rrd | crontab -
+ PFIX="/data/srv/httpd/htdocs/rrd"
+ if [ -e $PFIX/index.html.orig ]
+ then
+ rm $PFIX/index.html
+ mv $PFIX/index.html.orig $PFIX/index.html
+ fi
+
+}
diff --git a/abs/extra/rrd_stats/rrd_stats.tgz b/abs/extra/rrd_stats/rrd_stats.tgz
new file mode 100644
index 0000000..c141ffa
--- /dev/null
+++ b/abs/extra/rrd_stats/rrd_stats.tgz
Binary files differ
diff --git a/abs/extra/rrd_stats/run_rrd.sh b/abs/extra/rrd_stats/run_rrd.sh
new file mode 100644
index 0000000..19150a4
--- /dev/null
+++ b/abs/extra/rrd_stats/run_rrd.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+RRD='hddtemp disk traffic mem cpu usage ups'
+DIR='/usr/bin'
+#
+for x in $RRD
+do
+ $DIR/rrd_${x}.pl >& /dev/null
+done