2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR)/rules.mk
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=http://collectd.org/files/
17 PKG_MD5SUM:=176880c32a06bee9d5e6e2e7c76751a3
21 include $(INCLUDE_DIR)/package.mk
23 define Package/collectd/common_info
26 TITLE:=Lightweight system statistics collection daemon
27 URL:=http://verplant.org/collectd/
30 define Package/collectd/description
31 collectd is a small daemon which collects system information periodically
32 and provides mechanismns to store the values in a variety of ways.
35 define Package/collectd
36 $(call Package/collectd/common_info)
37 DEPENDS:=+libgcc +libpthread
45 define Package/collectd-mod-csv
46 $(call Package/collectd/common_info)
47 TITLE:=collectd - csv output plugin
51 define Package/collectd-mod-email
52 $(call Package/collectd/common_info)
53 TITLE:=collectd - email output plugin
57 define Package/collectd-mod-logfile
58 $(call Package/collectd/common_info)
59 TITLE:=collectd - logfile output plugin
63 define Package/collectd-mod-network
64 $(call Package/collectd/common_info)
65 TITLE:=collectd - network input/output plugin
69 define Package/collectd-mod-syslog
70 $(call Package/collectd/common_info)
71 TITLE:=collectd - syslog output plugin
75 define Package/collectd-mod-unixsock
76 $(call Package/collectd/common_info)
77 TITLE:=collectd - unix socket output plugin
85 define Package/collectd-mod-apache
86 $(call Package/collectd/common_info)
87 TITLE:=collectd - apache status input plugin
88 DEPENDS:=collectd +libcurl
91 define Package/collectd-mod-apcups
92 $(call Package/collectd/common_info)
93 TITLE:=collectd - apcups status input plugin
97 define Package/collectd-mod-ascent
98 $(call Package/collectd/common_info)
99 TITLE:=collectd - ascent status input plugin
100 DEPENDS:=collectd +libcurl +libxml2
103 define Package/collectd-mod-cpu
104 $(call Package/collectd/common_info)
105 TITLE:=collectd - cpu input plugin
109 define Package/collectd-mod-df
110 $(call Package/collectd/common_info)
111 TITLE:=collectd - disk space input plugin
115 define Package/collectd-mod-disk
116 $(call Package/collectd/common_info)
117 TITLE:=collectd - disk usage/timing input plugin
121 define Package/collectd-mod-dns
122 $(call Package/collectd/common_info)
123 TITLE:=collectd - dns traffic input plugin
124 DEPENDS:=collectd +libpcap
127 define Package/collectd-mod-exec
128 $(call Package/collectd/common_info)
129 TITLE:=collectd - process exec input plugin
133 define Package/collectd-mod-interface
134 $(call Package/collectd/common_info)
135 TITLE:=collectd - network interfaces input plugin
139 define Package/collectd-mod-iptables
140 $(call Package/collectd/common_info)
141 TITLE:=collectd - iptables status input plugin
142 DEPENDS:=collectd +iptables
145 define Package/collectd-mod-irq
146 $(call Package/collectd/common_info)
147 TITLE:=collectd - interrupt usage input plugin
151 define Package/collectd-mod-load
152 $(call Package/collectd/common_info)
153 TITLE:=collectd - system load input plugin
157 define Package/collectd-mod-netlink
158 $(call Package/collectd/common_info)
159 TITLE:=collectd - netlink input plugin (uses iproute2)
160 DEPENDS:=collectd +ip
163 define Package/collectd-mod-nginx
164 $(call Package/collectd/common_info)
165 TITLE:=collectd - nginx status input plugin
166 DEPENDS:=collectd +libcurl
169 define Package/collectd-mod-ntpd
170 $(call Package/collectd/common_info)
171 TITLE:=collectd - ntp daemon status input plugin
175 define Package/collectd-mod-ping
176 $(call Package/collectd/common_info)
177 TITLE:=collectd - ping status input plugin
181 define Package/collectd-mod-powerdns
182 $(call Package/collectd/common_info)
183 TITLE:=collectd - powerdns server status input plugin
187 define Package/collectd-mod-processes
188 $(call Package/collectd/common_info)
189 TITLE:=collectd - process status plugin
194 define Package/collectd-mod-rrdtool1
195 $(call Package/collectd/common_info)
196 TITLE:=collectd - rrdtool 1.0.x output plugin
197 DEPENDS:=collectd +librrd1
200 define Package/collectd-mod-rrdtool
201 $(call Package/collectd/common_info)
202 TITLE:=collectd - rrdtool 1.2.x output plugin
203 DEPENDS:=collectd +librrd
206 define Package/collectd-mod-snmp
207 $(call Package/collectd/common_info)
208 TITLE:=collectd - snmp input plugin
209 DEPENDS:=collectd +libnetsnmp
212 define Package/collectd-mod-tail
213 $(call Package/collectd/common_info)
214 TITLE:=collectd - tail input plugin
218 define Package/collectd-mod-teamspeak2
219 $(call Package/collectd/common_info)
220 TITLE:=collectd - teamspeak2 input plugin
224 define Package/collectd-mod-tcpconns
225 $(call Package/collectd/common_info)
226 TITLE:=collectd - tcp connection tracking input plugin
230 define Package/collectd-mod-users
231 $(call Package/collectd/common_info)
232 TITLE:=collectd - user login status input plugin
236 define Package/collectd-mod-vmem
237 $(call Package/collectd/common_info)
238 TITLE:=collectd - virtual memory usage input plugin
242 define Package/collectd-mod-wireless
243 $(call Package/collectd/common_info)
244 TITLE:=collectd - wireless status input plugin
249 define Package/collectd/conffiles
253 define Build/Configure
257 -$(MAKE) -C $(PKG_BUILD_DIR) clean
258 $(call Build/Configure/Default, $(PKG_CONFIGURE_OPTS))
259 $(call Build/Compile/Default)
264 # Build PKG_CONFIGURE_OPTS
267 # common configure args
268 PKG_CONFIGURE_OPTS:= \
271 --enable-getifaddrs \
272 --with-nan-emulation \
273 --with-fp-layout=nothing
276 CPPFLAGS="-I$(STAGING_DIR)/usr/include/libxml2 $$$$CPPFLAGS" \
278 # list of permanently disabled plugins
279 disabled_plugins := apple_sensors battery cpufreq entropy hddtemp ipmi ipvs libvirt mbmon memcached \
280 multimeter mysql nfs nut perl sensors serial swap tape uuid vserver xmms
282 # list of selectable plugins
283 selectable_plugins := apache apcups ascent cpu csv df disk dns email exec interface iptables irq load \
284 logfile memory netlink network nginx ntpd ping powerdns processes snmp \
285 syslog tail tcpconns teamspeak2 unixsock users vmem wireless
287 # makro to enable / disable plugin
289 ifneq ($$(CONFIG_PACKAGE_collectd-mod-$(1)),)
290 PKG_CONFIGURE_OPTS += --enable-$(1)
292 PKG_CONFIGURE_OPTS += --disable-$(1)
296 # build args for permanently disabled plugins
297 PKG_CONFIGURE_OPTS += $(foreach plugin,$(disabled_plugins),--disable-$(plugin))
299 # build args for selectable plugins
300 $(foreach plugin,$(selectable_plugins),$(eval $(call enable_plugin,$(plugin))))
302 # exception: mod-netlink needs iproute2
303 ifneq ($(CONFIG_PACKAGE_collectd-mod-netlink),)
304 PKG_CONFIGURE_OPTS += --with-libnetlink=$(wildcard $(BUILD_DIR)/iproute2-*)
307 # exception: mod-rrdtool(1) needs rrdtool
308 ifneq ($(CONFIG_PACKAGE_collectd-mod-rrdtool1)$(CONFIG_PACKAGE_collectd-mod-rrdtool),)
309 PKG_CONFIGURE_OPTS += --enable-rrdtool
310 ifneq ($(CONFIG_PACKAGE_collectd-mod-rrdtool1),)
311 PKG_CONFIGURE_OPTS += --with-rrdtool=$(wildcard $(BUILD_DIR)/rrdtool-1.0.*)
313 PKG_CONFIGURE_OPTS += --with-rrdtool=$(wildcard $(BUILD_DIR)/rrdtool-1.2.*)
319 DESTDIR="$(PKG_INSTALL_DIR)" \
322 define Package/collectd/install
323 $(INSTALL_DIR) $(1)/usr/sbin
324 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/collectd $(1)/usr/sbin/
325 $(INSTALL_DIR) $(1)/usr/lib/collectd
326 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/usr/lib/collectd/types.db $(1)/usr/lib/collectd/
327 $(INSTALL_DIR) $(1)/etc
328 $(INSTALL_CONF) ./files/collectd.conf $(1)/etc/
329 $(INSTALL_DIR) $(1)/etc/init.d
330 $(INSTALL_BIN) ./files/collectd.init $(1)/etc/init.d/collectd
333 define Package/collectd-mod-apache/install
334 $(INSTALL_DIR) $(1)/usr/lib/collectd
335 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/apache.so $(1)/usr/lib/collectd/
338 define Package/collectd-mod-apcups/install
339 $(INSTALL_DIR) $(1)/usr/lib/collectd
340 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/apcups.so $(1)/usr/lib/collectd/
343 define Package/collectd-mod-ascent/install
344 $(INSTALL_DIR) $(1)/usr/lib/collectd
345 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/ascent.so $(1)/usr/lib/collectd/
348 define Package/collectd-mod-cpu/install
349 $(INSTALL_DIR) $(1)/usr/lib/collectd
350 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/cpu.so $(1)/usr/lib/collectd/
353 define Package/collectd-mod-csv/install
354 $(INSTALL_DIR) $(1)/usr/lib/collectd
355 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/csv.so $(1)/usr/lib/collectd/
358 define Package/collectd-mod-df/install
359 $(INSTALL_DIR) $(1)/usr/lib/collectd
360 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/df.so $(1)/usr/lib/collectd/
363 define Package/collectd-mod-disk/install
364 $(INSTALL_DIR) $(1)/usr/lib/collectd
365 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/disk.so $(1)/usr/lib/collectd/
368 define Package/collectd-mod-dns/install
369 $(INSTALL_DIR) $(1)/usr/lib/collectd
370 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/dns.so $(1)/usr/lib/collectd/
373 define Package/collectd-mod-email/install
374 $(INSTALL_DIR) $(1)/usr/lib/collectd
375 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/email.so $(1)/usr/lib/collectd/
378 define Package/collectd-mod-exec/install
379 $(INSTALL_DIR) $(1)/usr/lib/collectd
380 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/exec.so $(1)/usr/lib/collectd/
383 define Package/collectd-mod-interface/install
384 $(INSTALL_DIR) $(1)/usr/lib/collectd
385 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/interface.so $(1)/usr/lib/collectd/
388 define Package/collectd-mod-iptables/install
389 $(INSTALL_DIR) $(1)/usr/lib/collectd
390 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/iptables.so $(1)/usr/lib/collectd/
393 define Package/collectd-mod-irq/install
394 $(INSTALL_DIR) $(1)/usr/lib/collectd
395 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/irq.so $(1)/usr/lib/collectd/
398 define Package/collectd-mod-load/install
399 $(INSTALL_DIR) $(1)/usr/lib/collectd
400 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/load.so $(1)/usr/lib/collectd/
403 define Package/collectd-mod-logfile/install
404 $(INSTALL_DIR) $(1)/usr/lib/collectd
405 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/logfile.so $(1)/usr/lib/collectd/
408 define Package/collectd-mod-netlink/install
409 $(INSTALL_DIR) $(1)/usr/lib/collectd
410 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/netlink.so $(1)/usr/lib/collectd/
413 define Package/collectd-mod-network/install
414 $(INSTALL_DIR) $(1)/usr/lib/collectd
415 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/network.so $(1)/usr/lib/collectd/
418 define Package/collectd-mod-nginx/install
419 $(INSTALL_DIR) $(1)/usr/lib/collectd
420 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/nginx.so $(1)/usr/lib/collectd/
423 define Package/collectd-mod-ntpd/install
424 $(INSTALL_DIR) $(1)/usr/lib/collectd
425 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/ntpd.so $(1)/usr/lib/collectd/
428 define Package/collectd-mod-ping/install
429 $(INSTALL_DIR) $(1)/usr/lib/collectd
430 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/ping.so $(1)/usr/lib/collectd/
433 define Package/collectd-mod-powerdns/install
434 $(INSTALL_DIR) $(1)/usr/lib/collectd
435 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/powerdns.so $(1)/usr/lib/collectd/
438 define Package/collectd-mod-processes/install
439 $(INSTALL_DIR) $(1)/usr/lib/collectd
440 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/processes.so $(1)/usr/lib/collectd/
443 define Package/collectd-mod-rrdtool1/install
444 $(INSTALL_DIR) $(1)/usr/lib/collectd
445 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/rrdtool.so $(1)/usr/lib/collectd/
448 define Package/collectd-mod-rrdtool/install
449 $(INSTALL_DIR) $(1)/usr/lib/collectd
450 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/rrdtool.so $(1)/usr/lib/collectd/
453 define Package/collectd-mod-snmp/install
454 $(INSTALL_DIR) $(1)/usr/lib/collectd
455 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/snmp.so $(1)/usr/lib/collectd/
458 define Package/collectd-mod-syslog/install
459 $(INSTALL_DIR) $(1)/usr/lib/collectd
460 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/syslog.so $(1)/usr/lib/collectd/
463 define Package/collectd-mod-tail/install
464 $(INSTALL_DIR) $(1)/usr/lib/collectd
465 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/tail.so $(1)/usr/lib/collectd/
468 define Package/collectd-mod-teamspeak2/install
469 $(INSTALL_DIR) $(1)/usr/lib/collectd
470 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/teamspeak2.so $(1)/usr/lib/collectd/
473 define Package/collectd-mod-tcpconns/install
474 $(INSTALL_DIR) $(1)/usr/lib/collectd
475 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/tcpconns.so $(1)/usr/lib/collectd/
478 define Package/collectd-mod-unixsock/install
479 $(INSTALL_DIR) $(1)/usr/lib/collectd
480 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/unixsock.so $(1)/usr/lib/collectd/
483 define Package/collectd-mod-users/install
484 $(INSTALL_DIR) $(1)/usr/lib/collectd
485 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/users.so $(1)/usr/lib/collectd/
488 define Package/collectd-mod-vmem/install
489 $(INSTALL_DIR) $(1)/usr/lib/collectd
490 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/vmem.so $(1)/usr/lib/collectd/
493 define Package/collectd-mod-wireless/install
494 $(INSTALL_DIR) $(1)/usr/lib/collectd
495 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/wireless.so $(1)/usr/lib/collectd/
499 $(eval $(call BuildPackage,collectd))
500 $(eval $(call BuildPackage,collectd-mod-apache))
501 $(eval $(call BuildPackage,collectd-mod-apcups))
502 $(eval $(call BuildPackage,collectd-mod-ascent))
503 $(eval $(call BuildPackage,collectd-mod-cpu))
504 $(eval $(call BuildPackage,collectd-mod-csv))
505 $(eval $(call BuildPackage,collectd-mod-df))
506 $(eval $(call BuildPackage,collectd-mod-disk))
507 $(eval $(call BuildPackage,collectd-mod-dns))
508 $(eval $(call BuildPackage,collectd-mod-email))
509 $(eval $(call BuildPackage,collectd-mod-exec))
510 $(eval $(call BuildPackage,collectd-mod-interface))
511 $(eval $(call BuildPackage,collectd-mod-iptables))
512 $(eval $(call BuildPackage,collectd-mod-irq))
513 $(eval $(call BuildPackage,collectd-mod-load))
514 $(eval $(call BuildPackage,collectd-mod-logfile))
515 $(eval $(call BuildPackage,collectd-mod-netlink))
516 $(eval $(call BuildPackage,collectd-mod-network))
517 $(eval $(call BuildPackage,collectd-mod-nginx))
518 $(eval $(call BuildPackage,collectd-mod-ntpd))
519 $(eval $(call BuildPackage,collectd-mod-ping))
520 $(eval $(call BuildPackage,collectd-mod-powerdns))
521 $(eval $(call BuildPackage,collectd-mod-processes))
522 $(eval $(call BuildPackage,collectd-mod-rrdtool1))
523 $(eval $(call BuildPackage,collectd-mod-rrdtool))
524 $(eval $(call BuildPackage,collectd-mod-snmp))
525 $(eval $(call BuildPackage,collectd-mod-syslog))
526 $(eval $(call BuildPackage,collectd-mod-tail))
527 $(eval $(call BuildPackage,collectd-mod-teamspeak2))
528 $(eval $(call BuildPackage,collectd-mod-tcpconns))
529 $(eval $(call BuildPackage,collectd-mod-unixsock))
530 $(eval $(call BuildPackage,collectd-mod-users))
531 $(eval $(call BuildPackage,collectd-mod-vmem))
532 $(eval $(call BuildPackage,collectd-mod-wireless))