diff --git a/lib/towerops/agent/validator.ex b/lib/towerops/agent/validator.ex index 60a84241..9689db7b 100644 --- a/lib/towerops/agent/validator.ex +++ b/lib/towerops/agent/validator.ex @@ -60,7 +60,8 @@ defmodule Towerops.Agent.Validator do # Collection limits (prevent DoS via large batches) @max_metrics_per_batch 10_000 - @max_oid_values 1_000 + # Discovery on enterprise devices can return 10k-50k OIDs (interfaces, routing tables, etc.) + @max_oid_values 50_000 @max_mikrotik_sentences 1_000 @max_capabilities 20 diff --git a/test/towerops/agent/validator_test.exs b/test/towerops/agent/validator_test.exs index a1553b0c..8f28857c 100644 --- a/test/towerops/agent/validator_test.exs +++ b/test/towerops/agent/validator_test.exs @@ -365,8 +365,8 @@ defmodule Towerops.Agent.ValidatorTest do end test "rejects too many OID values" do - # Create map with more than max allowed OIDs - oid_values = Map.new(1..1100, fn i -> {"1.3.6.1.#{i}", "value"} end) + # Create map with more than max allowed OIDs (max is 50_000) + oid_values = Map.new(1..50_100, fn i -> {"1.3.6.1.#{i}", "value"} end) result = %SnmpResult{ device_id: "550e8400-e29b-41d4-a716-446655440000",