SnmpKit.SnmpMgr.Core (snmpkit v0.6.6)
Core SNMP operations using Erlang's SNMP PDU functions directly.
This module handles the low-level SNMP PDU encoding/decoding and UDP communication without requiring the heavyweight :snmpm manager process.
Summary
Functions
Parses and normalizes an OID to internal list format.
Sends an SNMP GETBULK request (SNMPv2c only).
Sends an asynchronous SNMP GETBULK request.
Sends a GETNEXT request to retrieve the next OID in the MIB tree.
Sends an SNMP GET request and returns the response.
Sends an asynchronous SNMP GET request.
Sends a GET request and returns the result in 3-tuple format.
Sends an SNMP SET request and returns the response.
Types
Functions
@spec parse_oid(oid()) :: {:ok, [non_neg_integer()]} | {:error, term()}
Parses and normalizes an OID to internal list format.
Converts external OID input (string or list) to internal list of integers format. This function establishes the API boundary - all external input is converted to internal list format here.
@spec send_get_bulk_request(target(), oid(), opts()) :: snmp_result()
Sends an SNMP GETBULK request (SNMPv2c only).
Sends an asynchronous SNMP GETBULK request.
@spec send_get_next_request(target(), oid(), opts()) :: snmp_result()
Sends a GETNEXT request to retrieve the next OID in the MIB tree.
Now uses the proper SnmpKit.SnmpLib.Manager.get_next/3 function which handles version-specific logic (GETNEXT for v1, GETBULK for v2c+) correctly.
@spec send_get_request(target(), oid(), opts()) :: snmp_result()
Sends an SNMP GET request and returns the response.
Sends an asynchronous SNMP GET request.
@spec send_get_request_with_type(target(), oid(), opts()) :: {:ok, {String.t(), atom(), any()}} | {:error, any()}
Sends a GET request and returns the result in 3-tuple format.
This function returns {oid_string, type, value}
for consistency with
other operations like walk, bulk, etc.
@spec send_set_request(target(), oid(), term(), opts()) :: snmp_result()
Sends an SNMP SET request and returns the response.