newdevice: Added support for F5 Traffic Management Module memory

This commit is contained in:
pblasquez
2017-03-03 12:38:59 -08:00
committed by Neil Lathwood
parent ad6dafd3a5
commit 680ef0645f
2 changed files with 38 additions and 0 deletions

View 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);
}
}

View 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;