AndreySV / check_modbus

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

Request: ModbusRTU over TCP #13

Closed peelman closed 7 years ago

peelman commented 8 years ago

We have some Sena PS110 units that we use to speak RS485 over Ethernet to some devices that can't natively do Modbus RTU or TCP.

There are a few sources that discuss it.

Right now we have Nagios calling a Ruby script, that calls another ruby script, that finally calls modpoll (modbusdriver.com) then parses the output and feeds it back up to Nagios.

I'm trying to whittle these down so that we can either use check_modbus exclusively (we use it for other gear we have that can speak ModbusTCP natively) or at least bring the number of interpreted environments being executed at every check down considerably, as the Nagios server has started to groan under the load (i can optimize Nagios itself all day long, but all these 7-layer-deep scripted checks that were hacked into place are starting to take their toll).

My other alternative is to just replace the Senas with native ModbusTCP to ModbusRTU adapters like these, but I wanted to gather some thoughts on this first; it might even be possible with how things are currently and I'm just not seeing the correct set of flags to pass in. The level of C-fu required to add the feature myself is beyond my ken it seems, otherwise I would love to have this be a pull request instead of an ask.

AndreySV commented 8 years ago

Hi, Nick.

I've been asked for this feature several times before RTU over TCP support #6 already. I've decided to not include this feature into check_modbus, until it's merged into libmodbus library. Unfortunately it's not merged yet.

I strongly recommend you to write a comment to upstream libmodbus repository about your need of this feature to show demand of it. For example here. If nobody rebases the patch to libmodbus's master branch, I am going to do it myself in couple weeks. and we'll see whether Stephane'll merge it or not. This feature is marked for 3.4 release, but it's too far.

If you need quick solution, I'd suggest you to try this check_modbus branch. To get it working you'll need to patch libmodbus library.

peelman commented 8 years ago

Crap, sorry for missing that existing bug. I was afraid it was an upstream restriction. I'm using the packaged version of libmodbus on Ubuntu 14.04 right now, and i'm not sure I want to break that to recompile check_modbus, so I might just be stuck for the moment. At least I'm not the only one...I'll keep my eyes peeled for your pull request over there. The patch looks relatively straightforward, at least for 3.0.6. If this does get merged upstream I will probably undertake the effort to get it installed and update check_modbus (since its unlikely Ubuntu will back port anything newer for libmodbus to 14.04).

peelman commented 7 years ago

For reference I replaced our Sena PS110s with ICP-DAS Modbus gateways (tGW-712 and tGW-725's). They are much more responsive (the Senas were dropping packets or would randomly return erroneous values). The tGW's use regular ModbusTCP, and thereby they are a lot easier to deal with from a monitoring and/or scripting perspective.