<?php

if ($device['os'] == "aos") {
    echo "Alcatel-Lucent OS: ";
    $total = snmp_get($device, "systemHardwareMemorySize.0", "-OvQ", "ALCATEL-IND1-SYSTEM-MIB", mib_dirs('aos'));
    $percent = snmp_get($device, "healthDeviceMemoryLatest.0", "-OvQ", "ALCATEL-IND1-HEALTH-MIB", mib_dirs('aos'));
    $used = $total / 100 * $perc_used;
    $free = $total - $used;
    if (is_numeric($total) && is_numeric($used)) {
        discover_mempool($valid_mempool, $device, 0, "aos-device", "Device Memory", "1", NULL, NULL);
    }
}
Beispiel #2
0
<?php

/*
 * LibreNMS Ubiquiti EdgeSwitch memory information module
 *
 * Copyright (c) 2016 Cercel Valentin <*****@*****.**>
 * 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.
 */
if ($device['os'] == "edgeswitch") {
    d_echo('EdgeSwitch Memory:');
    //EdgeSwitch-SWITCHING-MIB::agentSwitchCpuProcessMemFree
    $avail = snmp_get($device, '.1.3.6.1.4.1.4413.1.1.1.1.4.1.0', '-Oqv');
    //EdgeSwitch-SWITCHING-MIB::agentSwitchCpuProcessMemAvailable
    $total = snmp_get($device, '.1.3.6.1.4.1.4413.1.1.1.1.4.2.0', '-Oqv');
    $used = $total - $avail;
    $percent = $used / $total * 100;
    if (is_numeric($total) && is_numeric($avail)) {
        discover_mempool($valid_mempool, $device, 0, 'edgeswitch', 'Memory', '1', null, null);
    }
}
Beispiel #3
0
<?php

if ($device['os'] == 'pbn') {
    echo 'PBN-MEMORY-POOL: ';
    // find out wich build number we have
    preg_match('/^.* Build (?<build>\\d+)/', $device['version'], $version);
    d_echo($version);
    // specified MIB supported since build 16607
    if ($version[build] >= 16607) {
        $mibdir = $config['mibdir'] . '/pbn' . ':' . $config['mibdir'];
        $usage = snmp_get($device, 'nmsMemoryPoolUtilization.0', '-OUvQ', 'NMS-MEMORY-POOL-MIB', $mibdir);
        if (is_numeric($usage)) {
            discover_mempool($valid_mempool, $device, 0, 'pbn-mem', 'Main Memory', '100', null, null);
        }
    }
}
Beispiel #4
0
<?php

/*
 * LibreNMS
 *
 * Copyright (c) 2014 Neil Lathwood <https://github.com/laf/ http://www.lathwood.co.uk/fa>
 *
 * 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.
 */
if ($device['os'] == 'zywall') {
    echo 'Zywall mempool: ';
    $oid = '.1.3.6.1.4.1.890.1.6.22.1.2.0';
    $usage = snmp_get($device, $oid, '-Ovq');
    if (is_numeric($usage)) {
        discover_mempool($valid_mempool, $device, $oid, 'zywall', 'Memory', '1', null, null);
    }
}
Beispiel #5
0
                    continue;
                }
                d_echo($index . ' ' . $entry['jnxOperatingDescr'] . ' -> ' . $entry['jnxOperatingBuffer'] . ' -> ' . $entry['jnxOperatingDRAMSize'] . "\n");
                $usage_oid = '.1.3.6.1.4.1.2636.3.1.13.1.8.' . $index;
                $descr = $entry['jnxOperatingDescr'];
                $usage = $entry['jnxOperatingBuffer'];
                if (!strstr($descr, 'No') && !strstr($usage, 'No') && $descr != '') {
                    discover_mempool($valid_mempool, $device, $index, 'junos', $descr, '1', null, null);
                }
            }
            //end if
        }
        //end foreach
    } else {
        $srx_mempools_array = snmpwalk_cache_multi_oid($device, 'jnxJsSPUMonitoringMemoryUsage', $srx_mempools_array, 'JUNIPER-SRX5000-SPU-MONITORING-MIB', 'junos');
        if (is_array($srx_mempools_array)) {
            foreach ($srx_mempools_array as $index => $entry) {
                if ($index) {
                    $usage_oid = '.1.3.6.1.4.1.2636.3.39.1.12.1.1.1.5.' . $index;
                    $descr = 'Memory';
                    // No description in the table?
                    $usage = $entry['jnxJsSPUMonitoringMemoryUsage'];
                    discover_mempool($valid_mempool, $device, $index, 'junos', $descr, '1', null, null);
                }
            }
        }
    }
}
//end if
unset($mempools_array);
unset($srx_mempools_array);
Beispiel #6
0
<?php

