dnapper 02a7949c5e newdevice: Added Support for Benu OS (#6857)
* Added Basic OS support for Benu

* Benu OS take 2

* Benu OS take 3

* Benu round 4 - this time for real

* added benu sensors

* reamed to benuos, renamed mibs, sensor rewrite pending

* upated sensors to use snmp_get_multi

* rename yaml

* rename yaml

* updated mempool discover to use multi get, fixed whitepaces, removed old commented out code from polling

* changed detection from sysDescr to sysObjectId

* Update benuos.yaml

* Update benuos.inc.php

* Update benuos.inc.php

* Update benuos.inc.php

* Update benuos.inc.php
2017-06-22 21:45:18 +01:00

14 lines
503 B
PHP

<?php
if ($device['os'] === 'benuos') {
echo 'BENU-HOST-MIB: ';
$memdata = snmp_get_multi($device, 'bSysTotalMem.0 bSysMemUsed.0 bSysMemFree.0', '-OQUs', 'BENU-HOST-MIB');
$total = $memdata[0]['bSysTotalMem'];
$used = $memdata[0]['bSysMemUsed'];
$free = $memdata[0]['bSysMemFree'];
$percent = ($total / $used) * 100;
if (is_numeric($total) && is_numeric($used)) {
discover_mempool($valid_mempool, $device, 0, 'benuos', 'Memory', '1', null, null);
}
}