This is Nagios plugin for Modbus TCP and RTU. The first version of this plugin was taken from http://exchange.nagios.org/directory/Plugins/Network-and-Systems-Management/Check_modbus_tcp/details
Added many useful features:
In general, plugin can be build as usual
./autogen.sh ./configure make make install
When you are trying to build plugin under MinGW, then maybe you will need to define path for libmodbus explicitly.
libmodbus is installed by default in /usr/local/lib. In MinGW you will need to run
./configure LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include
instead of just ./configure
For usage details see manual page or run ./check_modbus --help.