[packages] collectd: update to v4.9.0 (#6390, #4704, #5936)

git-svn-id: svn://svn.openwrt.org/openwrt/packages@18890 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
jow 2009-12-22 13:52:52 +00:00
parent eaafb110a1
commit ed825742b3
4 changed files with 161 additions and 52 deletions

View File

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=collectd PKG_NAME:=collectd
PKG_VERSION:=4.4.4 PKG_VERSION:=4.9.0
PKG_RELEASE:=3 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://collectd.org/files/ PKG_SOURCE_URL:=http://collectd.org/files/
PKG_MD5SUM:=9e0e89150b1ff28fc0fdd8a198c9ac5e PKG_MD5SUM:=5b2e5f57716f2485a3b4eb57774a3818
PKG_FIXUP:=libtool PKG_FIXUP:=libtool
@ -21,39 +21,63 @@ COLLECTD_PLUGINS_DISABLED:= \
apple_sensors \ apple_sensors \
battery \ battery \
cpufreq \ cpufreq \
curl_json \
entropy \ entropy \
genericjmx \
gmond \
hddtemp \ hddtemp \
ipmi \ ipmi \
ipvs \ ipvs \
java \
libvirt \ libvirt \
mbmon \ mbmon \
memcachec \
memcached \ memcached \
monitorus \
multimeter \ multimeter \
netapp \
nfs \ nfs \
notify_desktop \
notify_email \
openvz \
oracle \
perl \ perl \
python \
routeros \
rrdcached \
serial \ serial \
swap \ swap \
tape \ tape \
tokyotyrant \
uuid \ uuid \
vserver \ vserver \
xmms \ xmms \
zfs_arc \
COLLECTD_PLUGINS_SELECTED:= \ COLLECTD_PLUGINS_SELECTED:= \
apache \ apache \
apcups \ apcups \
ascent \ ascent \
bind \
conntrack \
contextswitch \
cpu \ cpu \
csv \ csv \
curl \
dbi \
df \ df \
disk \ disk \
dns \ dns \
email \ email \
exec \ exec \
filecount \
fscache \
interface \ interface \
iptables \ iptables \
irq \ irq \
load \ load \
logfile \ logfile \
madwifi \
memory \ memory \
mysql \ mysql \
netlink \ netlink \
@ -61,20 +85,30 @@ COLLECTD_PLUGINS_SELECTED:= \
nginx \ nginx \
ntpd \ ntpd \
nut \ nut \
olsrd \
onewire \
openvpn \
ping \ ping \
postgresql \
powerdns \ powerdns \
processes \ processes \
protocols \
rrdtool \ rrdtool \
sensors \ sensors \
snmp \ snmp \
syslog \ syslog \
tail \ tail \
table \
ted \
tcpconns \ tcpconns \
teamspeak2 \ teamspeak2 \
thermal \
unixsock \ unixsock \
uptime \
users \ users \
vmem \ vmem \
wireless \ wireless \
write_http \
PKG_CONFIG_DEPENDS:= \ PKG_CONFIG_DEPENDS:= \
$(patsubst %,CONFIG_PACKAGE_collectd-mod-%,$(COLLECTD_PLUGINS_SELECTED)) \ $(patsubst %,CONFIG_PACKAGE_collectd-mod-%,$(COLLECTD_PLUGINS_SELECTED)) \
@ -133,9 +167,14 @@ ifneq ($(CONFIG_PACKAGE_collectd-mod-netlink),)
CONFIGURE_ARGS+= --with-libnetlink="$(STAGING_DIR)/usr" CONFIGURE_ARGS+= --with-libnetlink="$(STAGING_DIR)/usr"
endif endif
# exception: mod-onewire needs libow-capi
ifneq ($(CONFIG_PACKAGE_collectd-mod-onewire),)
CONFIGURE_ARGS+= --with-libowcapi="$(STAGING_DIR)/usr"
endif
# exception: mod-rrdtool needs rrdtool-1.0.x # exception: mod-rrdtool needs rrdtool-1.0.x
ifneq ($(CONFIG_PACKAGE_collectd-mod-rrdtool),) ifneq ($(CONFIG_PACKAGE_collectd-mod-rrdtool),)
CONFIGURE_ARGS+= --with-rrdtool="$(STAGING_DIR)/usr/lib/rrdtool-1.0" CONFIGURE_ARGS+= --with-librrd="$(STAGING_DIR)/usr/lib/rrdtool-1.0"
endif endif
MAKE_FLAGS += \ MAKE_FLAGS += \
@ -149,8 +188,8 @@ endef
define Package/collectd/install define Package/collectd/install
$(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(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 $(INSTALL_DIR) $(1)/usr/share/collectd
$(INSTALL_CONF) $(PKG_INSTALL_DIR)/usr/lib/collectd/types.db $(1)/usr/lib/collectd/ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/collectd/types.db $(1)/usr/share/collectd/
$(INSTALL_DIR) $(1)/etc $(INSTALL_DIR) $(1)/etc
$(INSTALL_CONF) ./files/collectd.conf $(1)/etc/ $(INSTALL_CONF) ./files/collectd.conf $(1)/etc/
$(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_DIR) $(1)/etc/init.d
@ -190,18 +229,26 @@ $(eval $(call BuildPackage,collectd))
$(eval $(call BuildPlugin,apache,apache status input,apache,+libcurl)) $(eval $(call BuildPlugin,apache,apache status input,apache,+libcurl))
$(eval $(call BuildPlugin,apcups,apcups status input,apcups,)) $(eval $(call BuildPlugin,apcups,apcups status input,apcups,))
$(eval $(call BuildPlugin,ascent,ascent status input,ascent,+libcurl +libxml2)) $(eval $(call BuildPlugin,ascent,ascent status input,ascent,+libcurl +libxml2))
$(eval $(call BuildPlugin,bind,BIND server/zone input,bind,+libcurl +libxml2))
$(eval $(call BuildPlugin,conntrack,connection tracking table size input,conntrack,))
$(eval $(call BuildPlugin,contextswitch,context switch input,contextswitch,))
$(eval $(call BuildPlugin,cpu,CPU input,cpu,)) $(eval $(call BuildPlugin,cpu,CPU input,cpu,))
$(eval $(call BuildPlugin,csv,CSV output,csv,)) $(eval $(call BuildPlugin,csv,CSV output,csv,))
$(eval $(call BuildPlugin,curl,cURL input,curl,+libcurl))
$(eval $(call BuildPlugin,dbi,relational database input,dbi,+libdbi))
$(eval $(call BuildPlugin,df,disk space input,df,)) $(eval $(call BuildPlugin,df,disk space input,df,))
$(eval $(call BuildPlugin,disk,disk usage/timing input,disk,)) $(eval $(call BuildPlugin,disk,disk usage/timing input,disk,))
$(eval $(call BuildPlugin,dns,DNS traffic input,dns,+libpcap)) $(eval $(call BuildPlugin,dns,DNS traffic input,dns,+libpcap))
$(eval $(call BuildPlugin,email,email output,email,)) $(eval $(call BuildPlugin,email,email output,email,))
$(eval $(call BuildPlugin,exec,process exec input,exec,)) $(eval $(call BuildPlugin,exec,process exec input,exec,))
$(eval $(call BuildPlugin,filecount,file count input,filecount,))
$(eval $(call BuildPlugin,fscache,file-system based caching framework input,fscache,))
$(eval $(call BuildPlugin,interface,network interfaces input,interface,)) $(eval $(call BuildPlugin,interface,network interfaces input,interface,))
$(eval $(call BuildPlugin,iptables,iptables status input,iptables,+iptables)) $(eval $(call BuildPlugin,iptables,iptables status input,iptables,+iptables))
$(eval $(call BuildPlugin,irq,interrupt usage input,irq,)) $(eval $(call BuildPlugin,irq,interrupt usage input,irq,))
$(eval $(call BuildPlugin,load,system load input,load,)) $(eval $(call BuildPlugin,load,system load input,load,))
$(eval $(call BuildPlugin,logfile,log files output,logfile,)) $(eval $(call BuildPlugin,logfile,log files output,logfile,))
$(eval $(call BuildPlugin,madwifi,MadWifi status input,madwifi,))
$(eval $(call BuildPlugin,mysql,MySQL status input,mysql,+libmysqlclient)) $(eval $(call BuildPlugin,mysql,MySQL status input,mysql,+libmysqlclient))
$(eval $(call BuildPlugin,memory,physical memory usage input,memory,)) $(eval $(call BuildPlugin,memory,physical memory usage input,memory,))
$(eval $(call BuildPlugin,netlink,netlink input,netlink,+ip)) $(eval $(call BuildPlugin,netlink,netlink input,netlink,+ip))
@ -209,17 +256,27 @@ $(eval $(call BuildPlugin,network,network input/output,network))
$(eval $(call BuildPlugin,nginx,nginx status input,nginx,+libcurl)) $(eval $(call BuildPlugin,nginx,nginx status input,nginx,+libcurl))
$(eval $(call BuildPlugin,ntpd,NTP daemon status input,ntpd,)) $(eval $(call BuildPlugin,ntpd,NTP daemon status input,ntpd,))
$(eval $(call BuildPlugin,nut,UPS monitoring input,nut,@BROKEN)) $(eval $(call BuildPlugin,nut,UPS monitoring input,nut,@BROKEN))
$(eval $(call BuildPlugin,olsrd,OLSRd status input,olsrd,))
$(eval $(call BuildPlugin,onewire,onewire sensor input,onewire,+libow-capi @BROKEN))
$(eval $(call BuildPlugin,openvpn,OpenVPN traffic/compression input,openvpn,))
$(eval $(call BuildPlugin,ping,ping status input,ping,+liboping)) $(eval $(call BuildPlugin,ping,ping status input,ping,+liboping))
$(eval $(call BuildPlugin,postgresql,PostgreSQL status input,postgresql,+libpq))
$(eval $(call BuildPlugin,powerdns,PowerDNS server status input,powerdns,)) $(eval $(call BuildPlugin,powerdns,PowerDNS server status input,powerdns,))
$(eval $(call BuildPlugin,processes,process status input,processes,)) $(eval $(call BuildPlugin,processes,process status input,processes,))
$(eval $(call BuildPlugin,protocols,network protocols input,protocols,))
$(eval $(call BuildPlugin,rrdtool,RRDtool output,rrdtool,+librrd1)) $(eval $(call BuildPlugin,rrdtool,RRDtool output,rrdtool,+librrd1))
$(eval $(call BuildPlugin,sensors,lm_sensors input,sensors,+libsensors @BROKEN)) $(eval $(call BuildPlugin,sensors,lm_sensors input,sensors,+libsensors @BROKEN))
$(eval $(call BuildPlugin,snmp,SNMP input,snmp,+libnetsnmp)) $(eval $(call BuildPlugin,snmp,SNMP input,snmp,+libnetsnmp))
$(eval $(call BuildPlugin,syslog,syslog output,syslog,)) $(eval $(call BuildPlugin,syslog,syslog output,syslog,))
$(eval $(call BuildPlugin,tail,tail input,tail,)) $(eval $(call BuildPlugin,tail,tail input,tail,))
$(eval $(call BuildPlugin,table,table-like structured file input,table,))
$(eval $(call BuildPlugin,teamspeak2,TeamSpeak2 input,teamspeak2,)) $(eval $(call BuildPlugin,teamspeak2,TeamSpeak2 input,teamspeak2,))
$(eval $(call BuildPlugin,ted,The Energy Detective input,ted,))
$(eval $(call BuildPlugin,tcpconns,TCP connection tracking input,tcpconns,)) $(eval $(call BuildPlugin,tcpconns,TCP connection tracking input,tcpconns,))
$(eval $(call BuildPlugin,thermal,system temperatures input,thermal,))
$(eval $(call BuildPlugin,unixsock,unix socket output,unixsock,)) $(eval $(call BuildPlugin,unixsock,unix socket output,unixsock,))
$(eval $(call BuildPlugin,uptime,uptime status input,uptime,))
$(eval $(call BuildPlugin,users,user logged in status input,users,)) $(eval $(call BuildPlugin,users,user logged in status input,users,))
$(eval $(call BuildPlugin,vmem,virtual memory usage input,vmem,)) $(eval $(call BuildPlugin,vmem,virtual memory usage input,vmem,))
$(eval $(call BuildPlugin,wireless,wireless status input,wireless,)) $(eval $(call BuildPlugin,wireless,wireless status input,wireless,))
$(eval $(call BuildPlugin,write_http,HTTP POST output,write_http,+libcurl))

View File

@ -1,54 +1,85 @@
# #
# collectd(1) config for OpenWrt. # OpenWrt Config file for collectd(1).
# Please read collectd.conf(5) for a list of options. # Please read collectd.conf(5) for a list of options.
# http://collectd.org/ # http://collectd.org/
# #
# Select one of the following modes: #Hostname "localhost"
# In client mode the daemon collects the data locally and sends its results #FQDNLookup true
# to one or more network addresses. This is the default mode. BaseDir "/var/lib/collectd"
Mode Client PIDFile "/var/run/collectd.pid"
# In the log mode, data is collected locally and written in #PluginDir "/usr/lib/collectd"
# text files that reside in DataDir. Be careful as it could fill #TypesDB "/usr/share/collectd/types.db"
# the memory of your device with Datadir pointing to /tmp. Interval 30
#Mode Log ReadThreads 2
# Set the IP-address(es) and UDP-port(s) to send packets to. #LoadPlugin syslog
# The port option is optional. #LoadPlugin logfile
#Server ff18::efc0:4a42 25826
#Server 239.192.74.66 25826
DataDir "/var/lib/collectd" #<Plugin syslog>
PIDFile "/var/run/collectd.pid" # LogLevel info
PluginDir "/usr/lib/collectd" #</Plugin>
TypesDB "/usr/lib/collectd/types.db"
#<Plugin logfile>
# LogLevel info
# File STDOUT
# Timestamp true
#</Plugin>
LoadPlugin cpu LoadPlugin cpu
LoadPlugin disk
LoadPlugin df LoadPlugin df
LoadPlugin disk
LoadPlugin interface
LoadPlugin load LoadPlugin load
LoadPlugin memory LoadPlugin memory
LoadPlugin network
#LoadPlugin ping #LoadPlugin ping
#LoadPlugin processes #LoadPlugin processes
#LoadPlugin rrdtool
#LoadPlugin serial #LoadPlugin serial
LoadPlugin wireless LoadPlugin wireless
#<Plugin df> #<Plugin df>
# FSType tmpfs # FSType tmpfs
# IgnoreSelected true # IgnoreSelected true
# ReportByDevice false
# ReportReserved false
# ReportInodes false
#</Plugin> #</Plugin>
#<Plugin disk>
# Disk "/^[hs]d[a-f][0-9]?$/"
# IgnoreSelected false
#</Plugin>
#<Plugin interface>
# Interface "eth0"
# Interface "br-lan"
# IgnoreSelected false
#</Plugin>
<Plugin network>
# Server "ff18::efc0:4a42" "25826"
Server "239.192.74.66" "25826"
# Listen "ff18::efc0:4a42" "25826"
# Listen "239.192.74.66" "25826"
# TimeToLive "128"
# Forward false
# CacheFlush 1800
# ReportStats false
</Plugin>
#<Plugin ping> #<Plugin ping>
# Host host.foo.bar # Host "host.foo.bar"
# TTL 255
#</Plugin> #</Plugin>
#<Plugin processes> #<Plugin processes>
# Process name # Process "name"
#</Plugin> #</Plugin>
#<Plugin traffic> #<Plugin rrdtool>
# Interface lo # DataDir "/var/lib/collectd/rrd"
# Interface imq0 # CacheTimeout 120
# Interface wifi # CacheFlush 900
# IgnoreSelected true
#</Plugin> #</Plugin>

View File

@ -1,11 +0,0 @@
--- a/configure
+++ b/configure
@@ -31446,7 +31446,7 @@ if test "${with_rrdtool+set}" = set; the
withval=$with_rrdtool; if test "x$withval" != "xno" && test "x$withval" != "xyes"
then
librrd_cflags="-I$withval/include"
- librrd_ldflags="-L$withval/lib"
+ librrd_ldflags="-L$withval/lib -lz"
with_rrdtool="yes"
else
with_rrdtool="$withval"

View File

@ -1,25 +1,57 @@
--- a/src/rrdtool.c --- a/src/rrdtool.c
+++ b/src/rrdtool.c +++ b/src/rrdtool.c
@@ -87,6 +87,7 @@ static const char *config_keys[] = @@ -80,6 +80,7 @@ static const char *config_keys[] =
"HeartBeat", "HeartBeat",
"RRARows", "RRARows",
"RRATimespan", "RRATimespan",
+ "RRASingle", + "RRASingle",
"XFF" "XFF",
"WritesPerSecond",
"RandomTimeout"
@@ -101,6 +102,8 @@ static rrdcreate_config_t rrdcreate_conf
/* timespans = */ NULL,
/* timespans_num = */ 0,
+ /* rrasingle = */ 0,
+
/* consolidation_functions = */ NULL,
/* consolidation_functions_num = */ 0
}; };
static int config_keys_num = STATIC_ARRAY_SIZE (config_keys); @@ -975,6 +978,14 @@ static int rrd_config (const char *key,
@@ -1077,6 +1078,14 @@ static int rrd_config (const char *key,
} free (value_copy);
xff = tmp;
} }
+ else if (strcasecmp ("RRASingle", key) == 0) + else if (strcasecmp ("RRASingle", key) == 0)
+ { + {
+ if (strcasecmp("true", value) == 0) + if (IS_TRUE (value))
+ { + {
+ rra_types_num = 1; + rrdcreate_config.rrasingle = 1;
+ NOTICE ("rrdtool plugin: RRASingle = true: creating only AVERAGE RRAs"); + NOTICE ("rrdtool plugin: RRASingle = true: creating only AVERAGE RRAs");
+ } + }
+ } + }
else else if (strcasecmp ("XFF", key) == 0)
{ {
return (-1); double tmp = atof (value);
--- a/src/utils_rrdcreate.c
+++ b/src/utils_rrdcreate.c
@@ -122,6 +122,9 @@ static int rra_get (char ***ret, const v
rts_num = rra_timespans_num;
}
+ if (cfg->rrasingle)
+ rra_types_num = 1;
+
rra_max = rts_num * rra_types_num;
if ((rra_def = (char **) malloc ((rra_max + 1) * sizeof (char *))) == NULL)
--- a/src/utils_rrdcreate.h
+++ b/src/utils_rrdcreate.h
@@ -36,6 +36,8 @@ struct rrdcreate_config_s
int *timespans;
size_t timespans_num;
+ int rrasingle;
+
char **consolidation_functions;
size_t consolidation_functions_num;
};