Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions LibreNMS/Discovery/Yaml/YamlDiscoveryField.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public function getNumericNames(): array
if ($this->key === 'value') {
// only one oid
$prefix = strstr($this->model_column, '_', true) ?: $this->model_column;

return [
'num_oid',
$prefix . '_oid',
Expand All @@ -102,6 +103,7 @@ private function setValue(mixed $value): void
{
if (is_callable($this->callback)) {
$this->value = call_user_func($this->callback, $value);

return;
}

Expand Down
2 changes: 1 addition & 1 deletion LibreNMS/Modules/Processors.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function poll(OS $os, DataStorageInterface $datastore): void
Log::info("$processor->processor_descr: $usage%");

$rrd_name = ['processor', $processor->processor_type, $processor->processor_index];
$tags = ['processor_type' => $processor->processor_type, 'processor_index' => $processor->processor_index, 'rrd_name' => $rrd_name, 'rrd_def' => $rrd_def];
$tags = ['processor_type' => $processor->processor_type, 'processor_index' => $processor->processor_index, 'rrd_name' => $rrd_name, 'rrd_def' => $rrd_def];
$fields = ['usage' => $usage];
$datastore->put($os->getDeviceArray(), 'processors', $tags, $fields);

Expand Down
1 change: 0 additions & 1 deletion LibreNMS/OS/Boss.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
use App\Models\PortVlan;
use App\Models\Vlan;
use Illuminate\Support\Collection;
use LibreNMS\Device\Processor;
use LibreNMS\Interfaces\Discovery\OSDiscovery;
use LibreNMS\Interfaces\Discovery\VlanDiscovery;
use LibreNMS\Interfaces\Discovery\VlanPortDiscovery;
Expand Down
2 changes: 1 addition & 1 deletion LibreNMS/OS/Lcossx.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function pollProcessors(Collection $processors): Collection
$cpuList = $this->convertProcessorData($data);

foreach ($processors as $processor) {
$key = explode(' ',(string) $processor->processor_descr)[1];
$key = explode(' ', (string) $processor->processor_descr)[1];
$processor->processor_usage = $cpuList[$key] ?? 0;
}

Expand Down
2 changes: 1 addition & 1 deletion LibreNMS/OS/Traits/VxworksProcessorUsage.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ trait VxworksProcessorUsage
*/
public function discoverProcessors($oid = '.1.3.6.1.4.1.4413.1.1.1.1.4.9.0'): Collection
{
$usage = SnmpQuery::get($oid)->value();
$usage = SnmpQuery::get($oid)->value();
if ($usage) {
$usage = $this->parseCpuUsageString($usage);
if (is_numeric($usage)) {
Expand Down
2 changes: 1 addition & 1 deletion app/View/SimpleTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ private function dateFilter(string $value, array $args): string

private function padFilter(string $value, array $args): string
{
$direction = match($args[2] ?? 'left') {
$direction = match ($args[2] ?? 'left') {
'right' => STR_PAD_RIGHT,
'both' => STR_PAD_BOTH,
default => STR_PAD_LEFT,
Expand Down
Loading