Commit version 24.12.13800

This commit is contained in:
2025-01-06 17:35:06 -05:00
parent b7f6a79c2c
commit 55d9218816
6133 changed files with 4239740 additions and 1374287 deletions

View File

@ -4,20 +4,20 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
$processors_array = snmpwalk_cache_oid($device, 'sgProxyCpuCoreBusyPerCent', [], 'BLUECOAT-SG-PROXY-MIB');
foreach ($processors_array as $index => $entry) {
$descr = ($index == 1) ? 'CPU' : 'CPU' . ($index - 1);
$oid = ".1.3.6.1.4.1.3417.2.11.2.4.1.8.$index";
$usage = $entry['sgProxyCpuCoreBusyPerCent'];
$descr = ($index == 1) ? 'CPU' : 'CPU' . ($index - 1);
$oid = ".1.3.6.1.4.1.3417.2.11.2.4.1.8.$index";
$usage = $entry['sgProxyCpuCoreBusyPerCent'];
discover_processor($valid['processor'], $device, $oid, $index, 'cpu', $descr, 1, $usage);
discover_processor($valid['processor'], $device, $oid, $index, 'cpu', $descr, 1, $usage);
}
unset($processors_array, $descr, $oid, $usage, $index, $entry);

View File

@ -4,9 +4,9 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
@ -15,13 +15,13 @@
$av_array = snmpwalk_cache_oid($device, 'deviceUsage', [], $mib);
foreach ($av_array as $index => $entry) {
if (str_contains($entry['deviceUsageName'], 'CPU')) {
$descr = $entry['deviceUsageName'];
$oid = ".1.3.6.1.4.1.3417.2.4.1.1.1.4.$index";
$usage = $entry['deviceUsagePercent'];
if (str_contains($entry['deviceUsageName'], 'CPU')) {
$descr = $entry['deviceUsageName'];
$oid = ".1.3.6.1.4.1.3417.2.4.1.1.1.4.$index";
$usage = $entry['deviceUsagePercent'];
discover_processor($valid['processor'], $device, $oid, $index, 'cpu', $descr, 1, $usage);
}
discover_processor($valid['processor'], $device, $oid, $index, 'cpu', $descr, 1, $usage);
}
}
unset($av_array, $descr, $oid, $usage, $index, $entry);

View File

@ -5,21 +5,22 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
$pxf_array = snmpwalk_cache_oid($device, 'cePfePerfCurrent5MinUtilization', array(), $mib);
$pxf_array = snmpwalk_cache_oid($device, 'cePfePerfCurrent5MinUtilization', [], $mib);
foreach ($pxf_array as $index => $entry)
{
$descr = 'PXF engine';
if (count($pxf_array) > 1) { $descr .= ' ' . $index; }
foreach ($pxf_array as $index => $entry) {
$descr = 'PXF engine';
if (count($pxf_array) > 1) {
$descr .= ' ' . $index;
}
$oid = ".1.3.6.1.4.1.9.9.265.1.1.2.1.5.$index";
discover_processor($valid['processor'], $device, $oid, $index, 'cisco-entity-pfe-mib', $descr, 1, $entry['cePfePerfCurrent5MinUtilization']);
$oid = ".1.3.6.1.4.1.9.9.265.1.1.2.1.5.$index";
discover_processor($valid['processor'], $device, $oid, $index, 'cisco-entity-pfe-mib', $descr, 1, $entry['cePfePerfCurrent5MinUtilization']);
}
// EOF

View File

@ -4,22 +4,22 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
$array = snmpwalk_cache_oid($device, 'ceqfpUtilizationEntry', [], $mib);
foreach ($array as $index => $entry) {
list($entPhysicalIndex, $interval) = explode('.', $index);
if ($interval === 'fiveMinutes' && is_numeric($entry['ceqfpUtilProcessingLoad'])) {
$descr = snmp_get_oid($device, "entPhysicalName.$entPhysicalIndex", 'ENTITY-MIB');
$usage_oid = ".1.3.6.1.4.1.9.9.715.1.1.6.1.14.$entPhysicalIndex.3";
[$entPhysicalIndex, $interval] = explode('.', $index);
if ($interval === 'fiveMinutes' && is_numeric($entry['ceqfpUtilProcessingLoad'])) {
$descr = snmp_get_oid($device, "entPhysicalName.$entPhysicalIndex", 'ENTITY-MIB');
$usage_oid = ".1.3.6.1.4.1.9.9.715.1.1.6.1.14.$entPhysicalIndex.3";
discover_processor($valid['processor'], $device, $usage_oid, $entPhysicalIndex, 'qfp', $descr, 1, $entry['ceqfpUtilProcessingLoad'], $entPhysicalIndex);
}
discover_processor($valid['processor'], $device, $usage_oid, $entPhysicalIndex, 'qfp', $descr, 1, $entry['ceqfpUtilProcessingLoad'], $entPhysicalIndex);
}
}
// EOF

View File

@ -4,54 +4,45 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2020 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
$processors_array = snmpwalk_cache_oid($device, 'cpmCPU', array(), $mib);
$processors_array = snmpwalk_cache_oid($device, 'cpmCPU', [], $mib);
foreach ($processors_array as $index => $entry)
{
if (is_numeric($entry['cpmCPUTotal5minRev']) || is_numeric($entry['cpmCPUTotal5min']))
{
$entPhysicalIndex = $entry['cpmCPUTotalPhysicalIndex'];
foreach ($processors_array as $index => $entry) {
if (is_numeric($entry['cpmCPUTotal5minRev']) || is_numeric($entry['cpmCPUTotal5min'])) {
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 (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_oid($device, $descr_oid, 'ENTITY-MIB');
}
if (!strlen($descr))
{
$descr = "Processor $index";
}
$descr = '';
if (!safe_empty($entry['cpmCPUTotalPhysicalIndex'])) {
$descr = snmp_cache_oid($device, 'entPhysicalName.' . $entry['cpmCPUTotalPhysicalIndex'], 'ENTITY-MIB');
}
if (safe_empty($descr)) {
$descr = "Processor $index";
}
if (!str_contains($descr, 'No') && !str_contains($usage, 'No') && $descr != '')
{
discover_processor($valid['processor'], $device, $usage_oid, $index, 'cpm', $descr, 1, $usage, $entPhysicalIndex);
if (!str_contains($descr, 'No') && !str_contains($usage, 'No') && $descr != '') {
discover_processor($valid['processor'], $device, $usage_oid, $index, 'cpm', $descr, 1, $usage, $entry['cpmCPUTotalPhysicalIndex']);
}
}
}
}
if (!is_array($valid['processor']['cpm']))
{
// OLD-CISCO-CPU-MIB::avgBusy5
$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);
}
if (!is_array($valid['processor']['cpm'])) {
// OLD-CISCO-CPU-MIB::avgBusy5.0
$avgBusy5 = snmp_get_oid($device, 'avgBusy5.0', 'OLD-CISCO-CPU-MIB', 'cisco'); // not have mib definition
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);
}
}
unset($processors_array);

