Skip to content

Commit

Permalink
Fix duplication of processor entries & limit length of type (librenms…
Browse files Browse the repository at this point in the history
…#16075)

* Fix duplication of processor entries & limit length of type

* delete duplicate processor entry

* added maxLength to processor type

* shorter processor type

* forgot to regen test data
  • Loading branch information
EinGlasVollKakao authored May 29, 2024
1 parent eed8306 commit c777d54
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion LibreNMS/Device/Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public static function runDiscovery(OS $os)

foreach ($processors as $processor) {
$processor->processor_descr = substr($processor->processor_descr, 0, 64);
$processors[] = $processor;
$processor->processor_type = substr($processor->processor_type, 0, 16);
}

if (isset($processors) && is_array($processors)) {
Expand Down
2 changes: 1 addition & 1 deletion includes/definitions/discovery/fortiauthenticator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ modules:
-
oid: facSysCpuUsage
num_oid: '.1.3.6.1.4.1.12356.113.1.4.{{ $index }}'
type: fortiauthenticator
type: fortiauth
3 changes: 2 additions & 1 deletion misc/discovery_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@
},
"value": {"$ref": "#/definitions/oid"},
"type": {
"type": "string"
"type": "string",
"maxLength": 16
},
"skip_values": {
"$ref": "#/definitions/skip_values"
Expand Down
13 changes: 1 addition & 12 deletions tests/data/fortiauthenticator.json
Original file line number Diff line number Diff line change
Expand Up @@ -838,18 +838,7 @@
"hrDeviceIndex": 0,
"processor_oid": ".1.3.6.1.4.1.12356.113.1.4.0",
"processor_index": "0",
"processor_type": "fortiauthenticat",
"processor_usage": 52,
"processor_descr": "Processor",
"processor_precision": 1,
"processor_perc_warn": 75
},
{
"entPhysicalIndex": 0,
"hrDeviceIndex": 0,
"processor_oid": ".1.3.6.1.4.1.12356.113.1.4.0",
"processor_index": "0",
"processor_type": "fortiauthenticat",
"processor_type": "fortiauth",
"processor_usage": 52,
"processor_descr": "Processor",
"processor_precision": 1,
Expand Down

0 comments on commit c777d54

Please sign in to comment.