- nix.md: TimescaleDB now enabled for both dev and test databases - nix.md: added troubleshooting section for TimescaleDB reinitialization - New: docs/features/organization-settings.md (tabbed interface, all tabs documented) - New: docs/features/device-monitoring.md (schema field reference, activity feed fields, SNMP socket management)
1.9 KiB
1.9 KiB
Device Monitoring
Device Schema
Key fields on the Device schema (Towerops.Devices.Device):
| Field | Type | Description |
|---|---|---|
device_role |
string | Device role classification (router, switch, ap, etc.) |
last_checked_at |
utc_datetime | Last time any check ran against this device |
last_discovery_at |
utc_datetime | Last SNMP discovery scan |
last_snmp_poll_at |
utc_datetime | Last SNMP metrics poll |
Note
: The schema does NOT have
device_typeorlast_seen_at— these were removed/renamed. Usedevice_roleandlast_checked_atrespectively.
Device Health Indicators
The device index shows health status based on check results:
- Status badge: up/down/warning based on latest check
- Role icon: visual indicator based on
device_role - Last checked: relative timestamp from
last_checked_at
Activity Feed
Dashboard activity feed items (from ActivityFeed.list_org_activity/2) use:
| Field | Type | Description |
|---|---|---|
summary |
string | Short description of the activity |
detail |
string | Extended detail (optional) |
timestamp |
utc_datetime | When the activity occurred |
severity |
string | info, warning, error, critical |
icon |
string | Hero icon name |
link |
string | URL to related resource |
device_name |
string | Associated device name |
site_name |
string | Associated site name |
Note
: Activity items do NOT have
descriptionorinserted_at— usesummaryandtimestamp.
SNMP Socket Management
The SNMP manager (SnmpKit.SnmpLib.Manager) uses UDP sockets for device communication. Key implementation details:
- Sockets are opened per-request and cleaned up via
try/afterblocks get_bulk,set, andget_multiall guarantee socket cleanup in all code paths- Previously, socket leaks could cause EMFILE (too many open files) errors that would crash the BEAM VM