AndreySV / check_modbus

Nagios plugin for Modbus TCP and Modbus RTU
GNU General Public License v3.0
14 stars 20 forks source link

Can not install / make. src need updating ? #22

Closed henkhoo closed 6 years ago

henkhoo commented 6 years ago

trying to make /install i get this error. looks like src need to be updated i think. i have not enough skills in doing so.

can someone with the skills have a look at the src please.

i get this error,

In file included from check_modbus.h:30:0, from lock.h:29, from check_modbus.c:35: /usr/local/include/modbus/modbus.h:186:16: note: expected 'uint32_t {aka unsigned int}' but argument is of type 'struct timeval ' MODBUS_API int modbus_set_response_timeout(modbus_t ctx, uint32_t to_sec, uint ^ check_modbus.c:274:3: error: too few arguments to function 'modbus_set_response_timeout' modbus_set_response_timeout(mb, &response_timeout); ^ In file included from check_modbus.h:30:0, from lock.h:29, from check_modbus.c:35: /usr/local/include/modbus/modbus.h:186:16: note: declared here MODBUS_API int modbus_set_response_timeout(modbus_t ctx, uint32_t to_sec, uint ^ Makefile:390: recipe for target 'check_modbus.o' failed make[1]: [check_modbus.o] Error 1 make[1]: Leaving directory '/home/henk/Downloads/check_modbus/src' Makefile:346: recipe for target 'install-recursive' failed make: [install-recursive] Error 1

AndreySV commented 6 years ago

Use stable version of libmodbus. Error happens because libmodbus changed API in its unstable version.

henkhoo commented 6 years ago

Yup, very good. Thanks for fast response.

what i did wrong here ; i installed it with first with apt install libmodbus-dev or libmodbus5 that didn't work, so i cloned it with git. both seems to be not working with check_modbus.

after your hint i removed all i had installed., downloaded the stable via http://libmodbus.org/releases/libmodbus-3.0.6.tar.gz compiled it and after that i compiled your check_modbus without problem.

Thanks for your work.

AndreySV commented 6 years ago

Installtion of libmodbus-dev and libmodbus5 should be enough. Most GNU/Linux distros ship stable version of libmodbus. I've checked it right now on Debian 9/10 system and it works. What exactly didn't work with distro packages? What distro are you using? Which version of libmodbus was in the package?

I fix problem with unstable version of libmodbus later. Thanks for the report.

AndreySV commented 6 years ago

I'll leave the issue open until the problem with unstable version of libmodbus is fixed.