collectd: enable collectd-mod-smart
authorFlorian Eckert <fe@dev.tdt.de>
Mon, 8 Mar 2021 08:56:45 +0000 (09:56 +0100)
committerFlorian Eckert <fe@dev.tdt.de>
Mon, 19 Apr 2021 06:34:07 +0000 (08:34 +0200)
Switching on compilation for collectd smart plugin.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 092902a87ee14e3b4b0b37a4ddb81719ae27fcc8)

utils/collectd/Makefile
utils/collectd/files/usr/share/collectd/plugin/smart.json [new file with mode: 0644]

index a03b5d63370db975f81f782dcd01142c0ac8cfdc..515cda278d3f0d15aafd1cff2fc85c6fedacadb7 100644 (file)
@@ -101,7 +101,6 @@ COLLECTD_PLUGINS_DISABLED:= \
        serial \
        sigrok \
        slurm \
-       smart \
        snmp_agent \
        statsd \
        synproxy \
@@ -184,6 +183,7 @@ COLLECTD_PLUGINS_SELECTED:= \
        routeros \
        rrdtool \
        sensors \
+       smart \
        snmp \
        snmp6 \
        swap \
@@ -251,8 +251,7 @@ CONFIGURE_ARGS+= \
        --enable-daemon \
        --with-nan-emulation \
        --with-libyajl=no \
-       --without-perl-bindings \
-       --without-libudev
+       --without-perl-bindings
 
 CONFIGURE_VARS+= \
        CFLAGS="$$$$CFLAGS $(FPIC)" \
@@ -318,6 +317,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 +420,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 +460,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 (file)
index 0000000..52d6246
--- /dev/null
@@ -0,0 +1,10 @@
+{
+       "bool": [
+               "IgnoreSelected",
+               "IgnoreSleepMode",
+               "UseSerial"
+       ],
+       "list": [
+               "Disk"
+       ]
+}