mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-27 00:25:06 +02:00
Added Fiberhome Mempools Discovery/Pooler
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* Management Card(s) Memory usage
|
||||
*
|
||||
*/
|
||||
if ($device['os'] == "fiberhome") {
|
||||
/**
|
||||
* Check if Card is installed
|
||||
*/
|
||||
$card1Status = snmp_get($device, "mgrCardWorkStatus.9", "-Ovq", "GEPON-OLT-COMMON-MIB");
|
||||
$card2Status = snmp_get($device, "mgrCardWorkStatus.10", "-Ovq", "GEPON-OLT-COMMON-MIB");
|
||||
if($card1Status == '1'){
|
||||
$usage = snmp_get($device, "mgrCardMemUtil.9", "-Ovq", "GEPON-OLT-COMMON-MIB");
|
||||
discover_mempool($valid_mempool, $device, 9 , "fiberhome", "Hswa 9 Memory", "100", NULL, NULL);
|
||||
};
|
||||
if($card2Status == '1'){
|
||||
$usage = snmp_get($device, "mgrCardMemUtil.10", "-Ovq", "GEPON-OLT-COMMON-MIB");
|
||||
discover_mempool($valid_mempool, $device, 10 , "fiberhome", "Hswa 10 Memory", "100", NULL, NULL);
|
||||
};
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* Memory percent
|
||||
*/
|
||||
$cardIndex = "mgrCardMemUtil.".$mempool['mempool_index'];
|
||||
$usage = snmp_get($device, $cardIndex, "-Ovq", "GEPON-OLT-COMMON-MIB");
|
||||
$perc = round($usage/100);
|
||||
/**
|
||||
* Manual memory 256Mb on each board
|
||||
*/
|
||||
$memory_available = 256*pow(1024,2);
|
||||
$mempool['total'] = $memory_available;
|
||||
if (is_numeric($perc)){
|
||||
$mempool['used'] = $memory_available / 100 * $perc;
|
||||
$mempool['free'] = $memory_available - $mempool['used'];
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user