Exemple #1
0
<?php

// JUNOSe Processors
if ($device['os'] == "junose") {
    echo "JUNOSe : ";
    $processors_array = snmpwalk_cache_double_oid($device, "juniSystemModule", $processors_array, "Juniper-System-MIB", $config['install_dir'] . "/mibs/junose");
    if ($debug) {
        print_r($processors_array);
    }
    foreach ($processors_array as $index => $entry) {
        if ($entry['juniSystemModuleCpuUtilPct'] && $entry['juniSystemModuleCpuUtilPct'] != "-1") {
            $entPhysicalIndex = $entry['juniSystemModulePhysicalIndex'];
            $usage_oid = ".1.3.6.1.4.1.4874.2.2.2.1.3.5.1.3." . $index;
            $descr_oid = ".1.3.6.1.4.1.4874.2.2.2.1.3.5.1.6." . $index;
            $descr = $entry['juniSystemModuleDescr'];
            $usage = $entry['juniSystemModuleCpuFiveMinAvgPct'];
            if (!strstr($descr, "No") && !strstr($usage, "No") && $descr != "") {
                discover_processor($valid['processor'], $device, $usage_oid, $index, "junose", $descr, "1", $usage, $entPhysicalIndex, NULL);
            }
        }
    }
}
// End JUNOSe Processors
unset($processors_array);
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage discovery
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
$processors_array = snmpwalk_cache_oid($device, 'wlsxSysXProcessorTable', array(), $mib);
if (is_array($processors_array)) {
    foreach ($processors_array as $index => $entry) {
        if (is_numeric($entry['sysXProcessorLoad']) && is_numeric($index)) {
            $descr = $entry['sysXProcessorDescr'];
            $usage = $entry['sysXProcessorLoad'];
            $oid = "1.3.6.1.4.1.14823.2.2.1.1.1.9.1.3.{$index}";
            discover_processor($valid['processor'], $device, $oid, $index, 'WLSX-SWITCH-MIB', $descr, 1, $usage);
        }
    }
}
unset($processors_array, $index, $descr, $usage, $oid);
// EOF
Exemple #3
0
<?php

