add rrdcollect package
authorNicolas Thill <nico@openwrt.org>
Sun, 14 Aug 2005 02:57:28 +0000 (02:57 +0000)
committerNicolas Thill <nico@openwrt.org>
Sun, 14 Aug 2005 02:57:28 +0000 (02:57 +0000)
SVN-Revision: 1653

openwrt/package/Config.in
openwrt/package/Makefile
openwrt/package/rrdcollect/Config.in [new file with mode: 0644]
openwrt/package/rrdcollect/Makefile [new file with mode: 0644]
openwrt/package/rrdcollect/files/rrdcollect.conf [new file with mode: 0644]
openwrt/package/rrdcollect/files/rrdcollect.init [new file with mode: 0644]
openwrt/package/rrdcollect/ipkg/rrdcollect.conffiles [new file with mode: 0644]
openwrt/package/rrdcollect/ipkg/rrdcollect.control [new file with mode: 0644]

index 5482c23f3c95174087e16e3d8d1a82f4cfdece7c..b0e7cd3e5efaec9614e5ecb84f96d6be6db1f6f9 100644 (file)
@@ -24,6 +24,7 @@ source "package/sablevm/Config.in"
 source "package/sablevm-classpath/Config.in"
 source "package/libffi-sable/Config.in"
 endmenu
+source "package/rrdcollect/Config.in"
 source "package/rrdtool/Config.in"
 source "package/screen/Config.in"
 
index def03c4ac3c7270ad4b85d55234190071ef21b75..86d110319d03ce4666ffc3cf2eab33bc358f7fff 100644 (file)
@@ -117,6 +117,7 @@ package-$(BR2_PACKAGE_RADVD) += radvd
 package-$(BR2_PACKAGE_READLINE) += readline
 package-$(BR2_PACKAGE_ROBOCFG) += robocfg
 package-$(BR2_PACKAGE_RP_PPPOE) += rp-pppoe
+package-$(BR2_COMPILE_RRDCOLLECT) += rrdcollect
 package-$(BR2_COMPILE_RRDTOOL) += rrdtool
 package-$(BR2_PACKAGE_RSYNC) += rsync
 package-$(BR2_PACKAGE_SABLEVM) += sablevm
@@ -201,6 +202,7 @@ osiris-compile: openssl-compile
 portmap-compile: tcp_wrappers-compile
 postgresql-compile: zlib-compile
 quagga-compile: readline-compile ncurses-compile
+rrdcollect-compile: rrdtool-compile
 rrdtool-compile: cgilib-compile freetype-compile libart-compile libpng-compile
 rsync-compile: popt-compile
 screen-compile: ncurses-compile
diff --git a/openwrt/package/rrdcollect/Config.in b/openwrt/package/rrdcollect/Config.in
new file mode 100644 (file)
index 0000000..3936991
--- /dev/null
@@ -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 (file)
index 0000000..4bf899b
--- /dev/null
@@ -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 (file)
index 0000000..dfeb7b3
--- /dev/null
@@ -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 (file)
index 0000000..dafb462
--- /dev/null
@@ -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 (file)
index 0000000..991cfd2
--- /dev/null
@@ -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 (file)
index 0000000..75eb977
--- /dev/null
@@ -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.