initial commit; version 22.5.12042
This commit is contained in:
23
includes/polling/processors/ciena.inc.php
Normal file
23
includes/polling/processors/ciena.inc.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage poller
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
// FIXME. move to definitions
|
||||
if (isset($oid_cache[$processor['processor_oid']]))
|
||||
{
|
||||
$load = $oid_cache[$processor['processor_oid']];
|
||||
} else {
|
||||
$load = snmp_get_oid($device, '.1.3.6.1.4.1.6141.2.60.12.1.7.4.0');
|
||||
}
|
||||
$proc = (float) $load / 100;
|
||||
|
||||
// EOF
|
31
includes/polling/processors/dnos-switching-mib.inc.php
Normal file
31
includes/polling/processors/dnos-switching-mib.inc.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage poller
|
||||
* @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%)"
|
||||
|
||||
// FIXME. move to definitions
|
||||
if (isset($oid_cache[$processor['processor_oid']]))
|
||||
{
|
||||
$data = $oid_cache[$processor['processor_oid']];
|
||||
} else {
|
||||
$data = snmp_get_oid($device, 'agentSwitchCpuProcessTotalUtilization.0', 'DNOS-SWITCHING-MIB');
|
||||
}
|
||||
|
||||
if (preg_match('/300 Secs \(\s*(?<proc>[\d\.]+)%\)/', $data, $matches))
|
||||
{
|
||||
$proc = $matches['proc'];
|
||||
}
|
||||
|
||||
unset($data, $matches);
|
||||
|
||||
// EOF
|
31
includes/polling/processors/edgeswitch-switching-mib.inc.php
Normal file
31
includes/polling/processors/edgeswitch-switching-mib.inc.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage poller
|
||||
* @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%)"
|
||||
|
||||
// FIXME. move to definitions
|
||||
if (isset($oid_cache[$processor['processor_oid']]))
|
||||
{
|
||||
$data = $oid_cache[$processor['processor_oid']];
|
||||
} else {
|
||||
$data = snmp_get_oid($device, 'agentSwitchCpuProcessTotalUtilization.0', 'EdgeSwitch-SWITCHING-MIB');
|
||||
}
|
||||
|
||||
if (preg_match('/300 Secs \(\s*(?<proc>[\d\.]+)%\)/', $data, $matches))
|
||||
{
|
||||
$proc = $matches['proc'];
|
||||
}
|
||||
|
||||
unset($data, $matches);
|
||||
|
||||
// EOF
|
56
includes/polling/processors/hr-average.inc.php
Normal file
56
includes/polling/processors/hr-average.inc.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage poller
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$hrDevice_oids = array('hrDeviceType', 'hrDeviceDescr', 'hrProcessorLoad');
|
||||
$hrDevice_array = [];
|
||||
foreach ($hrDevice_oids as $oid) {
|
||||
$hrDevice_array = snmpwalk_cache_oid($device, $oid, $hrDevice_array, 'HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES');
|
||||
}
|
||||
|
||||
$hr_cpus = 0;
|
||||
$hr_total = 0;
|
||||
|
||||
if (safe_count($hrDevice_array)) {
|
||||
foreach ($hrDevice_array as $index => $entry) {
|
||||
if (!is_numeric($entry['hrProcessorLoad'])) { continue; }
|
||||
|
||||
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') {
|
||||
|
||||
$usage = $entry['hrProcessorLoad'];
|
||||
|
||||
if ($device['os'] === 'arista_eos' && $index == 1) { continue; }
|
||||
|
||||
if ($entry['hrDeviceDescr'] !== 'An electronic chip that makes the computer work.') {
|
||||
$hr_cpus++;
|
||||
$hr_total += $usage;
|
||||
}
|
||||
}
|
||||
unset($entry);
|
||||
}
|
||||
|
||||
if ($hr_cpus) {
|
||||
$proc = $hr_total / $hr_cpus;
|
||||
}
|
||||
|
||||
unset($hrDevice_oids, $hrDevice_array, $oid);
|
||||
}
|
||||
|
||||
// EOF
|
22
includes/polling/processors/nos.inc.php
Normal file
22
includes/polling/processors/nos.inc.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage poller
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
// FIXME. move to definitions
|
||||
if (isset($oid_cache[$processor['processor_oid']]))
|
||||
{
|
||||
$proc = $oid_cache[$processor['processor_oid']];
|
||||
} else {
|
||||
$proc = snmp_get_oid($device, 'swCpuUsage.0', 'SW-MIB');
|
||||
}
|
||||
|
||||
// EOF
|
28
includes/polling/processors/powerconnect.inc.php
Normal file
28
includes/polling/processors/powerconnect.inc.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage poller
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
# "5 Sec (7.31%), 1 Min (14.46%), 5 Min (10.90%)"
|
||||
|
||||
// FIXME. move to definitions
|
||||
if (isset($oid_cache[$processor['processor_oid']]))
|
||||
{
|
||||
$values = $oid_cache[$processor['processor_oid']];
|
||||
} else {
|
||||
$values = snmp_get_oid($device, 'dellLanExtension.6132.1.1.1.1.4.4.0', 'Dell-Vendor-MIB');
|
||||
}
|
||||
|
||||
preg_match('/5 Sec \((.*)%\),.*1 Min \((.*)%\),.*5 Min \((.*)%\)$/', $values, $matches);
|
||||
|
||||
$proc = $matches[3];
|
||||
|
||||
// EOF
|
35
includes/polling/processors/ucd-old.inc.php
Normal file
35
includes/polling/processors/ucd-old.inc.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage poller
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
// Simple poller for UCD old style CPU. will always poll the same index.
|
||||
|
||||
//$system = snmp_get($device, 'ssCpuSystem.0', '-OvQ', 'UCD-SNMP-MIB');
|
||||
//$user = snmp_get($device, 'ssCpuUser.0', '-OvQ', 'UCD-SNMP-MIB');
|
||||
|
||||
// FIXME. move to definitions
|
||||
if (isset($oid_cache[$processor['processor_oid']]))
|
||||
{
|
||||
$idle = $oid_cache[$processor['processor_oid']];
|
||||
} else {
|
||||
$idle = snmp_get_oid($device, 'ssCpuIdle.0', 'UCD-SNMP-MIB');
|
||||
}
|
||||
|
||||
if ($processor['processor_returns_idle'] == 1)
|
||||
{
|
||||
// Just compat before processor not updated
|
||||
$proc = $idle;
|
||||
} else {
|
||||
$proc = 100 - $idle;
|
||||
}
|
||||
|
||||
// EOF
|
40
includes/polling/processors/wmi.inc.php
Normal file
40
includes/polling/processors/wmi.inc.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage poller
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
/* Processor - Fixes "Unknown Processor Type" and "Intel" values
|
||||
TODO:
|
||||
- Need to add support for systems with multiple processor models
|
||||
*/
|
||||
|
||||
$db_cpu_names = dbFetchRows('SELECT `processor_descr` FROM `processors` WHERE `device_id` = ?', [ $device['device_id'] ]);
|
||||
|
||||
if (count(array_unique((array)$db_cpu_names)) === 1 &&
|
||||
($db_cpu_names[0]['processor_descr'] === 'Unknown Processor Type' || $db_cpu_names[0]['processor_descr'] === 'Intel')) {
|
||||
$logical_proc_count = 0;
|
||||
$cpu_count = 0;
|
||||
$cpu_names = [];
|
||||
|
||||
foreach ($wmi['processors'] as $cpu) {
|
||||
$cpu_count++;
|
||||
$logical_proc_count += $cpu['NumberOfLogicalProcessors'];
|
||||
array_push($cpu_names, $cpu['Name']);
|
||||
}
|
||||
|
||||
if (count(array_unique($cpu_names)) === 1 && $cpu_names[0] === $wmi['processors'][0]['Name']) {
|
||||
dbUpdate([ 'processor_descr' => $wmi['processors'][0]['Name']] , 'processors', '`device_id` = ? AND (`processor_descr` = ? OR `processor_descr` = ?)', [ $device['device_id'], 'Unknown Processor Type', 'Intel' ]);
|
||||
echo(' Processor Name Updated:');
|
||||
}
|
||||
}
|
||||
|
||||
echo(' '.$wmi['processors'][0]['Name']."\n");
|
||||
|
||||
// EOF
|
Reference in New Issue
Block a user