# lookup for memory data
$data = snmp_walk($device, "extremeMemoryMonitorSystemTable", "-Oqs", "EXTREME-BASE-MIB", mib_dirs('extreme'));
if (strstr($data, 'extremeMemoryMonitorSystemTotal')) {
    discover_mempool($valid_mempool, $device, 0, "xos", "Memory", "1024", NULL, NULL);
    if ($debug) {
        foreach (explode("\n", $data) as $entry) {
            $t = explode(" ", $entry, 2);
            if (strstr($t[0], 'extremeMemoryMonitorSystemTotal')) {
                echo sprintf("Memory: Total %d (KB)", $t[1]);
            }
        }
    }
}
<?php

//  TRAPEZE-NETWORKS-SYSTEM-MIB::trpzSysCpuMemorySize.0
//  TRAPEZE-NETWORKS-SYSTEM-MIB::trpzSysCpuMemoryLast5MinutesUsage.0
$mib = 'TRAPEZE-NETWORKS-SYSTEM-MIB';
echo " {$mib} ";
$descr = "Memory";
$used = snmp_get($device, "trpzSysCpuMemoryLast5MinutesUsage.0", "-OQUvs", $mib, mib_dirs('trapeze'));
$total = snmp_get($device, "trpzSysCpuMemorySize.0", "-OQUvs", $mib, mib_dirs('trapeze'));
$used *= 1024;
$total *= 1024;
if (is_numeric($used) && is_numeric($total)) {
    discover_mempool($valid['mempool'], $device, 0, $mib, $descr, 1024, $total, $used);
}
unset($descr, $total, $used);
// EOF
Beispiel #8
0
<?php

