diff options
author | Florian Eckert <fe@dev.tdt.de> | 2021-03-17 10:56:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-17 10:56:18 +0100 |
commit | aa4a02a68c7c91e36143426bd41238c8d7a6bfd5 (patch) | |
tree | c38eefb9ec4d9bd559cf5f5ca07b7961a77a7546 /utils | |
parent | 5f1c59dc60eb180ef1e5a0255a38bc7ffbea36b4 (diff) | |
parent | 6e41bf73ba3e80e206066cbcb8373a82efcbbf95 (diff) |
Merge pull request #15105 from TDT-AG/pr/20210312-collectd
collectd: enable smart plugin
Diffstat (limited to 'utils')
-rw-r--r-- | utils/collectd/Makefile | 43 | ||||
-rw-r--r-- | utils/collectd/files/usr/share/collectd/plugin/smart.json | 10 | ||||
-rw-r--r-- | utils/collectd/patches/933-fix-smart-detection.patch | 10 |
3 files changed, 56 insertions, 7 deletions
diff --git a/utils/collectd/Makefile b/utils/collectd/Makefile index 5d4724601..3b09bb44f 100644 --- a/utils/collectd/Makefile +++ b/utils/collectd/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=collectd PKG_VERSION:=5.12.0 -PKG_RELEASE:=7 +PKG_RELEASE:=8 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://collectd.org/files/ \ @@ -25,6 +25,10 @@ PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 PKG_USE_MIPS16:=0 +PKG_CONFIG_DEPENDS:= \ + PACKAGE_COLLECTD_ENCRYPTED_NETWORK \ + PACKAGE_COLLECTD_DEBUG_OUTPUT_ENABLE + COLLECTD_PLUGINS_DISABLED:= \ amqp \ ampq1 \ @@ -101,7 +105,6 @@ COLLECTD_PLUGINS_DISABLED:= \ serial \ sigrok \ slurm \ - smart \ snmp_agent \ statsd \ synproxy \ @@ -184,6 +187,7 @@ COLLECTD_PLUGINS_SELECTED:= \ routeros \ rrdtool \ sensors \ + smart \ snmp \ snmp6 \ swap \ @@ -203,7 +207,7 @@ COLLECTD_PLUGINS_SELECTED:= \ vmem \ wireless \ write_graphite \ - write_http \ + write_http PKG_CONFIG_DEPENDS:= \ $(patsubst %,CONFIG_PACKAGE_collectd-mod-%,$(subst _,-,$(COLLECTD_PLUGINS_SELECTED))) \ @@ -242,17 +246,24 @@ define Package/collectd/config default n depends on PACKAGE_collectd select PACKAGE_collectd-mod-network + + config PACKAGE_COLLECTD_DEBUG_OUTPUT_ENABLE + bool "Enable debug output" + default n + depends on PACKAGE_collectd + help + Enables the compiler option that collectd is compiled with + debugging support. This is used at development stages to get + more messages from the collectd during development. endef # common configure args CONFIGURE_ARGS+= \ --disable-werror \ - --disable-debug \ --enable-daemon \ --with-nan-emulation \ --with-libyajl=no \ - --without-perl-bindings \ - --without-libudev + --without-perl-bindings CONFIGURE_VARS+= \ CFLAGS="$$$$CFLAGS $(FPIC)" \ @@ -274,6 +285,14 @@ CONFIGURE_ARGS+= \ --without-libgcrypt endif +ifeq ($(CONFIG_PACKAGE_COLLECTD_DEBUG_OUTPUT_ENABLE),y) +CONFIGURE_ARGS+= \ + --enable-debug +else +CONFIGURE_ARGS+= \ + --disable-debug +endif + CONFIGURE_PLUGIN= \ $(foreach m, $(1), \ $(if $(CONFIG_PACKAGE_collectd-mod-$(subst _,-,$(m))),--enable-$(m),--disable-$(m)) \ @@ -318,6 +337,15 @@ ifneq ($(CONFIG_PACKAGE_collectd-mod-rrdtool),) CONFIGURE_ARGS+= --with-librrd="$(STAGING_DIR)/usr/lib/rrdtool-1.0" endif +# exception: mod-smart needs libatasmart +ifneq ($(CONFIG_PACKAGE_collectd-mod-smart),) + CONFIGURE_ARGS+= \ + --with-libatasmart="$(STAGING_DIR)/usr" \ + --with-libudev="$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= --without-libudev +endif + define Package/collectd/conffiles /etc/collectd.conf /etc/config/collectd @@ -412,7 +440,7 @@ $(eval $(call BuildPlugin,curl,cURL input,curl,+PACKAGE_collectd-mod-curl:libcur #$(eval $(call BuildPlugin,dbi,relational database input,dbi,+PACKAGE_collectd-mod-dbi:libdbi)) $(eval $(call BuildPlugin,df,disk space input,df,)) $(eval $(call BuildPlugin,dhcpleases,show dhcpleases,dhcpleases,)) -$(eval $(call BuildPlugin,disk,disk usage/timing input,disk,)) +$(eval $(call BuildPlugin,disk,disk usage/timing input,disk,+PACKAGE_collectd-mod-smart:libudev)) $(eval $(call BuildPlugin,dns,DNS traffic input,dns,+PACKAGE_collectd-mod-dns:libpcap)) $(eval $(call BuildPlugin,email,email output,email,)) $(eval $(call BuildPlugin,entropy,Entropy amount input,entropy,)) @@ -452,6 +480,7 @@ $(eval $(call BuildPlugin,protocols,network protocols input,protocols,)) $(eval $(call BuildPlugin,routeros,MikroTik RouterOS input,routeros,+PACKAGE_collectd-mod-routeros:librouteros)) $(eval $(call BuildPlugin,rrdtool,RRDtool output,rrdtool,+PACKAGE_collectd-mod-rrdtool:librrd1)) $(eval $(call BuildPlugin,sensors,lm_sensors input,sensors,+PACKAGE_collectd-mod-sensors:libsensors)) +$(eval $(call BuildPlugin,smart,smart input,smart,+PACKAGE_collectd-mod-smart:libatasmart)) $(eval $(call BuildPlugin,snmp,SNMP input,snmp,+PACKAGE_collectd-mod-snmp:libnetsnmp)) $(eval $(call BuildPlugin,snmp6,snmp6 input,snmp6,)) $(eval $(call BuildPlugin,swap,swap input,swap,)) diff --git a/utils/collectd/files/usr/share/collectd/plugin/smart.json b/utils/collectd/files/usr/share/collectd/plugin/smart.json new file mode 100644 index 000000000..52d624687 --- /dev/null +++ b/utils/collectd/files/usr/share/collectd/plugin/smart.json @@ -0,0 +1,10 @@ +{ + "bool": [ + "IgnoreSelected", + "IgnoreSleepMode", + "UseSerial" + ], + "list": [ + "Disk" + ] +} diff --git a/utils/collectd/patches/933-fix-smart-detection.patch b/utils/collectd/patches/933-fix-smart-detection.patch new file mode 100644 index 000000000..70250d61b --- /dev/null +++ b/utils/collectd/patches/933-fix-smart-detection.patch @@ -0,0 +1,10 @@ +--- a/src/smart.c ++++ b/src/smart.c +@@ -610,7 +610,6 @@ static int smart_read(void) { + return -1; + } + udev_enumerate_add_match_subsystem(enumerate, "block"); +- udev_enumerate_add_match_property(enumerate, "DEVTYPE", "disk"); + udev_enumerate_scan_devices(enumerate); + devices = udev_enumerate_get_list_entry(enumerate); + if (devices == NULL) { |