|
@@ -0,0 +1,312 @@
|
|
1
|
+#
|
|
2
|
+# Copyright (C) 2006-2014 OpenWrt.org
|
|
3
|
+#
|
|
4
|
+# This is free software, licensed under the GNU General Public License v2.
|
|
5
|
+# See /LICENSE for more information.
|
|
6
|
+#
|
|
7
|
+
|
|
8
|
+include $(TOPDIR)/rules.mk
|
|
9
|
+
|
|
10
|
+PKG_NAME:=collectd
|
|
11
|
+PKG_VERSION:=4.10.8
|
|
12
|
+PKG_RELEASE:=3
|
|
13
|
+
|
|
14
|
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
|
15
|
+PKG_SOURCE_URL:=http://collectd.org/files/
|
|
16
|
+PKG_MD5SUM:=7a60495208b9383225493c6dd6abb2f0
|
|
17
|
+
|
|
18
|
+PKG_FIXUP:=autoreconf
|
|
19
|
+PKG_REMOVE_FILES:=aclocal.m4 libltdl/aclocal.m4
|
|
20
|
+PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
|
|
21
|
+
|
|
22
|
+PKG_INSTALL:=1
|
|
23
|
+PKG_BUILD_PARALLEL:=1
|
|
24
|
+PKG_USE_MIPS16:=0
|
|
25
|
+
|
|
26
|
+COLLECTD_PLUGINS_DISABLED:= \
|
|
27
|
+ apple_sensors \
|
|
28
|
+ battery \
|
|
29
|
+ cpufreq \
|
|
30
|
+ curl_json \
|
|
31
|
+ entropy \
|
|
32
|
+ genericjmx \
|
|
33
|
+ gmond \
|
|
34
|
+ hddtemp \
|
|
35
|
+ ipmi \
|
|
36
|
+ ipvs \
|
|
37
|
+ java \
|
|
38
|
+ libvirt \
|
|
39
|
+ mbmon \
|
|
40
|
+ memcachec \
|
|
41
|
+ memcached \
|
|
42
|
+ monitorus \
|
|
43
|
+ multimeter \
|
|
44
|
+ netapp \
|
|
45
|
+ nfs \
|
|
46
|
+ notify_desktop \
|
|
47
|
+ notify_email \
|
|
48
|
+ openvz \
|
|
49
|
+ oracle \
|
|
50
|
+ perl \
|
|
51
|
+ pinba \
|
|
52
|
+ python \
|
|
53
|
+ routeros \
|
|
54
|
+ rrdcached \
|
|
55
|
+ serial \
|
|
56
|
+ swap \
|
|
57
|
+ tape \
|
|
58
|
+ tokyotyrant \
|
|
59
|
+ uuid \
|
|
60
|
+ vserver \
|
|
61
|
+ xmms \
|
|
62
|
+ zfs_arc \
|
|
63
|
+
|
|
64
|
+COLLECTD_PLUGINS_SELECTED:= \
|
|
65
|
+ apache \
|
|
66
|
+ apcups \
|
|
67
|
+ ascent \
|
|
68
|
+ bind \
|
|
69
|
+ conntrack \
|
|
70
|
+ contextswitch \
|
|
71
|
+ cpu \
|
|
72
|
+ csv \
|
|
73
|
+ curl \
|
|
74
|
+ dbi \
|
|
75
|
+ df \
|
|
76
|
+ disk \
|
|
77
|
+ dns \
|
|
78
|
+ email \
|
|
79
|
+ exec \
|
|
80
|
+ filecount \
|
|
81
|
+ fscache \
|
|
82
|
+ interface \
|
|
83
|
+ iptables \
|
|
84
|
+ irq \
|
|
85
|
+ iwinfo \
|
|
86
|
+ load \
|
|
87
|
+ logfile \
|
|
88
|
+ madwifi \
|
|
89
|
+ memory \
|
|
90
|
+ modbus \
|
|
91
|
+ mysql \
|
|
92
|
+ netlink \
|
|
93
|
+ network \
|
|
94
|
+ nginx \
|
|
95
|
+ ntpd \
|
|
96
|
+ nut \
|
|
97
|
+ olsrd \
|
|
98
|
+ onewire \
|
|
99
|
+ openvpn \
|
|
100
|
+ ping \
|
|
101
|
+ postgresql \
|
|
102
|
+ powerdns \
|
|
103
|
+ processes \
|
|
104
|
+ protocols \
|
|
105
|
+ rrdtool \
|
|
106
|
+ sensors \
|
|
107
|
+ snmp \
|
|
108
|
+ syslog \
|
|
109
|
+ tail \
|
|
110
|
+ table \
|
|
111
|
+ ted \
|
|
112
|
+ tcpconns \
|
|
113
|
+ teamspeak2 \
|
|
114
|
+ thermal \
|
|
115
|
+ unixsock \
|
|
116
|
+ uptime \
|
|
117
|
+ users \
|
|
118
|
+ vmem \
|
|
119
|
+ wireless \
|
|
120
|
+ write_http \
|
|
121
|
+
|
|
122
|
+PKG_CONFIG_DEPENDS:= \
|
|
123
|
+ $(patsubst %,CONFIG_PACKAGE_collectd-mod-%,$(subst _,-,$(COLLECTD_PLUGINS_SELECTED))) \
|
|
124
|
+
|
|
125
|
+include $(INCLUDE_DIR)/package.mk
|
|
126
|
+include $(INCLUDE_DIR)/kernel.mk
|
|
127
|
+
|
|
128
|
+define Package/collectd/Default
|
|
129
|
+ SECTION:=utils
|
|
130
|
+ CATEGORY:=Utilities
|
|
131
|
+ TITLE:=Lightweight system statistics collection daemon
|
|
132
|
+ URL:=http://verplant.org/collectd/
|
|
133
|
+endef
|
|
134
|
+
|
|
135
|
+define Package/collectd
|
|
136
|
+$(call Package/collectd/Default)
|
|
137
|
+ DEPENDS:= +libpthread +zlib +libltdl +libip4tc
|
|
138
|
+ MENU:=1
|
|
139
|
+endef
|
|
140
|
+
|
|
141
|
+define Package/collectd/description
|
|
142
|
+ collectd is a small daemon which collects system information periodically
|
|
143
|
+ and provides mechanismns to store the values in a variety of ways.
|
|
144
|
+endef
|
|
145
|
+
|
|
146
|
+ifneq ($(CONFIG_avr32),)
|
|
147
|
+ TARGET_CFLAGS += -fsigned-char
|
|
148
|
+endif
|
|
149
|
+
|
|
150
|
+# common configure args
|
|
151
|
+CONFIGURE_ARGS+= \
|
|
152
|
+ --disable-debug \
|
|
153
|
+ --enable-daemon \
|
|
154
|
+ --enable-getifaddrs \
|
|
155
|
+ --with-nan-emulation \
|
|
156
|
+ --without-libgcrypt
|
|
157
|
+
|
|
158
|
+CONFIGURE_VARS+= \
|
|
159
|
+ CFLAGS="$$$$CFLAGS $(FPIC)" \
|
|
160
|
+ LDFLAGS="$$$$LDFLAGS -lm -lz" \
|
|
161
|
+ KERNEL_DIR="$(LINUX_DIR)" \
|
|
162
|
+
|
|
163
|
+CONFIGURE_PLUGIN= \
|
|
164
|
+ $(foreach m, $(1), \
|
|
165
|
+ $(if $(CONFIG_PACKAGE_collectd-mod-$(subst _,-,$(m))),--enable-$(m),--disable-$(m)) \
|
|
166
|
+ )
|
|
167
|
+
|
|
168
|
+CONFIGURE_ARGS+= \
|
|
169
|
+ $(call CONFIGURE_PLUGIN,$(COLLECTD_PLUGINS_SELECTED)) \
|
|
170
|
+ $(call CONFIGURE_PLUGIN,$(COLLECTD_PLUGINS_DISABLED)) \
|
|
171
|
+
|
|
172
|
+# exception: mod-ascent needs libxml2
|
|
173
|
+ifneq ($(CONFIG_PACKAGE_collectd-mod-ascent),)
|
|
174
|
+ CONFIGURE_VARS+= \
|
|
175
|
+ CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/libxml2"
|
|
176
|
+endif
|
|
177
|
+
|
|
178
|
+ifneq ($(CONFIG_BIG_ENDIAN),)
|
|
179
|
+ CONFIGURE_ARGS+= --with-fp-layout=endianflip
|
|
180
|
+else
|
|
181
|
+ CONFIGURE_ARGS+= --with-fp-layout=nothing
|
|
182
|
+endif
|
|
183
|
+
|
|
184
|
+ifneq ($(CONFIG_PACKAGE_collectd-mod-postgresql),)
|
|
185
|
+ CONFIGURE_ARGS+= --with-libpq="$(STAGING_DIR)/usr/"
|
|
186
|
+endif
|
|
187
|
+
|
|
188
|
+ifneq ($(CONFIG_PACKAGE_collectd-mod-mysql),)
|
|
189
|
+ CONFIGURE_ARGS+= --with-libmysql="$(STAGING_DIR)/usr/"
|
|
190
|
+endif
|
|
191
|
+
|
|
192
|
+# exception: mod-netlink needs libnetlink from iproute
|
|
193
|
+ifneq ($(CONFIG_PACKAGE_collectd-mod-netlink),)
|
|
194
|
+ CONFIGURE_ARGS+= --with-libnetlink="$(STAGING_DIR)/usr"
|
|
195
|
+endif
|
|
196
|
+
|
|
197
|
+# exception: mod-modbus needs libmodbus
|
|
198
|
+ifneq ($(CONFIG_PACKAGE_collectd-mod-modbus),)
|
|
199
|
+ CONFIGURE_ARGS+= --with-libmodbus="$(STAGING_DIR)/usr"
|
|
200
|
+endif
|
|
201
|
+
|
|
202
|
+# exception: mod-onewire needs libow-capi
|
|
203
|
+ifneq ($(CONFIG_PACKAGE_collectd-mod-onewire),)
|
|
204
|
+ CONFIGURE_ARGS+= --with-libowcapi="$(STAGING_DIR)/usr"
|
|
205
|
+endif
|
|
206
|
+
|
|
207
|
+# exception: mod-rrdtool needs rrdtool-1.0.x
|
|
208
|
+ifneq ($(CONFIG_PACKAGE_collectd-mod-rrdtool),)
|
|
209
|
+ CONFIGURE_ARGS+= --with-librrd="$(STAGING_DIR)/usr/lib/rrdtool-1.0"
|
|
210
|
+endif
|
|
211
|
+
|
|
212
|
+define Package/collectd/conffiles
|
|
213
|
+/etc/collectd.conf
|
|
214
|
+endef
|
|
215
|
+
|
|
216
|
+define Package/collectd/install
|
|
217
|
+ $(INSTALL_DIR) $(1)/usr/sbin
|
|
218
|
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/collectd $(1)/usr/sbin/
|
|
219
|
+ $(INSTALL_DIR) $(1)/usr/share/collectd
|
|
220
|
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/collectd/types.db $(1)/usr/share/collectd/
|
|
221
|
+ $(INSTALL_DIR) $(1)/etc
|
|
222
|
+ $(INSTALL_CONF) ./files/collectd.conf $(1)/etc/
|
|
223
|
+ $(INSTALL_DIR) $(1)/etc/init.d
|
|
224
|
+ $(INSTALL_BIN) ./files/collectd.init $(1)/etc/init.d/collectd
|
|
225
|
+endef
|
|
226
|
+
|
|
227
|
+# 1: plugin name
|
|
228
|
+# 2: plugin title/description
|
|
229
|
+# 3: files
|
|
230
|
+# 4: extra dependency
|
|
231
|
+define BuildPlugin
|
|
232
|
+
|
|
233
|
+ PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_collectd-mod-$(1)
|
|
234
|
+
|
|
235
|
+ define Package/collectd-mod-$(1)
|
|
236
|
+ $$(call Package/collectd/Default)
|
|
237
|
+ TITLE:=$(2) plugin
|
|
238
|
+ DEPENDS:= collectd $(4)
|
|
239
|
+ endef
|
|
240
|
+
|
|
241
|
+ define Package/collectd-mod-$(1)/install
|
|
242
|
+ $(INSTALL_DIR) $$(1)/usr/lib/collectd
|
|
243
|
+ for m in $(3); do \
|
|
244
|
+ $(CP) \
|
|
245
|
+ $(PKG_INSTALL_DIR)/usr/lib/collectd/$$$$$$$${m}.so \
|
|
246
|
+ $$(1)/usr/lib/collectd/ ; \
|
|
247
|
+ done
|
|
248
|
+ endef
|
|
249
|
+
|
|
250
|
+ $$(eval $$(call BuildPackage,collectd-mod-$(1)))
|
|
251
|
+
|
|
252
|
+endef
|
|
253
|
+
|
|
254
|
+$(eval $(call BuildPackage,collectd))
|
|
255
|
+
|
|
256
|
+#$(eval $(call BuildPlugin,NAME,DESCRIPTION,FILES,DEPENDENCIES))
|
|
257
|
+$(eval $(call BuildPlugin,apache,apache status input,apache,+PACKAGE_collectd-mod-apache:libcurl))
|
|
258
|
+$(eval $(call BuildPlugin,apcups,apcups status input,apcups,))
|
|
259
|
+$(eval $(call BuildPlugin,ascent,ascent status input,ascent,+PACKAGE_collectd-mod-ascent:libcurl +PACKAGE_collectd-mod-ascent:libxml2))
|
|
260
|
+$(eval $(call BuildPlugin,bind,BIND server/zone input,bind,+PACKAGE_collectd-mod-bind:libcurl +PACKAGE_collectd-mod-bind:libxml2))
|
|
261
|
+$(eval $(call BuildPlugin,conntrack,connection tracking table size input,conntrack,))
|
|
262
|
+$(eval $(call BuildPlugin,contextswitch,context switch input,contextswitch,))
|
|
263
|
+$(eval $(call BuildPlugin,cpu,CPU input,cpu,))
|
|
264
|
+$(eval $(call BuildPlugin,csv,CSV output,csv,))
|
|
265
|
+$(eval $(call BuildPlugin,curl,cURL input,curl,+PACKAGE_collectd-mod-curl:libcurl))
|
|
266
|
+$(eval $(call BuildPlugin,dbi,relational database input,dbi,+PACKAGE_collectd-mod-dbi:libdbi))
|
|
267
|
+$(eval $(call BuildPlugin,df,disk space input,df,))
|
|
268
|
+$(eval $(call BuildPlugin,disk,disk usage/timing input,disk,))
|
|
269
|
+$(eval $(call BuildPlugin,dns,DNS traffic input,dns,+PACKAGE_collectd-mod-dns:libpcap))
|
|
270
|
+$(eval $(call BuildPlugin,email,email output,email,))
|
|
271
|
+$(eval $(call BuildPlugin,exec,process exec input,exec,))
|
|
272
|
+$(eval $(call BuildPlugin,filecount,file count input,filecount,))
|
|
273
|
+$(eval $(call BuildPlugin,fscache,file-system based caching framework input,fscache,))
|
|
274
|
+$(eval $(call BuildPlugin,interface,network interfaces input,interface,))
|
|
275
|
+$(eval $(call BuildPlugin,iptables,iptables status input,iptables,+PACKAGE_collectd-mod-iptables:iptables +libiptc))
|
|
276
|
+$(eval $(call BuildPlugin,irq,interrupt usage input,irq,))
|
|
277
|
+$(eval $(call BuildPlugin,iwinfo,libiwinfo wireless statistics,iwinfo,+PACKAGE_collectd-mod-iwinfo:libiwinfo))
|
|
278
|
+$(eval $(call BuildPlugin,load,system load input,load,))
|
|
279
|
+$(eval $(call BuildPlugin,logfile,log files output,logfile,))
|
|
280
|
+$(eval $(call BuildPlugin,madwifi,MadWifi status input,madwifi,))
|
|
281
|
+$(eval $(call BuildPlugin,mysql,MySQL status input,mysql,+PACKAGE_collectd-mod-mysql:libmysqlclient-r))
|
|
282
|
+$(eval $(call BuildPlugin,memory,physical memory usage input,memory,))
|
|
283
|
+$(eval $(call BuildPlugin,modbus,read variables through libmodbus,modbus,+PACKAGE_collectd-mod-modbus:libmodbus @BROKEN))
|
|
284
|
+$(eval $(call BuildPlugin,netlink,netlink input,netlink,+PACKAGE_collectd-mod-netlink:ip @BROKEN))
|
|
285
|
+$(eval $(call BuildPlugin,network,network input/output,network))
|
|
286
|
+$(eval $(call BuildPlugin,nginx,nginx status input,nginx,+PACKAGE_collectd-mod-nginx:libcurl))
|
|
287
|
+$(eval $(call BuildPlugin,ntpd,NTP daemon status input,ntpd,))
|
|
288
|
+$(eval $(call BuildPlugin,nut,UPS monitoring input,nut,+PACKAGE_collectd-mod-nut:nut))
|
|
289
|
+$(eval $(call BuildPlugin,olsrd,OLSRd status input,olsrd,))
|
|
290
|
+$(eval $(call BuildPlugin,onewire,onewire sensor input,onewire,+PACKAGE_collectd-mod-onewire:libow-capi @BROKEN))
|
|
291
|
+$(eval $(call BuildPlugin,openvpn,OpenVPN traffic/compression input,openvpn,))
|
|
292
|
+$(eval $(call BuildPlugin,ping,ping status input,ping,+PACKAGE_collectd-mod-ping:liboping))
|
|
293
|
+$(eval $(call BuildPlugin,postgresql,PostgreSQL status input,postgresql,+PACKAGE_collectd-mod-postgresql:libpq))
|
|
294
|
+$(eval $(call BuildPlugin,powerdns,PowerDNS server status input,powerdns,))
|
|
295
|
+$(eval $(call BuildPlugin,processes,process status input,processes,))
|
|
296
|
+$(eval $(call BuildPlugin,protocols,network protocols input,protocols,))
|
|
297
|
+$(eval $(call BuildPlugin,rrdtool,RRDtool output,rrdtool,+PACKAGE_collectd-mod-rrdtool:librrd1))
|
|
298
|
+$(eval $(call BuildPlugin,sensors,lm_sensors input,sensors,+PACKAGE_collectd-mod-sensors:libsensors @BROKEN))
|
|
299
|
+$(eval $(call BuildPlugin,snmp,SNMP input,snmp,+PACKAGE_collectd-mod-snmp:libnetsnmp))
|
|
300
|
+$(eval $(call BuildPlugin,syslog,syslog output,syslog,))
|
|
301
|
+$(eval $(call BuildPlugin,tail,tail input,tail,))
|
|
302
|
+$(eval $(call BuildPlugin,table,table-like structured file input,table,))
|
|
303
|
+$(eval $(call BuildPlugin,teamspeak2,TeamSpeak2 input,teamspeak2,))
|
|
304
|
+$(eval $(call BuildPlugin,ted,The Energy Detective input,ted,@((!TARGET_avr32)||BROKEN))) # fails on avr32 because of warnings treated as errors
|
|
305
|
+$(eval $(call BuildPlugin,tcpconns,TCP connection tracking input,tcpconns,))
|
|
306
|
+$(eval $(call BuildPlugin,thermal,system temperatures input,thermal,))
|
|
307
|
+$(eval $(call BuildPlugin,unixsock,unix socket output,unixsock,))
|
|
308
|
+$(eval $(call BuildPlugin,uptime,uptime status input,uptime,))
|
|
309
|
+$(eval $(call BuildPlugin,users,user logged in status input,users,))
|
|
310
|
+$(eval $(call BuildPlugin,vmem,virtual memory usage input,vmem,))
|
|
311
|
+$(eval $(call BuildPlugin,wireless,wireless status input,wireless,))
|
|
312
|
+$(eval $(call BuildPlugin,write-http,HTTP POST output,write_http,+PACKAGE_collectd-mod-write-http:libcurl))
|