SnmpKit.SnmpSim.Recorder (snmpkit v2.0.1)
Records a real device into the walk-file format the simulator loads, so a
device can be captured once and replayed with
SnmpKit.SnmpSim.ProfileLoader.load_profile(type, {:walk_file, path}).
:ok = SnmpKit.Sim.record("192.168.1.1", "test/fixtures/core-switch.walk", community: "public")The file uses net-snmp's numeric snmpwalk -On style, one line per object:
.1.3.6.1.2.1.1.1.0 = STRING: "Cisco IOS Software"
.1.3.6.1.2.1.2.2.1.6.1 = Hex-STRING: 00 1A 2B 3C 4D 5E
.1.3.6.1.2.1.1.3.0 = Timeticks: (123456) 0:20:34.56Options
:root- subtree to record (default"1.3.6.1.2.1", mib-2; use"1.3.6.1"for everything the agent has, enterprise objects included):community,:version,:timeout,:retries,:walk_timeout- as forSnmpKit.SNMP.bulk_walk/3
Summary
Functions
One walk-file line for a varbind, or nil for values that cannot be recorded.
Walks target from root and writes the objects to path. Returns
{:ok, count} with the number of objects written.
Renders enriched varbinds (as returned by walks) as walk-file text.
Types
@type record_result() :: {:ok, non_neg_integer()} | {:error, term()}
Functions
One walk-file line for a varbind, or nil for values that cannot be recorded.
@spec record(term(), Path.t(), keyword()) :: record_result()
Walks target from root and writes the objects to path. Returns
{:ok, count} with the number of objects written.
Renders enriched varbinds (as returned by walks) as walk-file text.