librenms/includes/discovery/mempools/fs-switch.inc.php
PipoCanaja 7e18a07088 FS.COM (Fiberstore) 'GBN' and 'SWITCH' devices support (#9734)
* Basic Support for Fiberstore devices

* Basic Support for Fiberstore devices

* mib files

* sysObjectID added

* mibs added

* MIB corrections + CPU discovery + version and SN

* CodeClimate + mempools

* CodeClimate + mempools

* mempools

* 5800

* testdata

* 5800

* tests

* mempools for 5800

* CodeClimate

* CodeClimate

* Cleaning and comments

* Tests for 5800

* CodeClimate

* Update Fs.php

* init processors[]

* optimized logo

* optimized logo

* optimized logo

* optimized logo

* split FS devices

* split FS devices

* split FS devices - tests

* split FS devices - class

* split FS devices - class

* split FS devices - tests

* removing un-necessry condition

* text and comments
2019-02-10 17:31:25 -06:00

23 lines
899 B
PHP

<?php
//
// Discovery for FS-switch devices.
//
if ($device['os'] == 'fs-switch') {
echo 'FS : ';
$mempools_array = snmpwalk_cache_oid($device, 'memTotalReal', [], 'SWITCH', 'fs');
$mempools_array = snmpwalk_cache_oid($device, 'memTotalFree', $mempools_array, 'SWITCH', 'fs');
$mempools_array = snmpwalk_cache_oid($device, 'memTotalUsed', $mempools_array, 'SWITCH', 'fs');
d_echo($mempools_array);
foreach ($mempools_array as $index => $entry) {
if ($entry['memTotalReal'] > 0) {
d_echo($index.' '.$entry['memTotalReal'].' -> '.$entry['memTotalFree']."\n");
$descr = "Chassis";
$descr .= " Memory";
$usage = $entry['memTotalFree'];
discover_mempool($valid_mempool, $device, $index, 'fs-switch', $descr, '1', null, null);
} //end if
} //end foreach
} //end if
unset($mempools_array);