mib
github.com/hallidave/mibtool
go get github.com/hallidave/mibtool
mib

github.com/hallidave/mibtool

SNMP MIB parser and command-line tool

by Dave Halliday

v0.2.0 (see all)License:MIT
go get github.com/hallidave/mibtool
Readme

SNMP MIB Parser for Go

Build Status GoDoc Version

The mibtool module contains packages for parsing SNMP MIBs and querying the information contained in them.

The information that can currently be extracted from MIBs is limited to symbol information and OIDs, but the intention is to extend the code to make more information available.

Installation

go get -u github.com/hallidave/mibtool/smi

Examples

mib := smi.NewMIB("/usr/share/snmp/mibs/iana", "/usr/share/snmp/mibs/ietf")
mib.Debug = true
err := mib.LoadModules("IF-MIB")
if err != nil {
    log.Fatal(err)
}

// Walk all symbols in MIB
mib.VisitSymbols(func(sym *smi.Symbol, oid smi.OID) {
    fmt.Printf("%-40s %s\n", sym, oid)
})

// Look up OID for an OID string
oid, err := mib.OID("IF-MIB::ifOperStatus.4")
if err != nil {
    log.Fatal(err)
}
fmt.Println(oid.String())

GitHub Stars

11

LAST COMMIT

3yrs ago

MAINTAINERS

0

CONTRIBUTORS

1

OPEN ISSUES

1

OPEN PRs

0
VersionTagPublished
v0.2.1-0.20190722121625-8972047a6c3e
1yr ago
v0.1.0
3yrs ago
v0.2.0
3yrs ago
No alternatives found
No tutorials found
Add a tutorial