// NETSWITCH-MIB::hpLocalMemSlotIndex.1 = INTEGER: 1
// NETSWITCH-MIB::hpLocalMemSlabCnt.1 = Counter32: 3966
// NETSWITCH-MIB::hpLocalMemFreeSegCnt.1 = Counter32: 166
// NETSWITCH-MIB::hpLocalMemAllocSegCnt.1 = Counter32: 3803
// NETSWITCH-MIB::hpLocalMemTotalBytes.1 = INTEGER: 11337704
// NETSWITCH-MIB::hpLocalMemFreeBytes.1 = INTEGER: 9669100
// NETSWITCH-MIB::hpLocalMemAllocBytes.1 = INTEGER: 1668732
// NETSWITCH-MIB::hpGlobalMemSlotIndex.1 = INTEGER: 1
// NETSWITCH-MIB::hpGlobalMemSlabCnt.1 = Counter32: 3966
// NETSWITCH-MIB::hpGlobalMemFreeSegCnt.1 = Counter32: 166
// NETSWITCH-MIB::hpGlobalMemAllocSegCnt.1 = Counter32: 3803
// NETSWITCH-MIB::hpGlobalMemTotalBytes.1 = INTEGER: 11337704
// NETSWITCH-MIB::hpGlobalMemFreeBytes.1 = INTEGER: 9669104
// NETSWITCH-MIB::hpGlobalMemAllocBytes.1 = INTEGER: 1668728
$array = snmpwalk_cache_oid($device, 'hpLocal', null, 'NETSWITCH-MIB', $config['mibdir'] . ':' . $config['mibdir'] . '/hp');
$array = snmpwalk_cache_oid($device, 'hpGlobal', $array, 'NETSWITCH-MIB', $config['mibdir'] . ':' . $config['mibdir'] . '/hp');
if (is_array($array)) {
    echo 'Procurve : ';
    foreach ($array as $index => $mempool) {
        if (is_numeric($index) && is_numeric($mempool['hpLocalMemTotalBytes'])) {
            discover_mempool($valid_mempool, $device, $index, 'hpLocal', 'Local Memory ' . $index, null, null, null);
        }
        if (is_numeric($index) && is_numeric($mempool['hpGlobalMemTotalBytes'])) {
            discover_mempool($valid_mempool, $device, $index, 'hpGlobal', 'Global Memory ' . $index, null, null, null);
        }
        unset($deny, $fstype, $descr, $size, $used, $units);
    }
    unset($array);
}
Beispiel #9
0
// Huawei VRP  mempools
if ($device['os'] == "vrp") {
    echo "VRP : ";
    $mempools_array = snmpwalk_cache_multi_oid($device, "hwEntityMemUsage", $mempools_array, "HUAWEI-ENTITY-EXTENT-MIB", mib_dirs('huawei'));
    $mempools_array = snmpwalk_cache_multi_oid($device, "hwEntityMemSize", $mempools_array, "HUAWEI-ENTITY-EXTENT-MIB", mib_dirs('huawei'));
    $mempools_array = snmpwalk_cache_multi_oid($device, "hwEntityBomEnDesc", $mempools_array, "HUAWEI-ENTITY-EXTENT-MIB", mib_dirs('huawei'));
    if ($debug) {
        print_r($mempools_array);
    }
    if (is_array($mempools_array)) {
        foreach ($mempools_array as $index => $entry) {
            if ($entry['hwEntityMemSize'] != 0) {
                if ($debug) {
                    echo $index . " " . $entry['hwEntityBomEnDesc'] . " -> " . $entry['hwEntityMemUsage'] . " -> " . $entry['hwEntityMemSize'] . "\n";
                }
                $usage_oid = ".1.3.6.1.4.1.2011.5.25.31.1.1.1.1.7." . $index;
                $descr = $entry['hwEntityBomEnDesc'];
                $usage = $entry['hwEntityMemUsage'];
                if (!strstr($descr, "No") && !strstr($usage, "No") && $descr != "") {
                    discover_mempool($valid_mempool, $device, $index, "vrp", $descr, "1", NULL, NULL);
                }
            }
            // End if checks
        }
        // End Foreach
    }
    // End if array
}
// End VRP mempools
unset($mempools_array);
Beispiel #10
0
<?php

if ($device['os'] == 'ciscowlc') {
    echo 'Cisco WLC';
    $total = str_replace('"', "", snmp_get($device, "1.3.6.1.4.1.14179.1.1.5.3.0", '-OvQ'));
    $avail = str_replace('"', "", snmp_get($device, "1.3.6.1.4.1.14179.1.1.5.2.0", '-OvQ'));
    if (is_numeric($total) && is_numeric($avail)) {
        discover_mempool($valid_mempool, $device, 0, 'ciscowlc', 'Memory', '1', null, null);
    }
}
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage discovery
 * @copyright  (C) 2006-2014 Adam Armstrong
 *
 */