if ($device['os'] == 'screenos' && dbFetchCell("SELECT COUNT(*) FROM `processors` WHERE `device_id` = ? AND `processor_type` != 'screenos'", array($device['device_id'])) == '0') {
    // .1.3.6.1.4.1.3224.16.1.3.0 Cpu Last 5 Minutes
    // discover_processor(&$valid, $device, $oid, $index, $type, $descr, $precision = "1", $current = NULL, $entPhysicalIndex = NULL, $hrDeviceIndex = NULL)
    echo 'ScreenOS ';
    $percent = snmp_get($device, '.1.3.6.1.4.1.3224.16.1.3.0', '-OvQ');
    if (is_numeric($percent)) {
        discover_processor($valid['processor'], $device, '.1.3.6.1.4.1.3224.16.1.3.0', '1', 'screenos', 'Processor', '1', $percent, null, null);
    }
}
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage discovery
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
// Force10 C-Series
// chRpmCpuUtil5Min.1 = Gauge32: 47
$processors_array = snmpwalk_cache_oid($device, 'chRpmCpuUtil5Min', array(), $mib);
if (is_array($processors_array)) {
    foreach ($processors_array as $index => $entry) {
        $descr = $index == 1 ? 'CP' : 'RP' . strval($index - 1);
        $oid = ".1.3.6.1.4.1.6027.3.8.1.3.7.1.5.{$index}";
        $usage = $entry['chRpmCpuUtil5Min'];
        discover_processor($valid['processor'], $device, $oid, $index, 'ftos-cseries', $descr, 1, $usage);
    }
}
unset($processors_array, $descr, $oid, $usage, $index, $entry);
// EOF
Exemple #5
0
                $descr = "Processor";
            }
            // Workaround to set fake description for Windows who use Unknown Processor Type
            if ($device['os'] == "windows" && $entry['hrDeviceDescr'] == "Unknown Processor Type") {
                $descr = "Processor";
            }
            $descr = str_replace("CPU ", "", $descr);
            $descr = str_replace("(TM)", "", $descr);
            $descr = str_replace("(R)", "", $descr);
            $old_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("hrProcessor-" . $index . ".rrd");
            $new_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("processor-hr-" . $index . ".rrd");
            if ($debug) {
                echo "{$old_rrd} {$new_rrd}";
            }
            if (is_file($old_rrd)) {
                rename($old_rrd, $new_rrd);
                echo "Moved RRD ";
            }
            if ($device['os'] == "arista-eos" && $index == "1") {
                unset($descr);
            }
            if (isset($descr) && $descr != "An electronic chip that makes the computer work.") {
                discover_processor($valid['processor'], $device, $usage_oid, $index, "hr", $descr, "1", $usage, NULL, $hrDeviceIndex);
            }
            unset($old_rrd, $new_rrd, $descr, $entry, $usage_oid, $index, $usage, $hrDeviceIndex, $descr_array);
        }
        unset($entry);
    }
    unset($hrDevice_oids, $hrDevice_array, $oid);
}
// End hrDevice Processors
 * @subpackage discovery
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
$processors_array = snmpwalk_cache_triple_oid($device, 'snAgentCpuUtilEntry', $processors_array, $mib);
foreach ($processors_array as $index => $entry) {
    if ((isset($entry['snAgentCpuUtilValue']) || isset($entry['snAgentCpuUtil100thPercent'])) && $entry['snAgentCpuUtilInterval'] == 300) {
        #$entPhysicalIndex = $entry['cpmCPUTotalPhysicalIndex'];
        if ($entry['snAgentCpuUtil100thPercent']) {
            $usage_oid = ".1.3.6.1.4.1.1991.1.1.2.11.1.1.6.{$index}";
            $usage = $entry['snAgentCpuUtil100thPercent'];
            $precision = 100;
        } elseif ($entry['snAgentCpuUtilValue']) {
            $usage_oid = ".1.3.6.1.4.1.1991.1.1.2.11.1.1.4.{$index}";
            $usage = $entry['snAgentCpuUtilValue'];
            $precision = 100;
        }
        list($slot, $instance, $interval) = explode('.', $index);
        $descr_oid = 'snAgentConfigModuleDescription.' . $entry['snAgentCpuUtilSlotNum'];
        $descr = snmp_get($device, $descr_oid, '-Oqv', $mib);
        $descr = str_replace('"', '', $descr);
        list($descr) = explode(' ', $descr);
        $descr = 'Slot ' . $entry['snAgentCpuUtilSlotNum'] . ' ' . $descr;
        $descr = $descr . ' [' . $instance . ']';
        if (!strstr($descr, 'No') && !strstr($usage, 'No') && $descr != '') {
            discover_processor($valid['processor'], $device, $usage_oid, $index, 'ironware', $descr, $precision, $usage, $entPhysicalIndex);
        }
    }
}
unset($processors_array);
// EOF
<?php

#root@alpha:/home/observium/dev# snmpwalk -v2c -c // -M mibs -m +NS-ROOT-MIB netscaler.test nsCPUTable
#NS-ROOT-MIB::nsCPUname."cpu0" = STRING: "cpu0"
#NS-ROOT-MIB::nsCPUusage."cpu0" = Gauge32: 0
if ($device['os'] == "netscaler") {
    echo " NetScaler ";
    echo " Caching OIDs:";
    if (!is_array($nsaarray)) {
        $nsarray = array();
        echo " nsCPUTable ";
        $nsarray = snmpwalk_cache_multi_oid($device, "nsCPUTable", $nsarray, "NS-ROOT-MIB");
    }
    foreach ($nsarray as $descr => $data) {
        $current = $data['nsCPUusage'];
        $oid = ".1.3.6.1.4.1.5951.4.1.1.41.6.1.2." . string_to_oid($descr);
        $descr = $data['nsCPUname'];
        discover_processor($valid['processor'], $device, $oid, $descr, "netscaler", $descr, "1", $current, NULL, NULL);
    }
    unset($nsarray, $oid, $descr, $current);
}
<?php

