Module Netsnmp_raw.Mib
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
val netsnmp_init_mib : unit -> unitnetsnmp_init_mibinitialises 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)
val shutdown_mib : unit -> unitshutdown_mibcleans 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.
val add_mibdir : string -> intadd_mibdiradds a directory to the list of directories to search when loading MIB modules. This must be called afternetsnmp_init_mibeven though the man page says the opposite. RaisesNetsnmp_exceptions.Not_foundif the directory is missing. See add_mibdir(3) for more details
val read_objid : string -> Oid.tread_objidraises anNetsnmp_exceptions.Not_foundexception on failure. See read_objid(3) for more details
val get_node : string -> Oid.tget_noderaises anNetsnmp_exceptions.Not_foundexception on failure. See get_module_node(3) for more details
val get_module_node : string -> string -> Oid.tget_module_noderaises anNetsnmp_exceptions.Not_foundexception on failure See get_module_node(3) for more details
val netsnmp_read_module : string -> unitThe netsnmp
netsnmp_read_moduleand 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
val read_mib : string -> unitval read_all_mibs : unit -> unitval snmp_set_mib_errors : int -> unitsnmp_set_mib_errorsandsnmp_set_mib_warningsset 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
val snmp_set_mib_warnings : int -> unitval print_mib : fd:int -> unit -> unitprint_mibtakes 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
val fprint_objid : fd:int -> Oid.t -> unitfprint_objidtakes a file descriptor unlike the C API. See fprint_objid(3) for more details
val snprint_objid : Oid.t -> stringsnprint_objidconverts a Oid.t to the textual representation. See snprint_objid(3) for more details
val snprint_description : Oid.t -> stringval snmp_set_save_descriptions : bool -> unitsnmp_set_save_descriptionscauses the descriptions in the MIB modules to be loaded as well. This must be called beforenetsnmp_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