Activate OIDs to existing MIB Polling

Hello All,

====================================

Component Version
LibreNMS 1.54-3-ga912abb
DB Schema 2019_07_03_132417_create_mpls_saps_table (139)
PHP 7.2.19
MySQL 5.5.60-MariaDB
RRDTool 1.4.8
SNMP NET-SNMP 5.7.2
====================================

[OK] Composer Version: 1.8.6
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct

We are trying to add additional OID for mempool from CHECKPOINT-MIB to librenms to monitor OS memory related stuff

snmpwalk -v 3 -l authPriv -u xxxx -a MD5 -A ‘xxxx’ -x AES -X ‘xxx’ x.x.x.x -m /opt/librenms/mibs/checkpoint/CHECKPOINT-MIB fwKmem
CHECKPOINT-MIB::fwKmem-system-physical-mem.0 = Gauge32: 0
CHECKPOINT-MIB::fwKmem-available-physical-mem.0 = Gauge32: 0
CHECKPOINT-MIB::fwKmem-aix-heap-size.0 = Gauge32: 0
CHECKPOINT-MIB::fwKmem-bytes-used.0 = Gauge32: 1144961680
CHECKPOINT-MIB::fwKmem-blocking-bytes-used.0 = Gauge32: 10310648
CHECKPOINT-MIB::fwKmem-non-blocking-bytes-used.0 = Gauge32: 1134651032
CHECKPOINT-MIB::fwKmem-bytes-unused.0 = Gauge32: 0
CHECKPOINT-MIB::fwKmem-bytes-peak.0 = Gauge32: 1332192324
CHECKPOINT-MIB::fwKmem-blocking-bytes-peak.0 = Gauge32: 11614464
CHECKPOINT-MIB::fwKmem-non-blocking-bytes-peak.0 = Gauge32: 1320577860
CHECKPOINT-MIB::fwKmem-bytes-internal-use.0 = Gauge32: 80192
CHECKPOINT-MIB::fwKmem-number-of-items.0 = Gauge32: 5012
CHECKPOINT-MIB::fwKmem-alloc-operations.0 = Gauge32: 1428917
CHECKPOINT-MIB::fwKmem-free-operations.0 = Gauge32: 1423905
CHECKPOINT-MIB::fwKmem-failed-alloc.0 = Gauge32: 0
CHECKPOINT-MIB::fwKmem-failed-free.0 = Gauge32: 0

In order to achieve this we created two gaia.inc.php files in:

/opt/librenms/includes/discovery/mempools/gaia.inc.php // Gaia Discovery - Pastebin.com
/opt/librenms/includes/polling/mempools/gaia.inc.php // Gaia Polling - Pastebin.com

In database the discovery imports a row into mempools but polling does not add any data. Is this the correct way to do this?

Thanks in advance.

Hello!
Did you get it make this working? I am research for a Gaia mempools template as well.

After a lot of tests and research, I think I found the way:

Create the discovery mempools: "./includes/discovery/mempools/gaia.inc.php"
<?php

if ($device['os'] == 'gaia') {
    echo 'GAIA: ';

    $total   = snmp_get($device, 'memTotalReal64.0', '-OvQ', 'CHECKPOINT-MIB', 'checkpoint');
    $used = snmp_get($device, 'memActiveReal64.0', '-OvQ', 'CHECKPOINT-MIB', 'checkpoint');
    $percent    = ($total / $used) * 100;
    $free    = ($total - $used);
    if (is_numeric($total) && is_numeric($used)) {
        discover_mempool($valid_mempool, $device, 0, 'gaia', 'Checkpoint Memory', '1', null, null);
    }
}
Create the polling mempools: "./includes/polling/mempools/gaia.inc.php"
<?php
$mempool['used']  = snmp_get($device, 'memActiveReal64.0', '-OvQ', 'CHECKPOINT-MIB');
$mempool['total'] = snmp_get($device, 'memTotalReal64.0', '-OvQ', 'CHECKPOINT-MIB');
$mempool['free']  = ($mempool['total'] - $mempool['used']);
$mempool['perc']  = ($mempool['used'] / $mempool['total']) * 100;
Add follow at: "/includes/definitions.inc.php"
// Checkpoint Memory
$config['graph_types']['device']['checkpoint_memory'] = ['section' => 'firewall', 'order' => 0, 'descr' => 'Checkpoint Memory'];