//TIMETRA-SYSTEM-MIB::sgiMemoryUsed.0 = Gauge32: 300145144 bytes
//TIMETRA-SYSTEM-MIB::sgiMemoryAvailable.0 = Gauge32: 518611632 bytes
//TIMETRA-SYSTEM-MIB::sgiMemoryPoolAllocated.0 = Gauge32: 320917080 bytes
//TIMETRA-SYSTEM-MIB::sgiMemoryUsed.0 = Gauge32: 305605608 bytes
//TIMETRA-SYSTEM-MIB::sgiMemoryAvailable.0 = Gauge32: 600985024 bytes
//TIMETRA-SYSTEM-MIB::sgiMemoryPoolAllocated.0 = Gauge32: 325038952 bytes
/*
  If the value is greater than the maximum value reportable by this
  object then this object reports its maximum value (4,294,967,295)
  and sgiKbMemoryPoolAllocated must be used to determine the total
  memory allocated in memory-pools.

  FIXME: sgiKbMemoryUsed, sgiKbMemoryAvailable, sgiKbMemoryPoolAllocated (use HC bit)
*/
echo " TIMETRA-SYSTEM-MIB ";
$mempool_array = snmpwalk_cache_multi_oid($device, "sgiMemoryAvailable", NULL, "TIMETRA-SYSTEM-MIB");
$mempool_array = snmpwalk_cache_multi_oid($device, "sgiMemoryUsed", $mempool_array, "TIMETRA-SYSTEM-MIB");
if (is_numeric($mempool_array[0]['sgiMemoryUsed'])) {
    discover_mempool($valid['mempool'], $device, 0, "TIMETRA-SYSTEM-MIB", "Memory", 1, $mempool_array[0]['sgiMemoryAvailable'], $mempool_array[0]['sgiMemoryUsed']);
}
unset($mempool_array);
// EOF
<?php

#NETSWITCH-MIB::hpLocalMemSlotIndex.1 = INTEGER: 1
#NETSWITCH-MIB::hpLocalMemSlabCnt.1 = Counter32: 3966
#NETSWITCH-MIB::hpLocalMemFreeSegCnt.1 = Counter32: 166
#NETSWITCH-MIB::hpLocalMemAllocSegCnt.1 = Counter32: 3803
#NETSWITCH-MIB::hpLocalMemTotalBytes.1 = INTEGER: 11337704
#NETSWITCH-MIB::hpLocalMemFreeBytes.1 = INTEGER: 9669100
#NETSWITCH-MIB::hpLocalMemAllocBytes.1 = INTEGER: 1668732
#NETSWITCH-MIB::hpGlobalMemSlotIndex.1 = INTEGER: 1
#NETSWITCH-MIB::hpGlobalMemSlabCnt.1 = Counter32: 3966
#NETSWITCH-MIB::hpGlobalMemFreeSegCnt.1 = Counter32: 166
#NETSWITCH-MIB::hpGlobalMemAllocSegCnt.1 = Counter32: 3803
#NETSWITCH-MIB::hpGlobalMemTotalBytes.1 = INTEGER: 11337704
#NETSWITCH-MIB::hpGlobalMemFreeBytes.1 = INTEGER: 9669104
#NETSWITCH-MIB::hpGlobalMemAllocBytes.1 = INTEGER: 1668728
$array = snmpwalk_cache_oid($device, "hpLocal", NULL, "NETSWITCH-MIB", mib_dirs('hp'));
$array = snmpwalk_cache_oid($device, "hpGlobal", $array, "NETSWITCH-MIB", mib_dirs('hp'));
if (is_array($array)) {
    echo "Procurve : ";
    foreach ($array as $index => $mempool) {
        if (is_numeric($index) && is_numeric($mempool['hpLocalMemTotalBytes'])) {
            discover_mempool($valid_mempool, $device, $index, "hpLocal", "Local Memory " . $index, NULL, NULL, NULL);
        }
        if (is_numeric($index) && is_numeric($mempool['hpGlobalMemTotalBytes'])) {
            discover_mempool($valid_mempool, $device, $index, "hpGlobal", "Global Memory " . $index, NULL, NULL, NULL);
        }
        unset($deny, $fstype, $descr, $size, $used, $units);
    }
    unset($array);
}
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage discovery
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
// NOTE. Because Alcatel changed their MIBs content (same oid names have different indexes), here used only numeric OIDs.
$total = snmp_get($device, '.1.3.6.1.4.1.6486.800.1.1.1.2.1.1.3.4.0', '-OvQ', 'ALCATEL-IND1-SYSTEM-MIB', mib_dirs('aos'));
// systemHardwareMemorySize
$percent = snmp_get($device, '.1.3.6.1.4.1.6486.800.1.2.1.16.1.1.1.10.0', '-OvQ', $mib, mib_dirs('aos'));
// healthModuleMemory1MinAvg
$used = $total / 100 * $percent;
if (is_numeric($total) && is_numeric($percent)) {
    discover_mempool($valid['mempool'], $device, 0, $mib, 'Memory', 1, $total, $used);
}
unset($total, $used, $percent);
// New AOS 7
$total = snmp_get($device, '.1.3.6.1.4.1.6486.801.1.1.1.2.1.1.3.4.0', '-OvQ', 'ALCATEL-IND1-SYSTEM-MIB', mib_dirs('aos7'));
// systemHardwareMemorySize
$percent = snmp_get($device, '.1.3.6.1.4.1.6486.801.1.2.1.16.1.1.1.1.1.8.0', '-OvQ', $mib, mib_dirs('aos7'));
// healthModuleMemory1MinAvg
$used = $total / 100 * $percent;
if (is_numeric($total) && is_numeric($percent)) {
    $total *= 1024;
    // AOS7 reports total memory in MB
    // Use HC bit for new aos
    discover_mempool($valid['mempool'], $device, 0, $mib, 'Memory', 1, $total, $used, 1);
}
unset($total, $used, $percent);
// EOF
<?php

