diff options
Diffstat (limited to 'openwrt/package/rrdcollect')
-rw-r--r-- | openwrt/package/rrdcollect/Config.in | 14 | ||||
-rw-r--r-- | openwrt/package/rrdcollect/Makefile | 76 | ||||
-rw-r--r-- | openwrt/package/rrdcollect/files/rrdcollect.conf | 33 | ||||
-rw-r--r-- | openwrt/package/rrdcollect/files/rrdcollect.init | 24 | ||||
-rw-r--r-- | openwrt/package/rrdcollect/ipkg/rrdcollect.conffiles | 1 | ||||
-rw-r--r-- | openwrt/package/rrdcollect/ipkg/rrdcollect.control | 12 |
6 files changed, 160 insertions, 0 deletions
diff --git a/openwrt/package/rrdcollect/Config.in b/openwrt/package/rrdcollect/Config.in new file mode 100644 index 000000000..39369914c --- /dev/null +++ b/openwrt/package/rrdcollect/Config.in @@ -0,0 +1,14 @@ +config BR2_PACKAGE_RRDCOLLECT + tristate "rrdcollect - Round-Robin Database Collecting Daemon" + default m if CONFIG_DEVEL + select BR2_PACKAGE_LIBRRD + help + RRDcollect is a daemon which polls ceratin files in /proc/ + directory, gathering data and storing it inside RRDtool's + database files. Being written in C should be both fast + and resources-friendly. Supports both scanf(3)-style + pattern matches and perl compatible regular expressions. + + http://rrdcollect.sourceforge.net/ + + diff --git a/openwrt/package/rrdcollect/Makefile b/openwrt/package/rrdcollect/Makefile new file mode 100644 index 000000000..4bf899b51 --- /dev/null +++ b/openwrt/package/rrdcollect/Makefile @@ -0,0 +1,76 @@ +# $Id$ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=rrdcollect +PKG_VERSION:=0.2.3 +PKG_RELEASE:=1 +PKG_MD5SUM:=5e4305c612bc3cccbaf802c275c81a11 + +PKG_SOURCE_URL:=@SF/rrdcollect +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_CAT:=zcat + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install + +include $(TOPDIR)/package/rules.mk + +$(eval $(call PKG_template,RRDCOLLECT,rrdcollect,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) + +$(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared + (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS) -DSOCKET_COMM" \ + CPPFLAGS="-I$(STAGING_DIR)/usr/include" \ + LDFLAGS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \ + LIBS="-lart_lgpl_2 -lfreetype -lpng -lz" \ + PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig" \ + ac_cv_func_malloc_0_nonnull=yes \ + ./configure \ + --target=$(GNU_TARGET_NAME) \ + --host=$(GNU_TARGET_NAME) \ + --build=$(GNU_HOST_NAME) \ + --program-prefix="" \ + --program-suffix="" \ + --prefix=/usr \ + --exec-prefix=/usr \ + --bindir=/usr/bin \ + --sbindir=/usr/sbin \ + --libexecdir=/usr/lib \ + --sysconfdir=/etc \ + --datadir=/usr/share \ + --localstatedir=/var \ + --mandir=/usr/man \ + --infodir=/usr/info \ + $(DISABLE_NLS) \ + $(DISABLE_LARGEFILE) \ + --enable-shared \ + --disable-static \ + --enable-exec \ + --without-rrdtool \ + --with-librrd \ + --without-libpcre \ + --without-libpcap \ + ); + touch $@ + +$(PKG_BUILD_DIR)/.built: + rm -rf $(PKG_INSTALL_DIR) + mkdir -p $(PKG_INSTALL_DIR) + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install + touch $@ + +$(IPKG_RRDCOLLECT): + install -d -m0755 $(IDIR_RRDCOLLECT)/etc + install -m0644 ./files/rrdcollect.conf $(IDIR_RRDCOLLECT)/etc + install -d -m0755 $(IDIR_RRDCOLLECT)/etc/init.d + install -m0755 ./files/rrdcollect.init $(IDIR_RRDCOLLECT)/etc/init.d/rrdcollect + ln -sf rrdcollect $(IDIR_RRDCOLLECT)/etc/init.d/S98rrdcollect + install -d -m0755 $(IDIR_RRDCOLLECT)/usr/sbin + cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/rrdcollect $(IDIR_RRDCOLLECT)/usr/sbin/ + $(RSTRIP) $(IDIR_RRDCOLLECT) + $(IPKG_BUILD) $(IDIR_RRDCOLLECT) $(PACKAGE_DIR) + diff --git a/openwrt/package/rrdcollect/files/rrdcollect.conf b/openwrt/package/rrdcollect/files/rrdcollect.conf new file mode 100644 index 000000000..dfeb7b3bf --- /dev/null +++ b/openwrt/package/rrdcollect/files/rrdcollect.conf @@ -0,0 +1,33 @@ +step = 360 +directory = /var/lib/rra + +file:///proc/stat +"cpu0 %d %d %d %d" SYS.rrd:cu,cn,cs,ci +"ctxt %u" SYS.rrd:ct +"processes %u" SYS.rrd:fk +"intr %u" SYS.rrd:ira + +file:///proc/meminfo +#"Mem: %*d %d %d %d %d %d" SYS.rrd:mu,mf,ms,mb,mc +"Mem: %*d %d %d %*d %d %d" SYS.rrd:mu,mf,mb,mc + +file:///proc/loadavg +"%f %f %f %d/%d %*d" SYS.rrd:l1,l2,l3,pr,pt + +exec:///bin/df +"/dev/mtdblock/4 %*d %d %d" SYS.rrd:us,av + +# LAN: vlan0, WAN: vlan1, WIFI: eth1 +file:///proc/net/dev +" vlan0: %d %d %*d %*d %*d %*d %*d %*d %d %d" IF.rrd:Labi,Lapi,Labo,Lapo +" vlan1: %d %d %*d %*d %*d %*d %*d %*d %d %d" IF.rrd:Wabi,Wapi,Wabo,Wapo +" eth1: %d %d %*d %*d %*d %*d %*d %*d %d %d" IF.rrd:Wibi,Wipi,Wibo,Wipo +#" tun0: %d %d %*d %*d %*d %*d %*d %*d %d %d" IF.rrd:tbi,tpi,tbo,tpo + +file:///proc/slabinfo +"ip_conntrack %d %*d %*d %*d %*d %*d" SYS.rrd:con +"arp_cache %d %*d %*d %*d %*d %*d" SYS.rrd:arp + +file:///proc/interrupts +" 4: %d MIPS eth1" SYS.rrd:irw +" 5: %d MIPS eth0" SYS.rrd:ire diff --git a/openwrt/package/rrdcollect/files/rrdcollect.init b/openwrt/package/rrdcollect/files/rrdcollect.init new file mode 100644 index 000000000..dafb4624e --- /dev/null +++ b/openwrt/package/rrdcollect/files/rrdcollect.init @@ -0,0 +1,24 @@ +#!/bin/sh + +BIN=rrdcollect +DEFAULT=/etc/default/$BIN +RUN_D=/var/run +RRA_D=/var/lib/rra +PID_F=$RUN_D/$BIN.pid +[ -f $DEFAULT ] && . $DEFAULT + +case $1 in + start) + mkdir -p $RUN_D + mkdir -p $RRA_D + $BIN $OPTIONS + ;; + stop) + [ -f $PID_F ] && kill $(cat $PID_F) + ;; + *) + echo "usage: $0 (start|stop)" + exit 1 +esac + +exit $? diff --git a/openwrt/package/rrdcollect/ipkg/rrdcollect.conffiles b/openwrt/package/rrdcollect/ipkg/rrdcollect.conffiles new file mode 100644 index 000000000..991cfd27d --- /dev/null +++ b/openwrt/package/rrdcollect/ipkg/rrdcollect.conffiles @@ -0,0 +1 @@ +/etc/rrdcollect.conf diff --git a/openwrt/package/rrdcollect/ipkg/rrdcollect.control b/openwrt/package/rrdcollect/ipkg/rrdcollect.control new file mode 100644 index 000000000..75eb97705 --- /dev/null +++ b/openwrt/package/rrdcollect/ipkg/rrdcollect.control @@ -0,0 +1,12 @@ +Package: rrdcollect +Priority: optional +Section: admin +Maintainer: Oliver Ertl <oliver@ertl-net.net>, OpenWrt Developers <bugs@openwrt.org> +Source: http://openwrt.org/cgi-bin/viewcvs.cgi/openwrt/package/rrdcollect/ +Depends: librrd +Description: Round-Robin Database Collecting Daemon + RRDcollect is a daemon which polls ceratin files in /proc/ + directory, gathering data and storing it inside RRDtool's + database files. Being written in C should be both fast + and resources-friendly. Supports both scanf(3)-style + pattern matches and perl compatible regular expressions. |