Add complete memory pool monitoring using HOST-RESOURCES-MIB. Tracks RAM/swap usage with historical data and real-time updates. - Add Mempool and MempoolReading schemas - Integrate discovery and polling with concurrent Task.async_stream - Add 7 context API functions for querying mempools - 24 new tests, all 8754 tests passing (0 failures) Implements C1 from findings_librenms.md Reviewed-on: graham/towerops-web#184
27 lines
833 B
Elixir
27 lines
833 B
Elixir
defmodule Towerops.Repo.Migrations.CreateSnmpMempools do
|
|
use Ecto.Migration
|
|
|
|
def change do
|
|
create table(:snmp_mempools, primary_key: false) do
|
|
add :id, :binary_id, primary_key: true
|
|
|
|
add :snmp_device_id, references(:snmp_devices, type: :binary_id, on_delete: :delete_all),
|
|
null: false
|
|
|
|
add :mempool_index, :string, null: false
|
|
add :description, :string
|
|
add :mempool_type, :string, null: false
|
|
add :total_bytes, :bigint
|
|
add :used_bytes, :bigint
|
|
add :free_bytes, :bigint
|
|
add :usage_percent, :float
|
|
add :last_checked_at, :utc_datetime
|
|
add :metadata, :map, default: %{}
|
|
|
|
timestamps(type: :utc_datetime)
|
|
end
|
|
|
|
create index(:snmp_mempools, [:snmp_device_id])
|
|
create unique_index(:snmp_mempools, [:snmp_device_id, :mempool_index])
|
|
end
|
|
end
|