mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
Add SNMP scanner that polls a gateway's ARP table
Introduce a sixth scanner that periodically queries an SNMP agent
(typically the router/firewall) for its ARP/neighbour cache via
SNMPv2c and feeds discovered devices into the shared devices, events
and notifications pipeline. Unlike the ARP scanner it generates no
traffic on the local segment and can surface devices across all
subnets the agent routes.
Scope is intentionally minimal: SNMPv2c only, a single target, and the
ipNetToMediaTable (ARP) only. SNMPv3 and switch MAC/forwarding-table
polling are left as follow-ups in TODO.md.
- backend: csnmp dependency; SnmpScanner config (opt-in, off unless a
[snmp_scanner] section is present); DeviceEventScanner::Snmp;
scanners/snmp/{finder,scanner,status}; main.rs wiring; status API
endpoint wired into OpenAPI
- frontend: SNMP scanner status model, card, API method, status screen
and summary card rows, and device-event label
- docs/config: sample TOML, README options, NixOS module option, and
setup notes for enabling SNMP on pfSense/OPNsense
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
20c51faaea
commit
2987f66363
@@ -76,6 +76,31 @@ in {
|
||||
description = "Whether to run the DHCP scanner.";
|
||||
default = true;
|
||||
};
|
||||
snmp_scanner.enabled = mkOption {
|
||||
type = types.bool;
|
||||
description = "Whether to run the SNMP scanner. Off by default; requires a target and community to be set.";
|
||||
default = false;
|
||||
};
|
||||
snmp_scanner.target = mkOption {
|
||||
type = types.str;
|
||||
description = "SNMP agent to poll, as host:port (e.g. the gateway: 192.168.1.1:161). The scanner reads its ARP table over SNMPv2c.";
|
||||
default = "";
|
||||
};
|
||||
snmp_scanner.community = mkOption {
|
||||
type = types.str;
|
||||
description = "SNMPv2c read-only community string. Use a read-only community and avoid committing real secrets.";
|
||||
default = "";
|
||||
};
|
||||
snmp_scanner.wait_between_scans = mkOption {
|
||||
type = types.str;
|
||||
description = "Wait time between SNMP polls. Keep it well under the agent's ARP cache timeout so active devices aren't missed.";
|
||||
default = "2m";
|
||||
};
|
||||
snmp_scanner.timeout = mkOption {
|
||||
type = types.str;
|
||||
description = "Per-poll SNMP request timeout.";
|
||||
default = "3s";
|
||||
};
|
||||
notifications.method = mkOption {
|
||||
type = types.str;
|
||||
description = "For now just pushover, you can set this to none to avoid sending notifications (it will just log).";
|
||||
|
||||
Reference in New Issue
Block a user