package netsnmp

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Netsnmp_raw.MibSource

Netsnmp_mib provides the low level interface to net-snmp's MIB and ASN.1 handling functions. See the the add_mibdir(3) man page unless otherwise noted

Sourceval netsnmp_init_mib : unit -> unit

netsnmp_init_mib initialises the net-snmp mib library and must be called before most MIB functions, see per function documentation for exceptions. More information can be found in the net-snmp manual page: init_mib(3)

Sourceval shutdown_mib : unit -> unit

shutdown_mib cleans up and free memory assocated with the net-snmp mib library. Don't call any MIB functions afterwards. See shutdown_mib(3) for more details.

Sourceval add_mibdir : string -> int

add_mibdir adds a directory to the list of directories to search when loading MIB modules. This must be called after netsnmp_init_mib even though the man page says the opposite. Raises Netsnmp_exceptions.Not_found if the directory is missing. See add_mibdir(3) for more details

Sourceval read_objid : string -> Oid.t

read_objid raises an Netsnmp_exceptions.Not_found exception on failure. See read_objid(3) for more details

Sourceval get_node : string -> Oid.t

get_node raises an Netsnmp_exceptions.Not_found exception on failure. See get_module_node(3) for more details

Sourceval objid_of_int_array : int array -> Oid.t

objid_of_int_array builds an OID from an OCaml array of integers.

Sourceval objid_to_int_array : Oid.t -> int array

objid_to_int_array returns the integer values of an OID as an array.

Sourceval get_module_node : string -> string -> Oid.t

get_module_node raises an Netsnmp_exceptions.Not_found exception on failure See get_module_node(3) for more details

Sourceval netsnmp_read_module : string -> unit

The netsnmp netsnmp_read_module and read_mib functions do not provide reliable error reporting, sigh. See netsnmp_read_module(3), read_mib(3) and read_all_mibs(3) for more details

Sourceval read_mib : string -> unit
Sourceval read_all_mibs : unit -> unit
Sourceval snmp_set_mib_errors : int -> unit

snmp_set_mib_errors and snmp_set_mib_warnings set the error and warning level. Note that the netsnmp libraries have a bad habit of outputing errors even when these are set to 0. See snmp_set_mib_errors(3) and snmp_set_mib_warnings(3) for more details

Sourceval snmp_set_mib_warnings : int -> unit
Sourceval print_mib : fd:int -> unit -> unit

print_mib takes a file descriptor unlike the C API, flush any output before calling these functions to avoid output ordering issues. See print_mib(3) for more details

Sourceval fprint_objid : fd:int -> Oid.t -> unit

fprint_objid takes a file descriptor unlike the C API. See fprint_objid(3) for more details

Sourceval snprint_objid : Oid.t -> string

snprint_objid converts a Oid.t to the textual representation. See snprint_objid(3) for more details

Sourceval snprint_description : Oid.t -> string
Sourceval snmp_set_save_descriptions : bool -> unit

snmp_set_save_descriptions causes the descriptions in the MIB modules to be loaded as well. This must be called before netsnmp_init_mib. This function influences the output of the print functions as well as the snprint_* ones. See snmp_set_save_descriptions(3) for more details

Sourceval add_module_replacement : string -> string -> string -> int -> unit

add_module_replacement. See add_module_replacement(3) for more details

OCaml

Innovation. Community. Security.