Skip to content

Commit

Permalink
librenms: Replace deprecated OID 'ssCpuIdle' with 'ssCpuRawIdle'
Browse files Browse the repository at this point in the history
The 'ssCpuIdle' OID has been deprecated in favor of 'ssCpuRawIdle', which
provides more accurate CPU usage metrics over any desired time period.

This commit updates the OID used in LibreNMS from 'ssCpuIdle' to 'ssCpuRawIdle'
in FsSwitch.php to ensure more reliable CPU usage monitoring.

Changes:
- Replaced 'ssCpuIdle' with 'ssCpuRawIdle' in the SNMP walk.
- Updated the CPU usage calculation to use 'ssCpuRawIdle'.

Bug: T285229
Change-Id: I63120ccc03b597d5b9623a77a0f9e6ebd7b6cf3e
  • Loading branch information
denisse-dev committed May 16, 2024
1 parent 245a4d7 commit 8f99d44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions LibreNMS/OS/FsSwitch.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function discoverProcessors()
$processors = [];

// Tests OID from SWITCH MIB.
$processors_data = snmpwalk_cache_oid($this->getDeviceArray(), 'ssCpuIdle', [], 'SWITCH', 'fs');
$processors_data = snmpwalk_cache_oid($this->getDeviceArray(), 'ssCpuRawIdle', [], 'SWITCH', 'fs');

foreach ($processors_data as $index => $entry) {
$processors[] = Processor::discover(
Expand All @@ -52,7 +52,7 @@ public function discoverProcessors()
$index,
'CPU',
-1,
100 - $entry['ssCpuIdle']
100 - $entry['ssCpuRawIdle']
);
}

Expand Down

0 comments on commit 8f99d44

Please sign in to comment.