$storage_array = snmp_cache_oid("hrStorageEntry", $device, array(), "HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES");
if (is_array($storage_array)) {
    echo "hrStorage : ";
    foreach ($storage_array[$device[device_id]] as $index => $storage) {
        $fstype = $storage['hrStorageType'];
        $descr = $storage['hrStorageDescr'];
        $size = $storage['hrStorageSize'] * $storage['hrStorageAllocationUnits'];
        $used = $storage['hrStorageUsed'] * $storage['hrStorageAllocationUnits'];
        $units = $storage['hrStorageAllocationUnits'];
        $deny = 1;
        if ($fstype == "hrStorageVirtualMemory" || $fstype == "hrStorageRam") {
            $deny = 0;
        }
        if (strstr($descr, "MALLOC") || strstr($descr, "UMA")) {
            $deny = 1;
        }
        ## Ignore FreeBSD INSANITY
        if (!$deny && is_numeric($index)) {
            discover_mempool($valid_mempool, $device, $index, "hrstorage", $descr, $units, NULL, NULL);
        }
        unset($deny, $fstype, $descr, $size, $used, $units, $storage_rrd, $old_storage_rrd, $storage_array);
    }
}
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage discovery
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
// GBNPlatformOAM-MIB::memorySize.0 = INTEGER: 128
// GBNPlatformOAM-MIB::memoryIdle.0 = INTEGER: 51
$descr = 'Memory';
$free = snmp_get($device, 'memoryIdle.0', '-OQUvs', $mib);
$total = snmp_get($device, 'memorySize.0', '-OQUvs', $mib);
if (is_numeric($free) && is_numeric($total)) {
    //$total *= 1024*1024;
    //$free  *= 1024*1024;
    $used = $total - $free;
    discover_mempool($valid['mempool'], $device, 0, strtolower('GBNPlatformOAM-MIB'), $descr, 1024 * 1024, $total, $used);
    // ^ FIXME why strtolower?
}
unset($descr, $total, $used);
// EOF
Beispiel #16
0
<?php

#NS-ROOT-MIB::resMemUsage.0 = Gauge32: 29
#NS-ROOT-MIB::memSizeMB.0 = INTEGER: 815
if ($device['os'] == "netscaler") {
    discover_mempool($valid_mempool, $device, "0", "netscaler", "Memory", NULL, NULL, NULL);
}
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage discovery
 * @copyright  (C) 2006-2014 Adam Armstrong
 *
 */