$count = dbFetchCell("SELECT COUNT(*) FROM `processors` WHERE `device_id` = ? AND `processor_type` != 'ucd-old'", array($device['device_id']));
if ($device['os_group'] == 'unix' && $count == '0') {
    echo 'UCD Old: ';
    $system = snmp_get($device, 'ssCpuSystem.0', '-OvQ', 'UCD-SNMP-MIB');
    $user = snmp_get($device, 'ssCpuUser.0', '-OvQ', 'UCD-SNMP-MIB');
    $idle = snmp_get($device, 'ssCpuIdle.0', '-OvQ', 'UCD-SNMP-MIB');
    if (is_numeric($system)) {
        $percent = $system + $user + $idle;
        discover_processor($valid['processor'], $device, 0, 0, 'ucd-old', 'CPU', '1', $system + $user, null, null);
    }
}
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage discovery
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
// HPN-ICF-ENTITY-EXT-MIB::hpnicfEntityExtCpuUsage.30 = INTEGER: 16
// HPN-ICF-ENTITY-EXT-MIB::hpnicfEntityExtCpuUsage.36 = INTEGER: 5
// HPN-ICF-ENTITY-EXT-MIB::hpnicfEntityExtCpuUsage.42 = INTEGER: 5
// HPN-ICF-ENTITY-EXT-MIB::hpnicfEntityExtCpuUsage.48 = INTEGER: 12
$oids = array('hpnicfEntityExtCpuUsage', 'entPhysicalName');
$processors_array = array();
foreach ($oids as $oid) {
    $processors_array = snmpwalk_cache_multi_oid($device, $oid, $processors_array, 'ENTITY-MIB:HPN-ICF-ENTITY-EXT-MIB');
}
foreach ($processors_array as $index => $entry) {
    if ($entry['hpnicfEntityExtCpuUsage'] != 0) {
        $oid = ".1.3.6.1.4.1.11.2.14.11.15.2.6.1.1.1.1.6.{$index}";
        $descr = $entry['entPhysicalName'];
        $usage = $entry['hpnicfEntityExtCpuUsage'];
        discover_processor($valid['processor'], $device, $oid, $index, 'hh3c-fixed', $descr, 1, $usage);
    }
}
unset($processors_array);
// EOF
Exemple #10
0
<?php

