Collect data via modbus and input or make available to LibreNMS

We are in the middle of R&D on a battery backup project. The charge controller we are planning on only has a Modbus connection. I have ran a LibreNMS instance in the past for a couple months and was happy with it’s capabilities. I would like to marry it together with some intermediate software so I can display and alert on the data retrieved from the modbus devices. I am happy to write that middle-ware if needed but I was just curious what LibreNMS offered for ways to get that data to it?

I see there is an API but it appears to be only for retrieving data FROM LibreNMS.

Can I work with the database directly?

Or should I rather pursue storing my data in a separate database and making it accessible via an SNMP interface so LibreNMS can poll it from there?

Any pointers here would be appreciated.

Hello trendal

I can see multiple ways of doing that.

  • You could use nagios plugins (https://docs.librenms.org/Extensions/Services/). They provide a variety of way to get the data from your device to LibreNMS. That seams to be the easiest solution and does not require any change in LibreNMS sourcecode.
  • You could follow the “application” way. You can look at the actual list of applications and the way they can exchange data with LibreNMS here : https://docs.librenms.org/Extensions/Applications/ .
  • You could write a proper SNMP implementation for your modbus interface to export your modbus data, and create support in LibreNMS to poll it. That variant is probably “overkill”.

Bye
PipoCanaja

Thanks, I’ll look into those options.

I haven’t got deep enough into LibreNMS to figure out how it works yet. It’s a bit daunting on the surface but I think if we are going to go this route I will be able to make it work.