Skip to content

Latest commit

 

History

History
52 lines (38 loc) · 1.22 KB

README.md

File metadata and controls

52 lines (38 loc) · 1.22 KB

mibparser

This project is used to convert mib file to json format.
The created json format is in tree format.
This code takes the nodes id and the nodes parent id and finally creates an OID with this information
Informs the user if another mib file is needed for the created json format

Requirements

There must be required mib files in the specified path

Installation

go get github.com/limanmys/mib-parser-go

Usage

package main

import (
    "fmt"
    "log"

    "github.com/limanmys/mib-parser-go"
)

func main() {
    mibparserObject, err := mibparser.Load(mibparser.NewPath("./mib-files"))
    if err != nil {
        log.Fatalf("error when loading mibparser path")
    }
    mibTree, err := mibparserObject.GetJSONTree()
    if err != nil {
        log.Fatalf("error when parsing mib files, err " + err.Error())
    }
    fmt.Println("mibTree ", mibTree)

    mibObjects, err := mibparserObject.GetObjects()
    if err != nil {
        log.Fatalf("error when parsing mib files, err " + err.Error())
    }
    fmt.Println("mibObjects", mibObjects)
}

Created by

Logo