//
// Hardcoded discovery of cpu usage on Fortigate devices.
//
// FORTINET-FORTIGATE-MIB::fgSysCpuUsage.0
if ($device['os'] == 'fortigate') {
    echo 'Fortigate : ';
    $descr = 'Processor';
    $usage = snmp_get($device, '.1.3.6.1.4.1.12356.101.4.1.3.0', '-Ovq');
    if (is_numeric($usage)) {
        discover_processor($valid['processor'], $device, '.1.3.6.1.4.1.12356.101.4.1.3.0', '0', 'fortigate-fixed', $descr, '1', $usage, null, null);
    }
}
unset($processors_array);
Exemple #11
0
        foreach ($processors_array as $index => $entry) {
            if (strlen(strstr($entry['jnxOperatingDescr'], 'Routing Engine')) || $entry['jnxOperatingDRAMSize'] && !strpos($entry['jnxOperatingDescr'], 'sensor') && !strstr($entry['jnxOperatingDescr'], 'fan')) {
                if (stripos($entry['jnxOperatingDescr'], 'sensor') || stripos($entry['jnxOperatingDescr'], 'fan')) {
                    continue;
                }
                d_echo($index . ' ' . $entry['jnxOperatingDescr'] . ' -> ' . $entry['jnxOperatingCPU'] . ' -> ' . $entry['jnxOperatingDRAMSize'] . "\n");
                $usage_oid = '.1.3.6.1.4.1.2636.3.1.13.1.8.' . $index;
                $descr = $entry['jnxOperatingDescr'];
                $usage = $entry['jnxOperatingCPU'];
                if (!strstr($descr, 'No') && !strstr($usage, 'No') && $descr != '') {
                    discover_processor($valid['processor'], $device, $usage_oid, $index, 'junos', $descr, '1', $usage, null, null);
                }
            }
        }
    }
    $srx_processors_array = snmpwalk_cache_multi_oid($device, 'jnxJsSPUMonitoringCPUUsage', $srx_processors_array, 'JUNIPER-SRX5000-SPU-MONITORING-MIB', '+' . $config['install_dir'] . '/mibs/junos');
    d_echo($processors_array);
    if (is_array($srx_processors_array)) {
        foreach ($srx_processors_array as $index => $entry) {
            if (isset($index) && $index >= 0) {
                $usage_oid = '.1.3.6.1.4.1.2636.3.39.1.12.1.1.1.4.' . $index;
                $descr = 'CPU';
                // No description in the table?
                $usage = $entry['jnxJsSPUMonitoringCPUUsage'];
                discover_processor($valid['processor'], $device, $usage_oid, $index, 'junos', $descr, '1', $usage, null, null);
            }
        }
    }
}
unset($processors_array);
unset($srx_processors_array);
                    $precision = round(1 / $entry['scale'], 0);
                }
                $usage = snmp_get($device, $entry['oid'], '-OQUvs', $mib);
                $usage = snmp_fix_numeric($usage);
                if (is_numeric($usage)) {
                    if (empty($entry['oid_num'])) {
                        // Use snmptranslate if oid_num not set
                        $entry['oid_num'] = snmp_translate($entry['oid'], $mib);
                    }
                    if (isset($entry['rename_rrd'])) {
                        $old_rrd = 'processor-' . $entry['rename_rrd'];
                        $new_rrd = 'processor-' . $entry_name . '-' . $index;
                        rename_rrd($device, $old_rrd, $new_rrd);
                        unset($old_rrd, $new_rrd);
                    }
                    discover_processor($valid['processor'], $device, $entry['oid_num'], $index, $entry_name, $descr, $precision, $usage, NULL, NULL, $idle);
                    $entry['found'] = TRUE;
                }
            }
            unset($processors_array, $processor, $dot_index, $descr, $i);
            // Clean up
            if (isset($entry['stop_if_found']) && $entry['stop_if_found'] && $entry['found']) {
                break;
            }
            // Stop loop if processor found
        }
    }
}
// Remove processors which weren't redetected here
foreach (dbFetchRows('SELECT * FROM `processors` WHERE `device_id` = ?', array($device['device_id'])) as $test_processor) {
    $processor_index = $test_processor['processor_index'];
 *
 */
echo "处理器 : ";
// Include all discovery modules by supported MIB
$include_dir = "includes/discovery/processors";
include "includes/include-dir-mib.inc.php";
// Detect processors by simple MIB-based discovery :
// FIXME - this should also be extended to understand multiple entries in a table, and take descr from an OID but this is all I need right now :)
foreach ($config['os'][$device['os']]['mibs'] as $mib) {
    if (is_array($config['mibs'][$mib]['processor'])) {
        echo ' ' . $mib . ': ';
        foreach ($config['mibs'][$mib]['processor'] as $entry_name => $entry) {
            echo $entry_name . ' ';
            $usage = snmp_get($device, $entry['oid'], '-OQUvs', $mib, mib_dirs($config['mibs'][$mib]['mib_dir']));
            if (is_numeric($usage)) {
                discover_processor($valid['processor'], $device, $entry['oid_num'], 0, $entry_name, $entry['descr'], 1, $usage);
            }
        }
    }
}
if (OBS_DEBUG && count($valid['processor'])) {
    print_vars($valid['processor']);
}
// Remove processors which weren't redetected here
foreach (dbFetchRows('SELECT * FROM `processors` WHERE `device_id` = ?', array($device['device_id'])) as $test_processor) {
    $processor_index = $test_processor['processor_index'];
    $processor_type = $test_processor['processor_type'];
    $processor_descr = $test_processor['processor_descr'];
    print_debug($processor_index . " -> " . $processor_type);
    if (!$valid['processor'][$processor_type][$processor_index]) {
        echo '-';
}
foreach ($processors_array as $index => $entry) {
    if (is_numeric($entry['cpmCPUTotal5minRev']) || is_numeric($entry['cpmCPUTotal5min'])) {
        $entPhysicalIndex = $entry['cpmCPUTotalPhysicalIndex'];
        if (isset($entry['cpmCPUTotal5minRev'])) {
            $usage_oid = ".1.3.6.1.4.1.9.9.109.1.1.1.1.8." . $index;
            $usage = $entry['cpmCPUTotal5minRev'];
        } elseif (isset($entry['cpmCPUTotal5min'])) {
            $usage_oid = ".1.3.6.1.4.1.9.9.109.1.1.1.1.5." . $index;
            $usage = $entry['cpmCPUTotal5min'];
        }
        if ($entPhysicalIndex) {
            $descr_oid = "entPhysicalName." . $entPhysicalIndex;
            $descr = snmp_get($device, $descr_oid, "-Oqv", "ENTITY-MIB");
        }
        if (!$descr) {
            $descr = "Processor {$index}";
        }
        if (!strstr($descr, "No") && !strstr($usage, "No") && $descr != "") {
            discover_processor($valid['processor'], $device, $usage_oid, $index, "cpm", $descr, "1", $entry['juniSystemModuleCpuUtilPct'], $entPhysicalIndex, NULL);
        }
    }
}
if (!is_array($valid['processor']['cpm'])) {
    $avgBusy5 = snmp_get($device, ".1.3.6.1.4.1.9.2.1.58.0", "-Oqv");
    if (is_numeric($avgBusy5)) {
        discover_processor($valid['processor'], $device, ".1.3.6.1.4.1.9.2.1.58.0", "0", "ios", "Processor", "1", $avgBusy5, NULL, NULL);
    }
}
unset($processors_array);
// EOF
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage discovery
 * @copyright  (C) 2006-2014 Adam Armstrong
 *
 */
// Hardcoded discovery of cpu usage on SmartEdge devices.
//
// RBN-CPU-METER-MIB::rbnCpuMeterFiveMinuteAvg.0
echo " RBN-CPU-METER-MIB ";
$descr = "Processor";
$usage = snmp_get($device, ".1.3.6.1.4.1.2352.2.6.1.3.0", "-Ovq");
if (is_numeric($usage)) {
    discover_processor($valid['processor'], $device, ".1.3.6.1.4.1.2352.2.6.1.3.0", "0", "seos", $descr, "1", $usage, NULL, NULL);
}
// EOF
Exemple #16
0
<?php

///
//  Hardcoded discovery of cpu usage on RADLAN devices.
///
if ($device['os'] == "radlan") {
    echo "RADLAN : ";
    $descr = "Processor";
    $usage = snmp_get($device, ".1.3.6.1.4.1.89.1.9.0", "-OQUvs", "RADLAN-rndMng", $config['mib_dir'] . ":" . $config['mib_dir'] . "/radlan");
    if (is_numeric($usage)) {
        discover_processor($valid['processor'], $device, ".1.3.6.1.4.1.89.1.9.0", "0", "radlan", $descr, "1", $usage, NULL, NULL);
    }
}
unset($processors_array);
<?php

//  Hardcoded discovery of cpu usage on WatchGuard devices.
//
//  WATCHGUARD-SYSTEM-STATISTICS-MIB::wgSystemCpuUtil5.0 = COUNTER: 123
echo " WATCHGUARD-SYSTEM-STATISTICS-MIB ";
$descr = "Processor";
$usage = snmp_get($device, ".1.3.6.1.4.1.3097.6.3.78.0", "-OQUvs", "WATCHGUARD-SYSTEM-STATISTICS-MIB", $config['mib_dir'] . ':' . mib_dirs('watchguard'));
if (is_numeric($usage)) {
    discover_processor($valid['processor'], $device, "1.3.6.1.4.1.3097.6.3.78.0", "0", "firebox-fixed", $descr, "100", $usage, NULL, NULL);
}
// EOF
Exemple #18
0
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage discovery
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
$processors_array = snmpwalk_cache_oid($device, 'zxr10SystemUnitTable', array(), $mib);
$processors_count = count($processors_array);
//print_vars($processors_array);
foreach ($processors_array as $index => $entry) {
    if ($entry['zxr10SystemUnitRunStatus'] == 'down') {
        continue;
    }
    $descr = 'CPU';
    if ($processors_count > 1) {
        $descr = 'Unit ' . $index . ' ' . $descr;
    }
    if (is_numeric($entry['zxr10SystemCpuUtility5m'])) {
        $oid_name = 'zxr10SystemCpuUtility5m';
        $oid_num = '.1.3.6.1.4.1.3902.3.3.1.1.12.' . $index;
    } else {
        $oid_name = 'zxr10SystemCpuUtility2m';
        $oid_num = '.1.3.6.1.4.1.3902.3.3.1.1.5.' . $index;
    }
    $type = $mib . '-' . $oid_name;
    $usage = $entry[$oid_name];
    discover_processor($valid['processor'], $device, $oid_num, $index, $type, $descr, 1, $usage);
}
unset($processors_array);
// EOF
Exemple #19
0
<?php

if ($device['os'] == "nos") {
    echo "nos : ";
    $descr = "CPU";
    $usage = snmp_get($device, "1.3.6.1.4.1.1588.2.1.1.1.26.1.0", "-Ovq");
    if (is_numeric($usage)) {
        discover_processor($valid['processor'], $device, "1.3.6.1.4.1.1588.2.1.1.1.26.1", "0", "nos", $descr, "1", $usage, null, null);
    }
}
unset($processors_array);
Exemple #20
0
<?php

/*
 * LibreNMS Cisco Small Business CPU 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'] == 'ciscosb') {
    echo 'Cisco SB : ';
    $descr = 'CPU';
    $usage = snmp_get($device, 'rlCpuUtilDuringLastMinute.0', '-Ovqn', 'CISCOSB-rndMng');
    if (is_numeric($usage)) {
        discover_processor($valid['processor'], $device, 'CISCOSB-rndMng::rlCpuUtilDuringLastMinute.0', '0', 'ciscosb', $descr, '1', $usage, null, null);
    }
}
unset($processors_array);
Exemple #21
0
<?php

if ($device['os'] == 'datacom') {
    echo 'Datacom Switch : ';
    $descr = 'Processor';
    $usage = snmp_get($device, 'swCpuUsage.0', '-Ovq', 'DMswitch-MIB');
    echo $usage . "\n";
    if (is_numeric($usage)) {
        discover_processor($valid['processor'], $device, 'swCpuUsage', '0', 'datacom', $descr, '1', substr($usage, 0, 2), null, null);
    }
}
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage discovery
 * @copyright  (C) 2006-2014 Adam Armstrong
 *
 */
echo " NETSCREEN-RESOURCE-MIB ";
if (dbFetchCell("SELECT COUNT(*) FROM `processors` WHERE `device_id` = ? AND `processor_type` != 'screenos'", array($device['device_id'])) == "0") {
    # .1.3.6.1.4.1.3224.16.1.3.0 Cpu Last 5 Minutes
    # discover_processor(&$valid, $device, $oid, $index, $type, $descr, $precision = "1", $current = NULL, $entPhysicalIndex = NULL, $hrDeviceIndex = NULL)
    $percent = snmp_get($device, ".1.3.6.1.4.1.3224.16.1.3.0", "-OvQ");
    if (is_numeric($percent)) {
        discover_processor($valid['processor'], $device, ".1.3.6.1.4.1.3224.16.1.3.0", "1", "screenos", "Processor", "1", $percent, NULL, NULL);
    }
    unset($percent);
}
// EOF
Exemple #23
0
                $usage_oid = ".1.3.6.1.4.1.2636.3.1.13.1.8." . $index;
                $descr = $entry['jnxOperatingDescr'];
                $usage = $entry['jnxOperatingCPU'];
                if (!strstr($descr, "No") && !strstr($usage, "No") && $descr != "") {
                    discover_processor($valid['processor'], $device, $usage_oid, $index, "junos", $descr, "1", $usage, NULL, NULL);
                }
            }
            // End if checks
        }
        // End Foreach
    }
    // End if array
    $srx_processors_array = snmpwalk_cache_multi_oid($device, "jnxJsSPUMonitoringCPUUsage", $srx_processors_array, "JUNIPER-SRX5000-SPU-MONITORING-MIB", '+' . $config['install_dir'] . "/mibs/junos");
    if ($debug) {
        print_r($processors_array);
    }
    if (is_array($srx_processors_array)) {
        foreach ($srx_processors_array as $index => $entry) {
            if (isset($index) && $index >= 0) {
                $usage_oid = ".1.3.6.1.4.1.2636.3.39.1.12.1.1.1.4." . $index;
                $descr = "CPU";
                # No description in the table?
                $usage = $entry['jnxJsSPUMonitoringCPUUsage'];
                discover_processor($valid['processor'], $device, $usage_oid, $index, "junos", $descr, "1", $usage, NULL, NULL);
            }
        }
    }
}
// End JUNOS Processors
unset($processors_array);
unset($srx_processors_array);
<?php

