fix(poller): fall back to generic-snmp when device has no profile assigned

SNMP devices added without a profile (e.g., via simplified add flow)
were failing with "no SNMP profile assigned". Now falls back to the
generic-snmp profile which collects standard MIB-II metrics.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jason Staack
2026-03-22 08:41:35 -05:00
parent f47438a5a5
commit d3ad0f7013
2 changed files with 19 additions and 5 deletions

View File

@@ -154,6 +154,13 @@ func (c *ProfileCache) Get(profileID string) *CompiledProfile {
return c.profiles[profileID]
}
// GetGenericID returns the profile ID of the generic-snmp fallback profile.
func (c *ProfileCache) GetGenericID() string {
c.mu.RLock()
defer c.mu.RUnlock()
return c.genericID
}
// MatchSysObjectID finds the best profile for a device's sysObjectID value
// using longest-prefix matching. Returns the generic-snmp profile ID if
// no vendor-specific prefix matches.