librenms/includes/discovery/mempools/dnos-ftos.inc.php
Reinier Schoof 7b182e2a80 Improved support for DNOS/FTOS M-Series (#8749)
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`
2018-06-16 12:47:30 +01:00

30 lines
1.4 KiB
PHP

<?php
// Code borrowed and modified from 'powerconnect-cpu.inc.php'
if ($device['os'] == 'dnos' || $device['os'] == 'ftos') {
echo 'DNOS-MEMORY-POOL: ';
if (preg_match('/.6027.1.3.[0-9]+$/', $device['sysObjectID'])) {
$total = snmp_get($device, 'chSysProcessorMemSize.1', '-OvQU', 'F10-S-SERIES-CHASSIS-MIB');
if (is_numeric($total)) {
discover_mempool($valid_mempool, $device, 0, $device['os'], 'Memory Utilization', '1', null, null);
}
} elseif (preg_match('/.6027.1.2.[0-9]+$/', $device['sysObjectID'])) {
$total = snmp_get($device, 'chSysProcessorMemSize.1', '-OvQU', 'F10-C-SERIES-CHASSIS-MIB');
if (is_numeric($total)) {
discover_mempool($valid_mempool, $device, 0, $device['os'], 'Memory Utilization', '1', null, null);
}
} elseif (preg_match('/.6027.1.4.[0-9]+$/', $device['sysObjectID'])) {
$total = str_replace(' percent', '', snmp_get($device, 'dellNetCpuUtilMemUsage.stack.1.1', '-OvQ', 'DELL-NETWORKING-CHASSIS-MIB'));
if (is_numeric($total)) {
discover_mempool($valid_mempool, $device, 0, $device['os'], 'Memory Utilization', '1', null, null);
}
} else {
$free = snmp_get($device, '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.1.1.4.1.0', '-OvQ');
if (is_numeric($free)) {
discover_mempool($valid_mempool, $device, 0, $device['os'], 'Memory Utilization', '1', null, null);
}
}
}