$mib = 'ASYNCOS-MAIL-MIB';
echo " {$mib} ";
$percent = snmp_get($device, "perCentMemoryUtilization.0", "-OvQ", $mib, mib_dirs('cisco'));
if (is_numeric($percent)) {
    discover_mempool($valid['mempool'], $device, 0, $mib, "Memory", 1, 100, $percent);
}
unset($percent);
// EOF
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage discovery
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
// APSYSMGMT-MIB not have information about total memory size.
$percent = snmp_get($device, 'apSysMemoryUtil.0', '-OvQ', $mib);
if (is_numeric($percent)) {
    discover_mempool($valid['mempool'], $device, 0, 'APSYSMGMT-MIB', 'Memory', 1, 100, $percent);
}
unset($percent);
// EOF
<?php

// Force10 S-Series
#F10-S-SERIES-CHASSIS-MIB::chStackUnitMemUsageUtil.1 = Gauge32: 86
if ($device['os'] == "ftos" || $device['os_group'] == "ftos") {
    echo "FTOS S-Series ";
    $mempools_array = snmpwalk_cache_oid($device, "chStackUnitMemUsageUtil", array(), "F10-S-SERIES-CHASSIS-MIB", mib_dirs('force10'));
    $mempools_array = snmpwalk_cache_oid($device, "chStackUnitSysType", $mempools_array, "F10-S-SERIES-CHASSIS-MIB", mib_dirs('force10'));
    if ($debug) {
        print_r($mempools_array);
    }
    if (is_array($mempools_array)) {
        foreach ($mempools_array as $index => $entry) {
            $descr = "Unit " . strval($index - 1) . " " . $entry['chStackUnitSysType'];
            discover_mempool($valid_mempool, $device, $index, "ftos-sseries", $descr, NULL, NULL, NULL);
        }
    }
}
unset($mempools_array);
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage discovery
 * @copyright  (C) 2006-2015 Adam Armstrong
 *
 */
// ProxyAV devices hide their CPUs/Memory/Interfaces in here
echo " BLUECOAT-SG-USAGE-MIB ";
$av_array = snmpwalk_cache_oid($device, "deviceUsage", array(), "BLUECOAT-SG-USAGE-MIB", mib_dirs('bluecoat'));
if (OBS_DEBUG > 1) {
    print_vars($av_array);
}
if (is_array($av_array)) {
    foreach ($av_array as $index => $entry) {
        if (strpos($entry['deviceUsageName'], "Memory") !== false) {
            $descr = $entry['deviceUsageName'];
            $oid = ".1.3.6.1.4.1.3417.2.4.1.1.1.4." . $index;
            $perc = $entry['deviceUsagePercent'];
            discover_mempool($valid['mempool'], $device, $index, $mib, $descr, 1, 100, $perc);
        }
    }
}
unset($av_array);
// EOF
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage discovery
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
// RBN-MEMORY-MIB::rbnMemoryKBytesInUse.1
// RBN-MEMORY-MIB::rbnMemoryFreeKBytes.1
// FIXME should be oid names?
$used = snmp_get($device, '.1.3.6.1.4.1.2352.2.16.1.2.1.4.1', '-OvQ', $mib);
$free = snmp_get($device, '.1.3.6.1.4.1.2352.2.16.1.2.1.3.1', '-OvQ', $mib);
if (is_numeric($free) && is_numeric($used)) {
    $precision = 1024;
    $total = $used + $free;
    //$total    *= $precision;
    //$used     *= $precision;
    discover_mempool($valid['mempool'], $device, 0, 'RBN-MEMORY-MIB', 'Memory', $precision, $total, $used);
    // Here wrong index, should be '1'
}
unset($precision, $total, $used, $free);
// EOF
Beispiel #22
0
<?php

