COMPLETE: Add support for Maipu

includes/definitions/mypoweros.yaml

os: mypoweros
text: 'Maipu MyPower'
type: network
icon: maipu
ifname: true
over:
    - { graph: device_bits, text: 'Device Traffic' }
    - { graph: device_processor, text: 'Processor Usage' }
    - { graph: device_mempool, text: 'Memory Usage' }
discovery:
    - sysObjectID:
        - .1.3.6.1.4.1.5651.1.101.
        - .1.3.6.1.4.1.5651.1.102.
        - .1.3.6.1.4.1.5651.1.103.

add mib file MPIOS-MIB.txt to mibs/

includes/definitions/discovery/mypoweros.yaml for CPU

mib: MPIOS-MIB
modules:
    processors:
        data:
            -
                oid: cpuUtilCurrentUtil
                num_oid: '.1.3.6.1.4.1.5651.3.20.1.1.3.5.1.10.{{ $index }}'
                index: 1

includes/discovery/mempools/mypoweros.inc.php for mem

<?php

if ($device['os'] === 'mypoweros') {
    echo 'MAIPU-MEMORY-POOL: ';
    $usage = snmp_get($device, 'allocBytesPercent.0', '-OvQ', 'MPIOS-MIB');
    if (is_numeric($usage)) {
        discover_mempool($valid_mempool, $device, 0, 'mypoweros', 'Memory', '100', null, null);
    }
}

includes/polling/mempools/mypoweros.inc.php for mem

<?php

echo 'Maipu MemPool';

$memory_total = snmp_get($device, "memoryTotalBytes.0", '-OvQ', 'MPIOS-MIB');
$memory_alloc = snmp_get($device, "numBytesAlloc.0", '-OvQ', 'MPIOS-MIB');
$memory_free = snmp_get($device, "numBytesFree.0", '-OvQ', 'MPIOS-MIB');
$mempool['total'] = $memory_total;
$mempool['used'] = $memory_alloc;
$mempool['free'] = $memory_free;

and the logo

I test it in maipu s6600,s3320 and s3120

Hi,

Do you mind doing it correctly?

https://docs.librenms.org/Developing/os/Initial-Detection/

I test it,all is right

If you dont know how or just dont want to, its ok.

But we cant add support for that without the snmprec file.

Is in the tests section of the link posted before

sorry for my little english.

Do you mean that I need to upload a snmprec file?

https://docs.librenms.org/Developing/os/Test-Units/#example-workflow

You need to do point 6. ./scripts/collect-snmp-data.php -h yourmaipudeviceid

That will generate a file called maipu.snmprec in $libredir/tests/snmpsim/

We need that file to properly add a new OS.

The BEST way of doing all this is if you do it by yourself, following this: https://docs.librenms.org/Developing/Using-Git/

But if you dont know how to do it, we can do it for you with the data you provided, but we need the snmprec file.

I generate this file mypoweros.snmprec for maipu s3320

thanks for your help

@deddey You should probably create a pull request on github to get this merged upstream.

@deddey Check a test #9825

谢谢你们的劳动,我也正在努力学习使用git来提交补丁。
Thank you for your work, and I am working hard to learn to use git to submit patches.

You’re welcome. You did all the work, I’ve only submitted your changes to git.

Im closing this thread as device has been added to master.

REMEMBER to remove your changes to keep receiving updates.

To do it you must run ./scripts/github-remove -d and then ./daily.sh to update your install.

TAKE CARE that command will remove ALL your modified files, so if you has made custom changes they will be removed.