mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Current implementation for Force10 series doesn't support the switch-blade M-Series model. This PR adds support for mempools and temperature. In my test environment (still 1.31) I have processors utilization support as well, but I have to test that in the new way processors are handled since 1.37 DO NOT DELETE THIS TEXT #### Please note > Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting. - [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/) #### Testers If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
22 lines
1.5 KiB
PHP
22 lines
1.5 KiB
PHP
<?php
|
|
|
|
// Code below was borrowed from 'powerconnect-cpu.inc.php'
|
|
|
|
if (preg_match('/.6027.1.3.[0-9]+$/', $device['sysObjectID'])) {
|
|
$mempool['total'] = snmp_get($device, 'chSysProcessorMemSize.1', '-OvQU', 'F10-S-SERIES-CHASSIS-MIB');
|
|
$mempool['used'] = $mempool['total'] * (snmp_get($device, 'chStackUnitMemUsageUtil.1', '-OvQU', 'F10-S-SERIES-CHASSIS-MIB')/ 100);
|
|
$mempool['free'] = ($mempool['total'] - $mempool['used']);
|
|
} elseif (preg_match('/.6027.1.2.[0-9]+$/', $device['sysObjectID'])) {
|
|
$mempool['total'] = snmp_get($device, 'chSysProcessorMemSize.1', '-OvQU', 'F10-C-SERIES-CHASSIS-MIB');
|
|
$mempool['used'] = $mempool['total'] * (snmp_get($device, 'chStackUnitMemUsageUtil.1', '-OvQU', 'F10-C-SERIES-CHASSIS-MIB')/ 100);
|
|
$mempool['free'] = ($mempool['total'] - $mempool['used']);
|
|
} elseif (preg_match('/.6027.1.4.[0-9]+$/', $device['sysObjectID'])) {
|
|
$mempool['total'] = snmp_get($device, 'dellNetProcessorMemSize.stack.1.1', '-OvQU', 'DELL-NETWORKING-CHASSIS-MIB');
|
|
$mempool['used'] = $mempool['total'] * (snmp_get($device, 'dellNetCpuUtilMemUsage.stack.1.1', '-OvQU', 'DELL-NETWORKING-CHASSIS-MIB')/ 100);
|
|
$mempool['free'] = ($mempool['total'] - $mempool['used']);
|
|
} else {
|
|
$mempool['total'] = snmp_get($device, '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.1.1.4.2.0', '-OvQ');
|
|
$mempool['free'] = snmp_get($device, '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.1.1.4.1.0', '-OvQ');
|
|
$mempool['used'] = ($mempool['total'] - $mempool['free']);
|
|
}
|