Added Fiberhome Mempools Discovery/Pooler

This commit is contained in:
Alan Gregory
2015-05-22 11:15:42 -03:00
parent 25bf55a172
commit 218636896a
2 changed files with 38 additions and 0 deletions

View File

@@ -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);
};
}
?>

View File

@@ -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'];
}
?>