From d58201b8d55b657a270a7c05da6679b22ea598d7 Mon Sep 17 00:00:00 2001 From: olli Date: Sun, 15 Jul 2007 19:43:45 +0000 Subject: [PATCH] collected: (#2010) * Add restart() function to the init script * Add a config file * Cleanup Makefile * Update: 3.5.1 > 3.11.5 git-svn-id: svn://svn.openwrt.org/openwrt/packages@7980 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- utils/collectd/Makefile | 82 +++++++++++++++++++----------- utils/collectd/files/collectd.conf | 54 ++++++++++++++++++++ utils/collectd/files/collectd.init | 4 ++ 3 files changed, 109 insertions(+), 31 deletions(-) create mode 100644 utils/collectd/files/collectd.conf diff --git a/utils/collectd/Makefile b/utils/collectd/Makefile index 507b2f1e9..1d530b1df 100644 --- a/utils/collectd/Makefile +++ b/utils/collectd/Makefile @@ -9,13 +9,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=collectd -PKG_VERSION:=3.5.1 -PKG_RELEASE:=1 +PKG_VERSION:=3.11.5 +PKG_RELEASE:=2 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://verplant.org/collectd/files -PKG_MD5SUM:=46a4b81e46d3bb58faab1d603649d737 -PKG_CAT:=zcat +PKG_MD5SUM:=7a3e47ccaed2eb1d03f91c82a1406e8d PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install @@ -25,42 +24,63 @@ include $(INCLUDE_DIR)/package.mk define Package/collectd SECTION:=utils CATEGORY:=Utilities + DEPENDS=+libgcc TITLE:=Lightweight system statistics collection daemon + DESCRIPTION:=\ + collectd is a small daemon which collects system information periodically \\\ + and provides mechanismns to store the values in a variety of ways. URL:=http://verplant.org/collectd/ endef -define Build/Compile - $(call Build/Configure/Default, \ - --disable-debug \ - --enable-cpu \ - --enable-load \ - --enable-memory \ - --enable-ping \ - --enable-traffic \ - --disable-cpufreq \ - --disable-disk \ - --disable-hddtemp \ - --disable-nfs \ - --disable-processes \ - --disable-sensors \ - --disable-serial \ - --disable-swap \ - --disable-tape \ - --disable-users \ - ) +define Package/collectd/conffiles +/etc/collectd.conf endef -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) \ - DESTDIR="$(PKG_INSTALL_DIR)" \ - all install -endef +CONFIGURE_ARGS += \ + --disable-debug \ + --enable-daemon \ + --enable-getifaddrs \ + --disable-apache \ + --disable-apcups \ + --disable-apple_sensors \ + --disable-battery \ + --enable-cpu \ + --disable-cpufreq \ + --enable-disk \ + --enable-df \ + --disable-dns \ + --disable-email \ + --disable-quota \ + --disable-hddtemp \ + --enable-load \ + --disable-mbmon \ + --enable-memory \ + --disable-multimeter \ + --disable-mysql \ + --disable-nfs \ + --disable-ntpd \ + --enable-ping \ + --enable-processes \ + --disable-sensors \ + --enable-serial \ + --disable-swap \ + --disable-tape \ + --enable-traffic \ + --disable-users \ + --disable-vserver \ + --enable-wireless + +MAKE_FLAGS += \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install define Package/collectd/install $(INSTALL_DIR) $(1)/usr/sbin - $(CP) $(PKG_INSTALL_DIR)/usr/sbin/collectd $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/collectd $(1)/usr/sbin/ $(INSTALL_DIR) $(1)/usr/lib/collectd - $(CP) $(PKG_INSTALL_DIR)/usr/lib/collectd/*.so $(1)/usr/lib/collectd/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/*.so $(1)/usr/lib/collectd/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) ./files/collectd.conf $(1)/etc/ $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/collectd.init $(1)/etc/init.d/collectd endef diff --git a/utils/collectd/files/collectd.conf b/utils/collectd/files/collectd.conf new file mode 100644 index 000000000..56bb3fc36 --- /dev/null +++ b/utils/collectd/files/collectd.conf @@ -0,0 +1,54 @@ +# +# collectd(1) config for OpenWrt. +# Please read collectd.conf(5) for a list of options. +# http://collectd.org/ +# + +# Select one of the following modes: +# In client mode the daemon collects the data locally and sends its results +# to one or more network addresses. This is the default mode. +Mode Client +# In the log mode, data is collected locally and written in +# text files that reside in DataDir. Be careful as it could fill +# the memory of your device with Datadir pointing to /tmp. +#Mode Log + +# Set the IP-address(es) and UDP-port(s) to send packets to. +# The port option is optional. +#Server ff18::efc0:4a42 25826 +#Server 239.192.74.66 25826 + +DataDir /var/lib/collectd +PIDFile /var/run/collectd.pid +PluginDir /usr/lib/collectd + +LoadPlugin cpu +LoadPlugin disk +LoadPlugin df +LoadPlugin load +LoadPlugin memory +#LoadPlugin ping +#LoadPlugin processes +#LoadPlugin serial +LoadPlugin traffic +LoadPlugin wireless + +# +# FSType tmpfs +# IgnoreSelected true +# + +# +# Host host.foo.bar +# + +# +# Process name +# + +# +# Interface lo +# Interface imq0 +# Interface wifi +# IgnoreSelected true +# diff --git a/utils/collectd/files/collectd.init b/utils/collectd/files/collectd.init index 34886f7a6..4ec4771be 100755 --- a/utils/collectd/files/collectd.init +++ b/utils/collectd/files/collectd.init @@ -23,3 +23,7 @@ start() { stop() { kill $(cat "$PIDFILE") 2>/dev/null } + +restart() { + start +}