// Cisco Small Business
# CISCOSB-rndMng::rlCpuUtilEnable.0 = INTEGER: true(1)
# CISCOSB-rndMng::rlCpuUtilDuringLast5Minutes.0 = INTEGER: 4
echo " CISCOSB-rndMng ";
$data = snmp_get_multi($device, 'rlCpuUtilEnable.0 rlCpuUtilDuringLast5Minutes.0', "-OQUs", "CISCOSB-rndMng", mib_dirs(array('ciscosb')));
$descr = "CPU";
$index = 0;
$oid = ".1.3.6.1.4.1.9.6.1.101.1.9.{$index}";
$usage = $data[0]['rlCpuUtilDuringLast5Minutes'];
if ($data[0]['rlCpuUtilEnable'] == 'true') {
    discover_processor($valid['processor'], $device, $oid, $index, "ciscosb", $descr, "1", $usage, NULL, NULL);
}
// EOF
<?php

//  Hardcoded discovery of device CPU usage on Alcatel-Lucent Omniswitches.
echo " ALCATEL-IND1-HEALTH-MIB ";
$descr = "Device CPU";
$usage = snmp_get($device, "1.3.6.1.4.1.6486.800.1.2.1.16.1.1.1.13.0", "-OQUvs", "ALCATEL-IND1-HEALTH-MIB", mib_dirs('aos'));
if (is_numeric($usage)) {
    discover_processor($valid['processor'], $device, "1.3.6.1.4.1.6486.800.1.2.1.16.1.1.1.13.0", "0", "aos-system", $descr, "1", $usage, NULL, NULL);
}
// EOF
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage discovery
 * @copyright  (C) 2006-2014 Adam Armstrong
 *
 */