/*
 * LibreNMS NX-OS memory information module
 *
 * Copyright (c) 2016 Dave Bell <*****@*****.**>
 * 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.
 */
if ($device['os'] == 'nxos') {
    $used = snmp_get($device, '.1.3.6.1.4.1.9.9.109.1.1.1.1.12.1', '-OvQ');
    $free = snmp_get($device, '.1.3.6.1.4.1.9.9.109.1.1.1.1.13.1', '-OvQ');
    if (is_numeric($used) && is_numeric($free)) {
        discover_mempool($valid_mempool, $device, 0, 'nxos', 'Memory', '1', null, null);
    }
}
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage discovery
 * @copyright  (C) 2006-2014 Adam Armstrong
 *
 */
$mib = 'AIRESPACE-SWITCHING-MIB';
echo " {$mib} ";
//AIRESPACE-SWITCHING-MIB::agentFreeMemory.0 = 466732
//AIRESPACE-SWITCHING-MIB::agentTotalMemory.0 = 1000952
$free = snmp_get($device, 'agentFreeMemory.0', '-OQUvs', $mib);
$total = snmp_get($device, 'agentTotalMemory.0', '-OQUvs', $mib);
$units = 1024;
if (is_numeric($free) && is_numeric($total)) {
    $free *= $units;
    $total *= $units;
    $used = $total - $free;
    discover_mempool($valid['mempool'], $device, 0, $mib, 'Memory', $units, $total, $used);
}
unset($total, $used, $free, $units);
// EOF
Beispiel #24
0
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage discovery
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
// Hardcoded for VDX switches that has 2GB of RAM includes all the current models.
$total = 2147483648;
$percent = snmp_get($device, 'swMemUsage.0', '-Ovq', $mib);
$used = $total * $percent / 100;
if (is_numeric($percent)) {
    discover_mempool($valid['mempool'], $device, 0, 'SW-MIB', 'Memory', 1, $total, $used);
}
unset($total, $used, $percent);
// EOF
            case 'nwhrStorageDOSMemory':
            case 'nwhrStorageMemoryAlloc':
            case 'nwhrStorageMemoryPermanent':
            case 'nwhrStorageCacheBuffers':
            case 'nwhrStorageCacheMovable':
            case 'nwhrStorageCacheNonMovable':
            case 'nwhrStorageCodeAndDataMemory':
            case 'nwhrStorageIOEngineMemory':
            case 'nwhrStorageMSEngineMemory':
            case 'nwhrStorageUnclaimedMemory':
                $deny = FALSE;
                break;
        }
        if ($device['os'] == "routeros" && $descr == "main memory") {
            $deny = FALSE;
        }
        if (strstr($descr, "MALLOC") || strstr($descr, "UMA")) {
            $deny = TRUE;
        }
        // Ignore FreeBSD INSANITY
        if (strstr($descr, "procfs") || strstr($descr, "/proc")) {
            $deny = TRUE;
        }
        // Ignore ProcFS
        if (!$deny && is_numeric($entry['hrStorageSize']) && $total) {
            discover_mempool($valid['mempool'], $device, $index, $mib, $descr, $units, $total, $used);
        }
    }
}
unset($mempool_array, $index, $descr, $total, $used, $units, $deny);
// EOF
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage discovery
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
//WLSX-SWITCH-MIB::sysXMemorySize.1 = INTEGER: 1535900
//WLSX-SWITCH-MIB::sysXMemoryUsed.1 = INTEGER: 412060
//WLSX-SWITCH-MIB::sysXMemoryFree.1 = INTEGER: 1123840
$descr = 'Memory';
$used = snmp_get($device, 'sysXMemoryUsed.1', '-OQUvs', $mib);
$total = snmp_get($device, 'sysXMemorySize.1', '-OQUvs', $mib);
if (is_numeric($used) && is_numeric($total)) {
    //$used  *= 1024;
    //$total *= 1024;
    discover_mempool($valid['mempool'], $device, 0, 'WLSX-SWITCH-MIB', $descr, 1024, $total, $used);
}
unset($descr, $total, $used);
// EOF
<?php