View File

@ -1,27 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
# CISCOSB-rndMng::rlCpuUtilEnable.0 = INTEGER: true(1)
# CISCOSB-rndMng::rlCpuUtilDuringLast5Minutes.0 = INTEGER: 4
$data = snmp_get_multi_oid($device, 'rlCpuUtilEnable.0 rlCpuUtilDuringLast5Minutes.0', array(), $mib);
$usage = $data[0]['rlCpuUtilDuringLast5Minutes'];
if ($data[0]['rlCpuUtilEnable'] == 'true')
{
discover_processor($valid['processor'], $device, ".1.3.6.1.4.1.9.6.1.101.1.9.0", 0, 'ciscosb', 'CPU', 1, $usage);
}
unset($usage, $data);
// EOF

View File

@ -5,9 +5,9 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
@ -15,32 +15,28 @@
//DELL-NETWORKING-CHASSIS-MIB::dellNetCpuUtil5Min.stack.1.1 = Gauge32: 14 percent
$processors_array = snmpwalk_cache_threepart_oid($device, 'dellNetCpuUtil5Min', array(), $mib, NULL, OBS_SNMP_ALL_NUMERIC_INDEX);
$processors_array = snmpwalk_cache_threepart_oid($device, 'dellNetCpuUtil5Min', [], $mib, NULL, OBS_SNMP_ALL_NUMERIC_INDEX);
//print_vars($processors_array);
foreach ($processors_array as $type => $entry1)
{
// Hrm, this is possible for multiple types?
$first_unit = array_shift(array_keys($entry1));
foreach ($entry1 as $unit => $entry2)
{
$processors_count = count($entry2);
foreach ($entry2 as $processor => $entry)
{
$dot_index = ".{$type}.{$unit}.{$processor}";
$descr = 'Unit ' . strval($unit - $first_unit);
if ($processors_count > 1)
{
$descr .= " Processor {$processor}";
}
$oid_table = 'dellNetCpuUtilTable';
$oid_name = 'dellNetCpuUtil5Min';
$oid_num = ".1.3.6.1.4.1.6027.3.26.1.4.4.1.5{$dot_index}";
$usage = $entry[$oid_name];
foreach ($processors_array as $type => $entry1) {
// Hrm, this is possible for multiple types?
$first_unit = array_shift(array_keys($entry1));
foreach ($entry1 as $unit => $entry2) {
$processors_count = count($entry2);
foreach ($entry2 as $processor => $entry) {
$dot_index = ".{$type}.{$unit}.{$processor}";
$descr = 'Unit ' . strval($unit - $first_unit);
if ($processors_count > 1) {
$descr .= " Processor {$processor}";
}
$oid_table = 'dellNetCpuUtilTable';
$oid_name = 'dellNetCpuUtil5Min';
$oid_num = ".1.3.6.1.4.1.6027.3.26.1.4.4.1.5{$dot_index}";
$usage = $entry[$oid_name];
discover_processor($valid['processor'], $device, $oid_num, $oid_table . $dot_index, $oid_name, $descr, 1, $usage);
discover_processor($valid['processor'], $device, $oid_num, $oid_table . $dot_index, $oid_name, $descr, 1, $usage);
}
}
}
}
unset($processors_array, $dot_index, $entry, $descr, $oid_table, $oid_name, $oid_num, $usage);

View File

@ -1,25 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
// DNOS-SWITCHING-MIB::agentSwitchCpuProcessTotalUtilization.0 = STRING: " 5 Secs ( 6.510%) 60 Secs ( 7.724%) 300 Secs ( 6.3812%)"
$data = snmp_get($device, 'agentSwitchCpuProcessTotalUtilization.0', '-OQUvs', $mib);
if (preg_match('/300 Secs \(\s*(?<proc>[\d\.]+)%\)/', $data, $matches))
{
discover_processor($valid['processor'], $device, '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.1.1.4.9.0', '0', 'dnos-switching-mib', 'Processor', 1, $matches['proc']);
}
unset($data);
// EOF

View File

@ -1,25 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
// EdgeSwitch-SWITCHING-MIB::agentSwitchCpuProcessTotalUtilization.0 = STRING: " 5 Secs ( 99.9999%) 60 Secs ( 99.6358%) 300 Secs ( 99.2401%)"
$data = snmp_get_oid($device, 'agentSwitchCpuProcessTotalUtilization.0', $mib);
if (preg_match('/300 Secs \(\s*(?<proc>[\d\.]+)%\)/', $data, $matches))
{
discover_processor($valid['processor'], $device, '.1.3.6.1.4.1.4413.1.1.1.1.4.9.0', '0', 'edgeswitch-switching-mib', 'Processor', 1, $matches['proc']);
}
unset($data, $matches);
// EOF

View File

@ -4,21 +4,21 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
$processors_array = snmpwalk_cache_oid($device, 'extremeCpuMonitorSystemTable', [], $mib);
foreach ($processors_array as $index => $entry) {
if (is_numeric($entry['extremeCpuMonitorSystemUtilization5mins']) && is_numeric($index)) {
$descr = "Slot $index";
$usage = $entry['extremeCpuMonitorSystemUtilization5mins'];
$oid = ".1.3.6.1.4.1.1916.1.32.1.4.1.9.$index";
discover_processor($valid['processor'], $device, $oid, $index, 'xos', $descr, 1, $usage);
}
if (is_numeric($entry['extremeCpuMonitorSystemUtilization5mins']) && is_numeric($index)) {
$descr = "Slot $index";
$usage = $entry['extremeCpuMonitorSystemUtilization5mins'];
$oid = ".1.3.6.1.4.1.1916.1.32.1.4.1.9.$index";
discover_processor($valid['processor'], $device, $oid, $index, 'xos', $descr, 1, $usage);
}
}
unset($processors_array, $index, $descr, $usage, $oid);

View File

@ -4,9 +4,9 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
@ -16,13 +16,13 @@
$processors_array = snmpwalk_cache_oid($device, 'chRpmCpuUtil5Min', [], $mib);
foreach ($processors_array as $index => $entry) {
foreach ($processors_array as $index => $entry) {
$descr = ($index == 1) ? 'CP' : 'RP' . ($index - 1);
$oid = ".1.3.6.1.4.1.6027.3.8.1.3.7.1.5.$index";
$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);

View File

@ -4,9 +4,9 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
@ -19,11 +19,11 @@
$processors_array = snmpwalk_cache_oid($device, 'chRpmCpuUtil5Min', [], $mib);
foreach ($processors_array as $index => $entry) {
$descr = ($index == 1) ? 'CP' : 'RP' . ($index - 1);
$oid = ".1.3.6.1.4.1.6027.3.1.1.3.7.1.5.$index";
$usage = $entry['chRpmCpuUtil5Min'];
$descr = ($index == 1) ? 'CP' : 'RP' . ($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);
discover_processor($valid['processor'], $device, $oid, $index, 'ftos-eseries', $descr, 1, $usage);
}
unset($processors_array, $descr, $oid, $index, $entry, $usage);

View File

@ -4,9 +4,9 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
@ -16,11 +16,11 @@ $processors_array = snmpwalk_cache_oid($device, 'chStackUnitCpuUtil5Min', [], $m
$processors_array = snmpwalk_cache_oid($device, 'chStackUnitSysType', $processors_array, $mib);
foreach ($processors_array as $index => $entry) {
$descr = 'Unit ' . ($index - 1) . ' ' . $entry['chStackUnitSysType'];
$oid = "1.3.6.1.4.1.6027.3.19.1.2.8.1.4.$index";
$usage = $entry['chStackUnitCpuUtil5Min'];
$descr = 'Unit ' . ($index - 1) . ' ' . $entry['chStackUnitSysType'];
$oid = ".1.3.6.1.4.1.6027.3.19.1.2.8.1.4.$index";
$usage = $entry['chStackUnitCpuUtil5Min'];
discover_processor($valid['processor'], $device, $oid, $index, 'F10-M-SERIES-CHASSIS-MIB', $descr, 1, $usage);
discover_processor($valid['processor'], $device, $oid, $index, 'F10-M-SERIES-CHASSIS-MIB', $descr, 1, $usage);
}
unset($processors_array);

View File

@ -4,9 +4,9 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
@ -18,11 +18,11 @@ $processors_array = snmpwalk_cache_oid($device, 'chStackUnitCpuUtil5Min', [], $m
$processors_array = snmpwalk_cache_oid($device, 'chStackUnitSysType', $processors_array, $mib);
foreach ($processors_array as $index => $entry) {
$descr = 'Unit ' . ($index - 1) . ' ' . $entry['chStackUnitSysType'];
$oid = ".1.3.6.1.4.1.6027.3.10.1.2.9.1.4.$index";
$usage = $entry['chStackUnitCpuUtil5Min'];
$descr = 'Unit ' . ($index - 1) . ' ' . $entry['chStackUnitSysType'];
$oid = ".1.3.6.1.4.1.6027.3.10.1.2.9.1.4.$index";
$usage = $entry['chStackUnitCpuUtil5Min'];
discover_processor($valid['processor'], $device, $oid, $index, 'ftos-sseries', $descr, 1, $usage);
discover_processor($valid['processor'], $device, $oid, $index, 'ftos-sseries', $descr, 1, $usage);
}
unset($processors_array, $index, $entry, $descr, $oid, $usage);

View File

@ -5,22 +5,21 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
$tmm_processor = snmpwalk_cache_oid($device, 'sysTmmStatTmUsageRatio5m', array(), $mib);
$tmm_processor = snmpwalk_cache_oid($device, 'sysTmmStatTmUsageRatio5m', [], $mib);
foreach ($tmm_processor as $index => $entry)
{
$oid = ".1.3.6.1.4.1.3375.2.1.8.2.3.1.39." . snmp_string_to_oid($index);
$descr = "TMM $index Processor";
$usage = $entry['sysTmmStatTmUsageRatio5m'];
foreach ($tmm_processor as $index => $entry) {
$oid = ".1.3.6.1.4.1.3375.2.1.8.2.3.1.39." . snmp_string_to_oid($index);
$descr = "TMM $index Processor";
$usage = $entry['sysTmmStatTmUsageRatio5m'];
// FIXME, when will converted to definition-based, note that here used "named" index instead numeric
discover_processor($valid['processor'], $device, $oid, $index, 'f5-bigip-tmm', $descr, 1, $usage);
// FIXME, when will converted to definition-based, note that here used "named" index instead numeric
discover_processor($valid['processor'], $device, $oid, $index, 'f5-bigip-tmm', $descr, 1, $usage);
}
unset ($tmm_processor, $index, $used);

View File

@ -5,46 +5,42 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
$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'];
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;
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;
}
[$slot, $instance, $interval] = explode('.', $index);
$descr_oid = 'snAgentConfigModuleDescription.' . $entry['snAgentCpuUtilSlotNum'];
$descr = snmp_get($device, $descr_oid, '-Oqv', $mib);
$descr = str_replace('"', '', $descr);
[$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);
}
}
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);

View File

@ -0,0 +1,127 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
/// Derp MIB and data
// FSS-EQPT::eqptShelfOperational-state.'1' = INTEGER: up(1)
// FSS-EQPT::eqptShelfAdministrative-state.'1' = INTEGER: up(1)
// FSS-EQPT::eqptShelfType.'1' = STRING: BDL1-3R11
// FSS-EQPT::eqptShelfPiVendorName.'1' = STRING: FUJITSU
// FSS-EQPT::eqptShelfPiUnitName.'1' = STRING: BDL1-3R11
// FSS-EQPT::eqptShelfPiVendorUnitCode.'1' = STRING: b111
// FSS-EQPT::eqptShelfPiHwRevision.'1' = STRING: 18
// FSS-EQPT::eqptShelfPiPartNumber.'1' = STRING: FC95453R11
// FSS-EQPT::eqptShelfPiClei.'1' = STRING: WOMS610DRD
// FSS-EQPT::eqptShelfPiDom.'1' = STRING: 21.01
// FSS-EQPT::eqptShelfPiSerialNumber.'1' = STRING: 01303
// FSS-EQPT::eqptShelfPiUsi.'1' = STRING: LBFJTU012115453R111801303
// FSS-EQPT::eqptShelfRowstatus.'1' = INTEGER: active(1)
$shelf_array = snmp_cache_table($device, 'eqptShelfEntry', [], 'FSS-EQPT');
if (!snmp_status()) {
return;
}
//print_debug_vars($shelf_array);
// FSS-PM::pmEqptShelfPm-recordTime-period-indexPm-data-value."1".cpuUsage.nearEnd.na.a15-min.0 = STRING: 46.66
// FSS-PM::pmEqptShelfPm-recordTime-period-indexPm-data-value."1".cpuUsage.nearEnd.na.a1-day.0 = STRING: 46.66
// FSS-PM::pmEqptShelfPm-recordTime-period-indexPm-data-value."1".cpuUsageMin.nearEnd.na.a15-min.0 = STRING: 17.83
// FSS-PM::pmEqptShelfPm-recordTime-period-indexPm-data-value."1".cpuUsageMin.nearEnd.na.a1-day.0 = STRING: 16.93
// FSS-PM::pmEqptShelfPm-recordTime-period-indexPm-data-value."1".cpuUsageMax.nearEnd.na.a15-min.0 = STRING: 58.04
// FSS-PM::pmEqptShelfPm-recordTime-period-indexPm-data-value."1".cpuUsageMax.nearEnd.na.a1-day.0 = STRING: 75.12
// FSS-PM::pmEqptShelfPm-recordTime-period-indexPm-data-value."1".cpuUsageAvg.nearEnd.na.a15-min.0 = STRING: 25.32
// FSS-PM::pmEqptShelfPm-recordTime-period-indexPm-data-value."1".cpuUsageAvg.nearEnd.na.a1-day.0 = STRING: 24.66
// Cache this walk because it's shared between several modules
if(isset($_GLOBALS['snmpwalk_cache'][$device['device_id']]['pmEqptShelfPm-recordTime-period-indexPm-data-value'])) {
$walk_array = $_GLOBALS['snmpwalk_cache'][$device['device_id']]['pmEqptShelfPm-recordTime-period-indexPm-data-value'];
} else {
$walk_array = snmpwalk_cache_twopart_oid($device, 'pmEqptShelfPm-recordTime-period-indexPm-data-value', [], 'FSS-PM');
$walk_array = snmpwalk_cache_twopart_oid($device, 'pmEqptShelfPm-recordTime-period-indexPm-validity', $walk_array, 'FSS-PM');
$_GLOBALS['snmpwalk_cache'][$device['device_id']]['pmEqptShelfPm-recordTime-period-indexPm-data-value'] = $walk_array;
}
foreach ($walk_array as $shelf => $array) {
if (!isset($shelf_array[$shelf])) {
continue;
}
print_debug_vars($shelf_array[$shelf]);
$shelf_name = $shelf_array[$shelf]['eqptShelfPiVendorName'] . ' ' . $shelf_array[$shelf]['eqptShelfType'] . " #$shelf";
$shelf_cpu = 0;
foreach ($array as $index_parts => $entry) {
//$entry = array_merge($entry, $shelf_array[$shelf]);
// FSS-PM::pmEqptShelfPm-recordTime-period-indexPm-data-value."1".cpuUsage.nearEnd.na.a15-min.0 = STRING: 46.66
// FSS-PM::pmEqptShelfPm-recordTime-period-indexPm-data-value.1.49.73.0.2.1.0 = STRING: 46.66
[ $recordMontype, $recordLocn, $recordDirn, $recordTime, $recordIndex ] = explode('.', $index_parts);
// Process only CPU Usage here
if ($recordMontype !== 'cpuUsage' || $recordTime !== 'a15-min' || $recordIndex !== 0 ||
$entry['pmEqptShelfPm-recordTime-period-indexPm-validity'] === 'false') {
continue;
}
print_debug_vars($entry);
$shelf_cpu++;
// Convert named index to numeric
// FCMonType from FSS-COMMON-PM-TC
// cpuUsage (73),
// cpuUsageMin (74),
// cpuUsageMax (75),
// cpuUsageAvg (76),
$index = snmp_string_to_oid($shelf) . '.73';
// pmEqptShelfPm-recordLocn OBJECT-TYPE
// SYNTAX INTEGER {nearEnd(0),farEnd(1)}
switch ($recordLocn) {
case 'nearEnd': $index .= '.0'; break;
case 'farEnd': $index .= '.1'; break;
}
// pmEqptShelfPm-recordDirn OBJECT-TYPE
// SYNTAX INTEGER {transmit(0),receive(1),na(2)}
switch ($recordDirn) {
case 'transmit': $index .= '.0'; break;
case 'receive': $index .= '.1'; break;
case 'na': $index .= '.2'; break;
}
// pmEqptShelfPm-recordTime-period-indexTime-period OBJECT-TYPE
// SYNTAX INTEGER {cumulative(0),a15-min(1),a1-day(2),a1-week(3),a1-month(4)}
switch ($recordTime) {
case 'cumulative': $index .= '.0'; break;
case 'a15-min': $index .= '.1'; break;
case 'a1-day': $index .= '.2'; break;
case 'a1-week': $index .= '.3'; break;
case 'a1-month': $index .= '.4'; break;
}
$index .= ".$recordIndex";
print_debug("Index converted: '$shelf.$index_parts' = '$index'");
$oid_name = 'pmEqptShelfPm-recordTime-period-indexPm-data-value';
$oid_num = ".1.3.6.1.4.1.211.1.24.12.800.2.1.3.$index";
$descr = "CPU $shelf_cpu ($shelf_name)";
$usage = $entry[$oid_name];
discover_processor_ng($device, $mib, $oid_name, $oid_num, $index, $descr, 1, $usage);
}
}
unset($walk_array);
// EOF

View File

@ -5,9 +5,9 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
@ -16,22 +16,19 @@
// HH3C-ENTITY-EXT-MIB::hh3cEntityExtCpuUsage.42 = INTEGER: 5
// HH3C-ENTITY-EXT-MIB::hh3cEntityExtCpuUsage.48 = INTEGER: 12
$oids = array('hh3cEntityExtCpuUsage', 'entPhysicalName');
$processors_array = array();
foreach ($oids as $oid)
{
$processors_array = snmpwalk_cache_oid($device, $oid, $processors_array, 'ENTITY-MIB:HH3C-ENTITY-EXT-MIB');
$oids = ['hh3cEntityExtCpuUsage', 'entPhysicalName'];
$processors_array = [];
foreach ($oids as $oid) {
$processors_array = snmpwalk_cache_oid($device, $oid, $processors_array, 'ENTITY-MIB:HH3C-ENTITY-EXT-MIB');
}
foreach ($processors_array as $index => $entry)
{
if ($entry['hh3cEntityExtCpuUsage'] != 0)
{
$oid = ".1.3.6.1.4.1.25506.2.6.1.1.1.1.6.$index";
$descr = $entry['entPhysicalName'];
$usage = $entry['hh3cEntityExtCpuUsage'];
discover_processor($valid['processor'], $device, $oid, $index, 'hh3c-fixed', $descr, 1, $usage);
}
foreach ($processors_array as $index => $entry) {
if ($entry['hh3cEntityExtCpuUsage'] != 0) {
$oid = ".1.3.6.1.4.1.25506.2.6.1.1.1.1.6.$index";
$descr = $entry['entPhysicalName'];
$usage = $entry['hh3cEntityExtCpuUsage'];
discover_processor($valid['processor'], $device, $oid, $index, 'hh3c-fixed', $descr, 1, $usage);
}
}
unset ($processors_array);

View File

@ -4,78 +4,91 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
if (!safe_empty($valid['processor']['cpm'])) {
// Skip HOST-RESOURCES-MIB when CISCO-PROCESS-MIB already discovered
// See: https://jira.observium.org/browse/OBS-4394
return;
}
$hr_array = snmpwalk_cache_oid($device, 'hrProcessorLoad', [], 'HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES');
$hr_count = safe_count($hr_array);
if ($hr_count) {
$hr_array = snmpwalk_cache_oid($device, 'hrDevice', $hr_array, 'HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES');
$hr_array = snmpwalk_cache_oid($device, 'hrDevice', $hr_array, 'HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES');
$hr_cpus = 0;
$hr_total = 0;
foreach ($hr_array as $index => $entry) {
if (!is_numeric($entry['hrProcessorLoad'])) { continue; }
if ($device['os'] === 'arista_eos' && $index == 1) { continue; }
$hr_cpus = 0;
$hr_total = 0;
if (!isset($entry['hrDeviceType'])) {
$entry['hrDeviceType'] = 'hrDeviceProcessor';
$entry['hrDeviceIndex'] = $index;
} elseif ($entry['hrDeviceType'] === 'hrDeviceOther' &&
preg_match('/^cpu\d+:/', $entry['hrDeviceDescr'])) {
// Workaround bsnmpd reporting CPUs as hrDeviceOther (FY FreeBSD.)
$entry['hrDeviceType'] = 'hrDeviceProcessor';
}
if ($entry['hrDeviceType'] === 'hrDeviceProcessor') {
$hrDeviceIndex = $entry['hrDeviceIndex'];
$usage_oid = ".1.3.6.1.2.1.25.3.3.1.2.$index";
$usage = $entry['hrProcessorLoad'];
// Workaround to set fake description for Mikrotik and other who don't populate hrDeviceDescr
if (empty($entry['hrDeviceDescr'])) {
$descr = 'Processor';
if ($hr_count > 1) {
// Append processor index
$descr .= ' ' . ($index - 1);
foreach ($hr_array as $index => $entry) {
if (!is_numeric($entry['hrProcessorLoad'])) {
continue;
}
if ($device['os'] === 'arista_eos' && $index == 1) {
continue;
}
} elseif (str_contains($entry['hrDeviceDescr'], ':')) {
// What is this for? I have forgotten. What has : in its hrDeviceDescr?
// Set description to that found in hrDeviceDescr, first part only if containing a :
list(, $descr) = explode(':', $entry['hrDeviceDescr']);
} else {
$descr = $entry['hrDeviceDescr'];
}
$descr = rewrite_entity_name($descr);
if (!isset($entry['hrDeviceType'])) {
$entry['hrDeviceType'] = 'hrDeviceProcessor';
$entry['hrDeviceIndex'] = $index;
} elseif ($entry['hrDeviceType'] === 'hrDeviceOther' &&
preg_match('/^cpu\d+:/', $entry['hrDeviceDescr'])) {
// Workaround bsnmpd reporting CPUs as hrDeviceOther (FY FreeBSD.)
$entry['hrDeviceType'] = 'hrDeviceProcessor';
}
if ($descr !== 'An electronic chip that makes the computer work.') {
discover_processor($valid['processor'], $device, $usage_oid, $index, 'hr', $descr, 1, $usage, NULL, $hrDeviceIndex);
$hr_cpus++;
$hr_total += $usage;
}
unset($old_rrd, $new_rrd, $descr, $entry, $usage_oid, $index, $usage, $hrDeviceIndex);
if ($entry['hrDeviceType'] === 'hrDeviceProcessor') {
$hrDeviceIndex = $entry['hrDeviceIndex'];
$usage_oid = ".1.3.6.1.2.1.25.3.3.1.2.$index";
$usage = $entry['hrProcessorLoad'];
// Workaround to set fake description for Mikrotik and other who don't populate hrDeviceDescr
if (empty($entry['hrDeviceDescr'])) {
$descr = 'Processor';
if ($hr_count > 1) {
// Append processor index
$descr .= ' ' . ($index - 1);
}
} elseif (str_contains($entry['hrDeviceDescr'], ':')) {
// What is this for? I have forgotten. What has : in its hrDeviceDescr?
// Set description to that found in hrDeviceDescr, first part only if containing a :
[, $descr] = explode(':', $entry['hrDeviceDescr']);
} else {
$descr = $entry['hrDeviceDescr'];
}
$descr = rewrite_entity_name($descr);
if ($descr !== 'An electronic chip that makes the computer work.') {
discover_processor($valid['processor'], $device, $usage_oid, $index, 'hr', $descr, 1, $usage, NULL, $hrDeviceIndex);
$hr_cpus++;
$hr_total += $usage;
}
unset($old_rrd, $new_rrd, $descr, $entry, $usage_oid, $index, $usage, $hrDeviceIndex);
}
unset($entry);
}
unset($entry);
}
if ($hr_cpus) {
discover_processor($valid['processor'], $device, 1, 1, 'hr-average', 'Average', 1, $hr_total / $hr_cpus);
//$ucd_count = @dbFetchCell("SELECT COUNT(*) FROM `processors` WHERE `device_id` = ? AND `processor_type` = 'ucd-old'", array($device['device_id']));
//if ($ucd_count)
if (dbExist('processors', '`device_id` = ? AND `processor_type` = ?', [ $device['device_id'], 'ucd-old' ])) {
$GLOBALS['module_stats']['processors']['deleted']++; //echo('-');
dbDelete('processors', "`device_id` = ? AND `processor_type` = ?", [ $device['device_id'], 'ucd-old' ]); // Heh, this is because UCD-SNMP-MIB run earlier
if ($hr_cpus) {
discover_processor($valid['processor'], $device, 1, 1, 'hr-average', 'Average', 1, $hr_total / $hr_cpus);
// Remove UCD processor poller, this is because UCD-SNMP-MIB run earlier
$ucd_where = '`device_id` = ? AND `processor_type` IN (?, ?)';
$ucd_params = [ $device['device_id'], 'ucd-old', 'ucd-raw' ];
if (dbExist('processors', $ucd_where, $ucd_params)) {
print_debug("Removed UCD processor, prefer HOST-RESOURCES average");
$GLOBALS['module_stats']['processors']['deleted']++;
dbDelete('processors', $ucd_where, $ucd_where);
}
}
}
unset($hr_array, $oid);
unset($hr_array, $oid, $ucd_where, $ucd_params);
}
// EOF

View File

@ -5,9 +5,9 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
@ -16,22 +16,19 @@
// 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_oid($device, $oid, $processors_array, 'ENTITY-MIB:HPN-ICF-ENTITY-EXT-MIB');
$oids = ['hpnicfEntityExtCpuUsage', 'entPhysicalName'];
$processors_array = [];
foreach ($oids as $oid) {
$processors_array = snmpwalk_cache_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);
}
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);

View File

@ -4,45 +4,45 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
$processors_array = snmpwalk_cache_oid($device, 'hwEntityCpuUsage', [], 'HUAWEI-ENTITY-EXTENT-MIB');
if (!safe_empty($processors_array)) {
$processors_array = snmpwalk_cache_oid($device, 'hwEntityCpuUsageThreshold', $processors_array, 'HUAWEI-ENTITY-EXTENT-MIB');
$processors_array = snmpwalk_cache_oid($device, 'hwEntityMemSize', $processors_array, 'HUAWEI-ENTITY-EXTENT-MIB');
$processors_array = snmpwalk_cache_oid($device, 'entPhysicalName', $processors_array, 'ENTITY-MIB');
$processors_array = snmpwalk_cache_oid($device, 'hwEntityCpuUsageThreshold', $processors_array, 'HUAWEI-ENTITY-EXTENT-MIB');
$processors_array = snmpwalk_cache_oid($device, 'hwEntityMemSize', $processors_array, 'HUAWEI-ENTITY-EXTENT-MIB');
$processors_array = snmpwalk_cache_oid($device, 'entPhysicalName', $processors_array, 'ENTITY-MIB');
foreach ($processors_array as $index => $entry) {
if (!is_numeric($entry['hwEntityCpuUsage'])) {
print_debug("Entity is not support CPU usage:");
print_debug_vars($entry);
foreach ($processors_array as $index => $entry) {
if (!is_numeric($entry['hwEntityCpuUsage'])) {
print_debug("Entity is not support CPU usage:");
print_debug_vars($entry);
continue;
}
if (isset($entry['hwEntityMemSize'])) {
// not all platforms have hwEntityMemSize.. what tf
if ($entry['hwEntityMemSize'] == 0) {
print_debug("Entity is not support CPU usage:");
print_debug_vars($entry);
continue;
}
} elseif (isset($entry['hwEntityCpuUsageThreshold']) && $entry['hwEntityCpuUsageThreshold'] == 0 && $entry['hwEntityCpuUsage'] == 0) {
print_debug("Entity is not support CPU usage:");
print_debug_vars($entry);
continue;
}
print_debug($index . ' ' . $entry['entPhysicalName'] . ' -> ' . $entry['hwEntityCpuUsage'] . ' -> ' . $entry['hwEntityMemSize']);
$usage_oid = ".1.3.6.1.4.1.2011.5.25.31.1.1.1.1.5.$index";
$descr = rewrite_entity_name($entry['entPhysicalName']);
if (!safe_empty($descr) && !str_contains($descr, 'No')) {
discover_processor($valid['processor'], $device, $usage_oid, $index, 'vrp', $descr, 1, $entry['hwEntityCpuUsage']);
}
} // End Foreach
continue;
}
if (isset($entry['hwEntityMemSize'])) {
// not all platforms have hwEntityMemSize.. what tf
if ($entry['hwEntityMemSize'] == 0) {
print_debug("Entity is not support CPU usage:");
print_debug_vars($entry);
continue;
}
} elseif (isset($entry['hwEntityCpuUsageThreshold']) && $entry['hwEntityCpuUsageThreshold'] == 0 && $entry['hwEntityCpuUsage'] == 0) {
print_debug("Entity is not support CPU usage:");
print_debug_vars($entry);
continue;
}
print_debug($index . ' ' . $entry['entPhysicalName'] . ' -> ' . $entry['hwEntityCpuUsage'] . ' -> ' . $entry['hwEntityMemSize']);
$usage_oid = ".1.3.6.1.4.1.2011.5.25.31.1.1.1.1.5.$index";
$descr = rewrite_entity_name($entry['entPhysicalName']);
if (!safe_empty($descr) && !str_contains($descr, 'No')) {
discover_processor($valid['processor'], $device, $usage_oid, $index, 'vrp', $descr, 1, $entry['hwEntityCpuUsage']);
}
} // End Foreach
} // End if array
unset($processors_array);

View File

@ -5,9 +5,9 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
@ -28,23 +28,24 @@
//ISILON-MIB::nodePerCPUIdle.2 = Gauge32: 972
// Skip this processors discovery if HOST-RESOURCES-MIB discovered and exist
if (isset($valid['processor']['hr']) || isset($valid['processor']['hr-average'])) { return; }
if (isset($valid['processor']['hr']) || isset($valid['processor']['hr-average'])) {
return;
}
$processors_array = snmpwalk_cache_oid($device, 'nodePerCPUIdle', array(), 'ISILON-MIB');
$processors_array = snmpwalk_cache_oid($device, 'nodePerCPUIdle', [], 'ISILON-MIB');
//print_vars($processors_array);
$processors_count = count($processors_array);
foreach ($processors_array as $index => $entry)
{
$dot_index = ".{$index}";
$descr = 'Processor ' . strval($index - 1);
$oid_table = 'nodeCPUPerfTable';
$oid_name = 'nodePerCPUIdle';
$oid_num = ".1.3.6.1.4.1.12124.2.2.3.10.1.5{$dot_index}";
$usage = $entry[$oid_name];
$idle = 1;
foreach ($processors_array as $index => $entry) {
$dot_index = ".{$index}";
$descr = 'Processor ' . strval($index - 1);
$oid_table = 'nodeCPUPerfTable';
$oid_name = 'nodePerCPUIdle';
$oid_num = ".1.3.6.1.4.1.12124.2.2.3.10.1.5{$dot_index}";
$usage = $entry[$oid_name];
$idle = 1;
discover_processor($valid['processor'], $device, $oid_num, $oid_table . $dot_index, $oid_name, $descr, 10, $usage, NULL, NULL, $idle);
discover_processor($valid['processor'], $device, $oid_num, $oid_table . $dot_index, $oid_name, $descr, 10, $usage, NULL, NULL, $idle);
}
unset($processors_array, $dot_index, $entry, $descr, $oid_table, $oid_name, $oid_num, $usage, $idle);

View File

@ -4,32 +4,34 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
$processors_array = snmpwalk_cache_oid($device, 'jnxOperatingCPU', [], $mib);
if (!safe_empty($processors_array)) {
$processors_array = snmpwalk_cache_oid($device, 'jnxOperatingDRAMSize', $processors_array, $mib);
$processors_array = snmpwalk_cache_oid($device, 'jnxOperatingDescr', $processors_array, $mib);
$processors_array = snmpwalk_cache_oid($device, 'jnxOperatingDRAMSize', $processors_array, $mib);
$processors_array = snmpwalk_cache_oid($device, 'jnxOperatingDescr', $processors_array, $mib);
foreach ($processors_array as $index => $entry) {
if (str_contains_array($entry['jnxOperatingDescr'], [ 'Routing Engine', 'FPC']) ||
$entry['jnxOperatingDRAMSize'] > 0) {
foreach ($processors_array as $index => $entry) {
if (str_contains_array($entry['jnxOperatingDescr'], ['Routing Engine', 'FPC']) ||
$entry['jnxOperatingDRAMSize'] > 0) {
if (!is_numeric($entry['jnxOperatingCPU']) ||
str_icontains_array($entry['jnxOperatingDescr'], [ 'sensor', 'fan', 'pcmcia', 'no' ])) { continue; }
if (!is_numeric($entry['jnxOperatingCPU']) ||
str_icontains_array($entry['jnxOperatingDescr'], ['sensor', 'fan', 'pcmcia', 'no'])) {
continue;
}
$oid = ".1.3.6.1.4.1.2636.3.1.13.1.8.$index";
$descr = $entry['jnxOperatingDescr'];
$usage = $entry['jnxOperatingCPU'];
$oid = ".1.3.6.1.4.1.2636.3.1.13.1.8.$index";
$descr = $entry['jnxOperatingDescr'];
$usage = $entry['jnxOperatingCPU'];
discover_processor($valid['processor'], $device, $oid, $index, 'junos', $descr, 1, $usage);
} // End if checks
} // End Foreach
discover_processor($valid['processor'], $device, $oid, $index, 'junos', $descr, 1, $usage);
} // End if checks
} // End Foreach
} // End if array
unset($processors_array);

View File

@ -5,23 +5,22 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
$srx_spu_array = snmpwalk_cache_oid($device, 'jnxJsSPUMonitoringNodeDescr', array(), $mib);
$srx_spu_array = snmpwalk_cache_oid($device, 'jnxJsSPUMonitoringNodeDescr', [], $mib);
$srx_spu_array = snmpwalk_cache_oid($device, 'jnxJsSPUMonitoringFPCIndex', $srx_spu_array, $mib);
$srx_spu_array = snmpwalk_cache_oid($device, 'jnxJsSPUMonitoringCPUUsage', $srx_spu_array, $mib);
foreach ($srx_spu_array as $index => $entry)
{
$oid = ".1.3.6.1.4.1.2636.3.39.1.12.1.1.1.4.$index"; // node0 FPC: SRX3k SPC
$descr = ($entry['jnxJsSPUMonitoringNodeDescr'] == 'single' ? '' : $entry['jnxJsSPUMonitoringNodeDescr'] . ' ') . 'SPC slot ' . $entry['jnxJsSPUMonitoringFPCIndex'];
$usage = $entry['jnxJsSPUMonitoringCPUUsage'];
foreach ($srx_spu_array as $index => $entry) {
$oid = ".1.3.6.1.4.1.2636.3.39.1.12.1.1.1.4.$index"; // node0 FPC: SRX3k SPC
$descr = ($entry['jnxJsSPUMonitoringNodeDescr'] == 'single' ? '' : $entry['jnxJsSPUMonitoringNodeDescr'] . ' ') . 'SPC slot ' . $entry['jnxJsSPUMonitoringFPCIndex'];
$usage = $entry['jnxJsSPUMonitoringCPUUsage'];
discover_processor($valid['processor'], $device, $oid, $index, 'junos', $descr, 1, $usage);
discover_processor($valid['processor'], $device, $oid, $index, 'junos', $descr, 1, $usage);
}
unset ($srx_spu_array, $oid, $descr, $usage, $index, $entry);

View File

@ -5,29 +5,26 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
$processors_array = snmpwalk_cache_double_oid($device, 'juniSystemModule', array(), 'Juniper-System-MIB');
$processors_array = snmpwalk_cache_double_oid($device, 'juniSystemModule', [], 'Juniper-System-MIB');
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'];
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);
if (!strstr($descr, 'No') && !strstr($usage, 'No') && $descr != '') {
discover_processor($valid['processor'], $device, $usage_oid, $index, 'junose', $descr, 1, $usage, $entPhysicalIndex);
}
}
}
}
unset ($processors_array);

View File

@ -5,9 +5,9 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
@ -16,18 +16,18 @@
#NS-ROOT-MIB::nsCPUusage."cpu0" = Gauge32: 0
if (safe_empty($nsaarray)) {
$nsarray = snmpwalk_cache_oid($device, 'nsCPUTable', [], $mib);
$nsarray = snmpwalk_cache_oid($device, 'nsCPUTable', [], $mib);
}
foreach ($nsarray as $descr => $data) {
$current = $data['nsCPUusage'];
$current = $data['nsCPUusage'];
$oid = '.1.3.6.1.4.1.5951.4.1.1.41.6.1.2.' . snmp_string_to_oid($descr);
$descr = $data['nsCPUname'];
$oid = '.1.3.6.1.4.1.5951.4.1.1.41.6.1.2.' . snmp_string_to_oid($descr);
$descr = $data['nsCPUname'];
// FIXME, when will converted to definition-based, note that here used "named" index instead numeric
discover_processor($valid['processor'], $device, $oid, $descr, 'netscaler', $descr, 1, $current);
// FIXME, when will converted to definition-based, note that here used "named" index instead numeric
discover_processor($valid['processor'], $device, $oid, $descr, 'netscaler', $descr, 1, $current);
}
unset($nsarray, $oid, $descr, $current);

View File

@ -5,21 +5,20 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
$processors_array = snmpwalk_cache_oid($device, 'cpu', array(), $mib);
$processors_array = snmpwalk_cache_oid($device, 'cpu', [], $mib);
foreach ($processors_array as $index => $entry)
{
$descr = $entry['cpuDescr'];
$oid = ".1.3.6.1.4.1.1768.100.70.10.2.1.3.$index";
$usage = $entry['cpuWorkload5MinuteAverage'];
foreach ($processors_array as $index => $entry) {
$descr = $entry['cpuDescr'];
$oid = ".1.3.6.1.4.1.1768.100.70.10.2.1.3.$index";
$usage = $entry['cpuWorkload5MinuteAverage'];
discover_processor($valid['processor'], $device, $oid, $index, 'smartnode', $descr, 1, $usage);
discover_processor($valid['processor'], $device, $oid, $index, 'smartnode', $descr, 1, $usage);
}
unset ($processors_array);

View File

@ -1,5 +1,4 @@
<?php
/**
* Observium
*
@ -7,8 +6,7 @@
*
* @package observium
* @subpackage discovery
* @author Adam Armstrong <adama@observium.org>
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @copyright (C) Adam Armstrong
*
*/
@ -17,18 +15,32 @@
//if ($device['os_group'] == 'unix' && $count == 0)
//if ($count_processors == 0)
if (!dbExist('processors', '`device_id` = ? AND `processor_type` != ?', array($device['device_id'], 'ucd-old')))
{
//$system = snmp_get($device, 'ssCpuSystem.0', '-OvQ', $mib);
//$user = snmp_get($device, 'ssCpuUser.0' , '-OvQ', $mib);
//$idle = snmp_get($device, 'ssCpuIdle.0' , '-OvQ', $mib);
$idle = snmp_get_oid($device, 'ssCpuIdle.0', $mib);
if (dbExist('processors', '`device_id` = ? AND `processor_type` NOT IN (?, ?)', [ $device['device_id'], 'ucd-cpu', 'ucd-raw' ])) {
print_debug("Skip UCD CPU. Already exist better processor(s)");
return;
}
if (is_numeric($idle))
{
//$percent = $system + $user + $idle;
discover_processor($valid['processor'], $device, 0, 0, 'ucd-old', 'CPU', 1, $idle, NULL, NULL, 1);
}
if ($ss = snmp_get_multi_oid($device, 'ssCpuIdle.0 ssCpuSystem.0 ssCpuUser.0 ssCpuRawIdle.0 ssCpuRawSystem.0', [], $mib)) {
$ss = $ss[0];
// Note. ssCpuIdle is deprecated, needs to use ssCpuRawIdle, but it's a COUNTER
if (is_numeric($ss['ssCpuIdle']) &&
($ss['ssCpuIdle'] + $ss['ssCpuSystem'] + $ss['ssCpuUser']) > 0) {
//$percent = $system + $user + $idle;
discover_processor($valid['processor'], $device, 0, 0, 'ucd-old', 'CPU', 1, $ss['ssCpuIdle'], NULL, NULL, 1);
} elseif (is_numeric($ss['ssCpuRawIdle']) &&
($ss['ssCpuRawIdle'] + $ss['ssCpuRawSystem']) > 0) {
print_debug_vars($ss);
// Warning. This is counter, please do not pass raw value. Poller calculates value from previous
// Still required for a device who does not support HOST-RESOURCES-MIB but ignores simple ssCpuIdle
if (($processor_id = discover_processor($valid['processor'], $device, 0, 0, 'ucd-raw', 'CPU', 1, 100, NULL, NULL, 1)) &&
empty(get_entity_attrib('processor', $processor_id, 'value-raw'))) {
// store initial raw value for next poll
set_entity_attrib('processor', $processor_id, 'value-raw', $ss['ssCpuRawIdle']);
}
}
}
// EOF

View File

@ -4,21 +4,21 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
$processors_array = snmpwalk_cache_oid($device, 'wlsxSysXProcessorTable', [], $mib);
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);
}
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);

View File

@ -5,9 +5,9 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
@ -19,21 +19,19 @@
// ZHONE-CARD-RESOURCES-MIB::cardProcessorFrameworkUsage.1.1 = INTEGER: 35
// ZHONE-CARD-RESOURCES-MIB::cardProcessorLowUsage.1.1 = INTEGER: 2
$processors_array = snmpwalk_cache_oid($device, 'cardProcessorUsage', array(), $mib); // INDEX { zhoneShelfIndex, zhoneSlotIndex }
$processors_array = snmpwalk_cache_oid($device, 'cardProcessorUsage', [], $mib); // INDEX { zhoneShelfIndex, zhoneSlotIndex }
$processors_count = count($processors_array);
foreach ($processors_array as $index => $entry)
{
$descr = 'Processor';
if ($processors_count > 1)
{
list($zhoneShelfIndex, $zhoneSlotIndex) = explode('.', $index);
$descr .= " - Shelf $zhoneShelfIndex, Slot $zhoneSlotIndex";
}
$oid_name = 'cardProcessorUsage';
$oid_num = ".1.3.6.1.4.1.5504.3.3.3.1.5.$index";
$type = 'ZHONE-CARD-RESOURCES-MIB-'.$oid_name;
discover_processor($valid['processor'], $device, $oid_num, $index, $type, $descr, 1, $entry[$oid_name]);
foreach ($processors_array as $index => $entry) {
$descr = 'Processor';
if ($processors_count > 1) {
[$zhoneShelfIndex, $zhoneSlotIndex] = explode('.', $index);
$descr .= " - Shelf $zhoneShelfIndex, Slot $zhoneSlotIndex";
}
$oid_name = 'cardProcessorUsage';
$oid_num = ".1.3.6.1.4.1.5504.3.3.3.1.5.$index";
$type = 'ZHONE-CARD-RESOURCES-MIB-' . $oid_name;
discover_processor($valid['processor'], $device, $oid_num, $index, $type, $descr, 1, $entry[$oid_name]);
}
unset($processors_array);

View File

@ -5,38 +5,37 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
$processors_array = snmpwalk_cache_oid($device, 'zxr10SystemUnitTable', array(), $mib);
$processors_array = snmpwalk_cache_oid($device, 'zxr10SystemUnitTable', [], $mib);
$processors_count = count($processors_array);
//print_vars($processors_array);
foreach ($processors_array as $index => $entry)
{
if ($entry['zxr10SystemUnitRunStatus'] == 'down') { continue; }
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;
}
$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];
$type = $mib . '-' . $oid_name;
$usage = $entry[$oid_name];
discover_processor($valid['processor'], $device, $oid_num, $index, $type, $descr, 1, $usage);
discover_processor($valid['processor'], $device, $oid_num, $index, $type, $descr, 1, $usage);
}
unset($processors_array);