Bringing unix-agent <<< mem >>> stats into unix os devices

I’m sharing some of the frustrations of the community on the shortcomings of how linux memory is delivered in SNMP:

Sources

Linux Memory Pools reporting wrong

Making Physical Memory graphs valid and worthwile

Memory Pool

https://github.com/librenms/librenms/issues/3179

https://github.com/librenms/librenms/issues/5660

Ideally, Net-SNMP would deliver the proper “Used” memory that we are familiar with from free -h, BUT having to rewrite code in a project like that seems like a lot of work :slight_smile: . Instead, for anyone running the unix-agent (check_mk), memory stats are already being collected and sent to your LibreNMS server, but nothing is being done with it. I would like to start working on a way to include those stats.

I would like some guidance on how to include it. Looking at ./includes/polling/unix-agent.inc.php, there are scripts included from ./includes/polling/unix-agent/ and from ./includes/polling/applications/. Should I write an application module for “mempool”, that would show up under the Apps tab of a device, or write a unix-agent submodule to be used in another module (probably os/unix.inc.php, similar to ‘dmi’)? I think it would be best to not write it to be included in the SNMP mempools section of the device pages, as to signify that the info is being collected differently (SNMP vs check_mk).

Thanks, and let me know any suggestions