mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge branch 'fiberhome' of https://github.com/alangregory/librenms into fiberhome
This commit is contained in:
20
includes/discovery/mempools/fiberhome.inc.php
Normal file
20
includes/discovery/mempools/fiberhome.inc.php
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?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);
|
||||||
|
};
|
||||||
|
}
|
||||||
20
includes/discovery/processors/fiberhome.inc.php
Normal file
20
includes/discovery/processors/fiberhome.inc.php
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Management Card(s) CPU 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, "mgrCardCpuUtil.9", "-Ovq", "GEPON-OLT-COMMON-MIB");
|
||||||
|
discover_processor($valid['processor'], $device, "GEPON-OLT-COMMON-MIB::mgrCardCpuUtil.9", "0", "fiberhome", "Hswa 9 Processor", "100", $usage/100, NULL, NULL);
|
||||||
|
};
|
||||||
|
if($card2Status == '1'){
|
||||||
|
$usage = snmp_get($device, "mgrCardCpuUtil.10", "-Ovq", "GEPON-OLT-COMMON-MIB");
|
||||||
|
discover_processor($valid['processor'], $device, "GEPON-OLT-COMMON-MIB::mgrCardCpuUtil.10", "1", "fiberhome", "Hswa 10 Processor", "100", $usage/100, NULL, NULL);
|
||||||
|
};
|
||||||
|
}
|
||||||
16
includes/polling/mempools/fiberhome.inc.php
Normal file
16
includes/polling/mempools/fiberhome.inc.php
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?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