mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
newdevice: Added support for F5 Traffic Management Module memory
This commit is contained in:
13
includes/discovery/mempools/f5.inc.php
Normal file
13
includes/discovery/mempools/f5.inc.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'f5') {
|
||||
echo 'F5: ';
|
||||
|
||||
$total = snmp_get($device, 'sysGlobalStat.sysStatMemoryTotal.0', '-OvQ', 'F5-BIGIP-SYSTEM-MIB', 'f5');
|
||||
$used = snmp_get($device, 'sysGlobalStat.sysStatMemoryUsed.0', '-OvQ', 'F5-BIGIP-SYSTEM-MIB', 'f5');
|
||||
$percent = ($total / $used) * 100;
|
||||
$free = ($total - $used);
|
||||
if (is_numeric($total) && is_numeric($used)) {
|
||||
discover_mempool($valid_mempool, $device, 0, 'f5', 'TMM Memory', '1', null, null);
|
||||
}
|
||||
}
|
25
includes/polling/mempools/f5.inc.php
Normal file
25
includes/polling/mempools/f5.inc.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* LibreNMS F5 TMM polling module
|
||||
*
|
||||
* Copyright (c) 2017 Paul Blasquez <pblasquez@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or (at your
|
||||
* option) any later version. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
/ F5-BIGIP-SYSTEM-MIB::sysStatMemoryTotal.0 = Counter64: 28638707712
|
||||
/ F5-BIGIP-SYSTEM-MIB::sysStatMemoryUsed.0 = Counter64: 1794195576
|
||||
*/
|
||||
|
||||
|
||||
$mempool['used'] = snmp_get($device, 'sysGlobalStat.sysStatMemoryUsed.0', '-OvQ', 'F5-BIGIP-SYSTEM-MIB');
|
||||
$mempool['total'] = snmp_get($device, 'sysGlobalStat.sysStatMemoryTotal.0', '-OvQ', 'F5-BIGIP-SYSTEM-MIB');
|
||||
$mempool['free'] = ($mempool['total'] - $mempool['used']);
|
||||
$mempool['perc'] = ($mempool['used'] / $mempool['total']) * 100;
|
Reference in New Issue
Block a user