// Force10 E-Series
#F10-CHASSIS-MIB::chRpmCpuUtil5Min.1 = Gauge32: 34
#F10-CHASSIS-MIB::chRpmCpuUtil5Min.2 = Gauge32: 34
#F10-CHASSIS-MIB::chRpmCpuUtil5Min.3 = Gauge32: 34
echo " F10-CHASSIS-MIB ";
$processors_array = snmpwalk_cache_oid($device, "chRpmCpuUtil5Min", array(), "F10-CHASSIS-MIB", mib_dirs('force10'));
if ($debug) {
    print_vars($processors_array);
}
if (is_array($processors_array)) {
    foreach ($processors_array as $index => $entry) {
        $descr = $index == 1 ? "CP" : "RP" . strval($index - 1);
        $oid = ".1.3.6.1.4.1.6027.3.1.1.3.7.1.5." . $index;
        $usage = $entry['chRpmCpuUtil5Min'];
        discover_processor($valid['processor'], $device, $oid, $index, "ftos-eseries", $descr, "1", $usage, NULL, NULL);
    }
}
unset($processors_array);
// EOF
Exemple #27
0
<?php

/*
 * LibreNMS LigoWave Infinity CPU 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 'LigoWave Infinity: ';
    $descr = 'CPU';
    $usage = snmp_get($device, '.1.3.6.1.4.1.10002.1.1.1.4.2.1.3.2', '-Ovqn');
    if (is_numeric($usage)) {
        discover_processor($valid['processor'], $device, '.1.3.6.1.4.1.10002.1.1.1.4.2.1.3.2', '0', 'infinity', $descr, '1', $usage, null, null);
    }
}
unset($processors_array);
Exemple #28
0
<?php

/*
 * LibreNMS Pulse Secure OS information module
 *
 * Copyright (c) 2015 Christophe Martinet Chrisgfx <*****@*****.**>
 * 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.
*/
//
// Hardcoded discovery of CPU usage on Pulse Secure devices.
//
if ($device['os'] == 'pulse') {
    echo 'Pulse Secure : ';
    $descr = 'Processor';
    $usage = str_replace('"', "", snmp_get($device, 'PULSESECURE-PSG-MIB::iveCpuUtil.0', '-OvQ'));
    if (is_numeric($usage)) {
        discover_processor($valid['processor'], $device, 'PULSESECURE-PSG-MIB::iveCpuUtil.0', '0', 'pulse-cpu', $descr, '100', $usage, null, null);
    }
}
<?php

///
//  Hardcoded discovery of cpu usage on HP Procurve devices.
///
//  STATISTICS-MIB::hpSwitchCpuStat.0 = INTEGER: 10
if ($device['os'] == "procurve") {
    echo "Procurve : ";
    $descr = "Processor";
    $usage = snmp_get($device, ".1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0", "-OQUvs", "STATISTICS-MIB", mib_dirs('hp'));
    if (is_numeric($usage)) {
        discover_processor($valid['processor'], $device, "1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0", "0", "procurve-fixed", $descr, "1", $usage, NULL, NULL);
    }
}
unset($processors_array);
Exemple #30
0
<?php

if ($device['os'] == "datacom") {
    echo "Datacom Switch : ";
    $descr = "Processor";
    $usage = snmp_get($device, "swCpuUsage.0", "-Ovq", "DMswitch-MIB");
    echo $usage . "\n";
    if (is_numeric($usage)) {
        discover_processor($valid['processor'], $device, "swCpuUsage", "0", "datacom", $descr, "1", substr($usage, 0, 2), NULL, NULL);
    }
}