$mib = 'NETSCREEN-RESOURCE-MIB';
echo " {$mib} ";
$used = snmp_get($device, "nsResMemAllocate.0", "-OvQ", $mib, mib_dirs('netscreen'));
$free = snmp_get($device, "nsResMemLeft.0", "-OvQ", $mib, mib_dirs('netscreen'));
if (is_numeric($free) && is_numeric($used)) {
    $total = $free + $used;
    discover_mempool($valid['mempool'], $device, 0, $mib, "Memory", 1, $total, $used);
}
unset($total, $used, $free);
// EOF
Beispiel #28
0
<?php

/*
 * LibreNMS LigoWave Inifinity memory information module
 *
 * Copyright (c) 2015 Mike Rostermund <*****@*****.**>
 * 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.
 */
if ($device['os'] == 'infinity') {
    echo 'INFINITY-MEMORY-POOL: ';
    $total = snmp_get($device, '.1.3.6.1.4.1.10002.1.1.1.1.1.0', '-OvQ');
    $free = snmp_get($device, '.1.3.6.1.4.1.10002.1.1.1.1.2.0', '-OvQ');
    if (is_numeric($total) && is_numeric($free)) {
        discover_mempool($valid_mempool, $device, 0, 'infinity', 'Memory', '1', null, null);
    }
}
Beispiel #29
0
 */
$mempool_array = snmpwalk_cache_multi_oid($device, 'jnxOperatingBuffer', NULL, $mib);
if (is_array($mempool_array)) {
    $mempool_array = snmpwalk_cache_multi_oid($device, 'jnxOperatingMemory', $mempool_array, $mib);
    $mempool_array = snmpwalk_cache_multi_oid($device, 'jnxOperatingDRAMSize', $mempool_array, $mib);
    $mempool_array = snmpwalk_cache_multi_oid($device, 'jnxOperatingDescr', $mempool_array, $mib);
    foreach ($mempool_array as $index => $entry) {
        $descr = $entry['jnxOperatingDescr'];
        if (stripos($descr, 'sensor') !== FALSE || stripos($descr, 'fan') !== FALSE || stripos($descr, 'pcmcia') !== FALSE) {
            continue;
        }
        if ($entry['jnxOperatingDRAMSize']) {
            $precision = 1;
            $total = $entry['jnxOperatingDRAMSize'];
            // Size in bytes
        } elseif ($entry['jnxOperatingMemory']) {
            $precision = 1024 * 1024;
            $total = $entry['jnxOperatingMemory'];
            // Size in megabytes
        } else {
            continue;
        }
        $percent = $entry['jnxOperatingBuffer'];
        $used = $total * $percent / 100;
        if (!strstr($descr, 'No') && !strstr($percent, 'No') && $descr != '') {
            discover_mempool($valid['mempool'], $device, $index, $mib, $descr, $precision, $total, $used);
        }
    }
}
unset($mempool_array, $index, $descr, $precision, $total, $used, $percent);
// EOF
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage discovery
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
//  TRAPEZE-NETWORKS-SYSTEM-MIB::trpzSysCpuMemorySize.0
//  TRAPEZE-NETWORKS-SYSTEM-MIB::trpzSysCpuMemoryLast5MinutesUsage.0
$descr = 'Memory';
$used = snmp_get($device, 'trpzSysCpuMemoryLast5MinutesUsage.0', '-OQUvs', $mib);
$total = snmp_get($device, 'trpzSysCpuMemorySize.0', '-OQUvs', $mib);
//$used  *= 1024;
//$total *= 1024;
if (is_numeric($used) && is_numeric($total)) {
    discover_mempool($valid['mempool'], $device, 0, 'TRAPEZE-NETWORKS-SYSTEM-MIB', $descr, 1024, $total, $used);
}
unset($descr, $total, $used);
// EOF