librenms/includes/polling/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

28 lines
1022 B
PHP

<?php
//
// Polling for "fs-switch" mempool_type, which belongs to Fiberstore devices, using
// SWITCH mib
//
$oid = $mempool['mempool_index'];
d_echo('FS Mempool (SWITCHMIB)');
if (!is_array($mempool_cache['fs-switchmib'])) {
d_echo('caching');
$mempool_cache['fs-switchmib'] = snmpwalk_cache_oid($device, 'memTotalReal', [], 'SWITCH', 'fs');
$mempool_cache['fs-switchmib'] = snmpwalk_cache_oid($device, 'memTotalFree', $mempool_cache['fs-switchmib'], 'SWITCH', 'fs');
$mempool_cache['fs-switchmib'] = snmpwalk_cache_oid($device, 'memTotalUsed', $mempool_cache['fs-switchmib'], 'SWITCH', 'fs');
d_echo($mempool_cache);
}
$entry = $mempool_cache['fs-switchmib'][$oid];
//
// Let's do some simple calculation
//
if ($entry['memTotalReal'] > 0) {
$perc = ($entry['memTotalUsed']) / $entry['memTotalReal'] * 100;
$mempool['total'] = ($entry['memTotalReal'] * 1024);
$mempool['used'] = ($entry['memTotalUsed'] * 1024);
$mempool['free'] = ($entry['memTotalFree'] * 1024);
}