diff --git a/utils/collectd/Makefile b/utils/collectd/Makefile index 5e80f6dd4..2dcc6c4e8 100644 --- a/utils/collectd/Makefile +++ b/utils/collectd/Makefile @@ -84,6 +84,7 @@ COLLECTD_PLUGINS_SELECTED:= \ logfile \ madwifi \ memory \ + modbus \ mysql \ netlink \ network \ @@ -189,6 +190,11 @@ ifneq ($(CONFIG_PACKAGE_collectd-mod-netlink),) CONFIGURE_ARGS+= --with-libnetlink="$(STAGING_DIR)/usr" endif +# exception: mod-modbus needs libmodbus +ifneq ($(CONFIG_PACKAGE_collectd-mod-modbus),) + CONFIGURE_ARGS+= --with-libmodbus="$(STAGING_DIR)/usr" +endif + # exception: mod-onewire needs libow-capi ifneq ($(CONFIG_PACKAGE_collectd-mod-onewire),) CONFIGURE_ARGS+= --with-libowcapi="$(STAGING_DIR)/usr" @@ -269,6 +275,7 @@ $(eval $(call BuildPlugin,logfile,log files output,logfile,)) $(eval $(call BuildPlugin,madwifi,MadWifi status input,madwifi,)) $(eval $(call BuildPlugin,mysql,MySQL status input,mysql,+PACKAGE_collectd-mod-mysql:libmysqlclient)) $(eval $(call BuildPlugin,memory,physical memory usage input,memory,)) +$(eval $(call BuildPlugin,modbus,read variables through libmodbus,modbus,+PACKAGE_collectd-mod-modbus:libmodbus)) $(eval $(call BuildPlugin,netlink,netlink input,netlink,+PACKAGE_collectd-mod-netlink:ip @(!LINUX_2_4||BROKEN))) $(eval $(call BuildPlugin,network,network input/output,network)) $(eval $(call BuildPlugin,nginx,nginx status input,nginx,+PACKAGE_collectd-mod-nginx:libcurl)) diff --git a/utils/collectd/patches/300-fix-modbus.patch b/utils/collectd/patches/300-fix-modbus.patch new file mode 100644 index 000000000..b1c8861f2 --- /dev/null +++ b/utils/collectd/patches/300-fix-modbus.patch @@ -0,0 +1,23 @@ +--- a/src/modbus.c 2011-03-28 14:51:41.000000000 +0200 ++++ b/src/modbus.c 2011-03-28 14:52:12.000000000 +0200 +@@ -293,10 +293,8 @@ + host->node, host->port); + + modbus_init_tcp (&host->connection, +- /* host = */ host->node); +-#if 0 ++ /* host = */ host->node, + /* port = */ host->port); +-#endif + + status = modbus_connect (&host->connection); + if (status != 0) +@@ -366,7 +367,7 @@ + { + status = read_holding_registers (&host->connection, + /* slave = */ slave->id, /* start_addr = */ data->register_base, +- /* num_registers = */ values_num, /* buffer = */ values); ++ /* num_registers = */ values_num, /* buffer = */ (uint16_t*)values); + if (status > 0) + break; +